soap tutorial

adriani.jws.template.wrappers
Class WrapperDateIn

java.lang.Object
  extended by adriani.jws.template.wrappers.Wrapper
      extended by adriani.jws.template.wrappers.WrapperIn
          extended by adriani.jws.template.wrappers.WrapperDateIn

public class WrapperDateIn
extends WrapperIn

The class wrapping the ADBBean elements containing the input SOAP request for the formatDate() method.


Field Summary
protected  java.util.Date the_date
          Wrapped input value, used to store the SOAP input request value after validation.
protected  int the_id
          Wrapped input value, used to store the SOAP input request value after validation.
protected  java.lang.StringBuffer the_pattern
          Wrapped input value, used to store the SOAP input request value after validation.
 
Fields inherited from class adriani.jws.template.wrappers.WrapperIn
BLANK, DOT, EMPTY, leadingName, NO_NUMBER, NOT_A_NUMBER, NOT_AVAILABLE
 
Fields inherited from class adriani.jws.template.wrappers.Wrapper
element, logger, NOT_BIG_INTEGER, UNDEFINED
 
Constructor Summary
WrapperDateIn()
          Constructor used by the SimpleClient to test the service (empty).
WrapperDateIn(DateIn dateIn)
          Constructor used by the actual web service logic, used to set the wrapper's class fields reading the values from the ADBBean element of the input SOAP request.
 
Method Summary
 java.lang.String arrayToString()
          Serialize all the data contained by this wrapper as a String object.
 java.util.Date getDate()
          Accessor method.
 int getId()
          Accessor method.
 java.lang.StringBuffer getPattern()
          Accessor method.
 boolean hasValidID()
          Helper method, used just to improve performance by reducing multiple checks (only for frequent calls).
 void setCalendar(java.lang.StringBuffer value)
          This method is used only when the SOAP request is produced running the simple client, using hardcoded values or reading data from shell or property file.
 void setDate(java.util.Date value)
          Mutator method.
 void setDate(java.sql.Date value)
          Mutator method (overloaded).
 void setDate(java.lang.StringBuffer value)
          Mutator method (overloaded).
 void setDefaults()
          Usually input wrappers don't need to set default data in the input SOAP requests, since if some data is missing we can not assume any default behavior.
 void setId(int value)
          Mutator method.
 void setId(java.lang.String value)
          Mutator method (overloaded).
 void setId(java.lang.StringBuffer value)
          Mutator method (overloaded).
 void setPattern(java.lang.StringBuffer value)
          Mutator method.
 java.lang.StringBuffer[] toArray(boolean complete)
          Produce a StringBuffer[] array containing all data contained by this wrapper.
 java.lang.String toString()
          Serialize all the data contained by this wrapper as a String object, dot separated.
 boolean validate()
          This method should be called after that all the wrapper's fields have been properly set, in order to adjust any string requiring a particular format.
 
Methods inherited from class adriani.jws.template.wrappers.Wrapper
compareSB, getElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

the_date

protected java.util.Date the_date
Wrapped input value, used to store the SOAP input request value after validation.


the_pattern

protected java.lang.StringBuffer the_pattern
Wrapped input value, used to store the SOAP input request value after validation.


the_id

protected int the_id
Wrapped input value, used to store the SOAP input request value after validation.

Constructor Detail

WrapperDateIn

public WrapperDateIn()
Constructor used by the SimpleClient to test the service (empty).


WrapperDateIn

public WrapperDateIn(DateIn dateIn)
Constructor used by the actual web service logic, used to set the wrapper's class fields reading the values from the ADBBean element of the input SOAP request. For this reason implementation of this constructor is strongly coupled to the WSDL definition.

Parameters:
dateIn - the ADBBean object as received by the service skeleton class
Method Detail

validate

public boolean validate()
This method should be called after that all the wrapper's fields have been properly set, in order to adjust any string requiring a particular format. For example, if the datasource required that all the accent vowels must be replaced with the corresponding single quote notation, this method should take care to implement the necessary operations (converting אטילעש into a'e'e'i'o'u').

Current implementation does nothing.

Remark: to grant LOOSE COUPLING to the WSDL, the ADBBean Java classes should NOT be used within this method.

Specified by:
validate in class Wrapper
Returns:
true if all the mandatory ADBBean objects were set correctly

setDefaults

public void setDefaults()
Usually input wrappers don't need to set default data in the input SOAP requests, since if some data is missing we can not assume any default behavior. In this case, since the input ADBBean is not SOAP nillable, we don't have a criterion allowing to acknowledge if the id was set or not. For this reason, by default we set the value NOT_A_NUMBER on the ID wrapper's field.

A better solution would be to define the input ID field as SOAP nillable, but this is and advanced topic, since could lead to some interoperability issues.

Specified by:
setDefaults in class Wrapper
See Also:
Wrapper.Wrapper(), WrapperOut

getDate

public java.util.Date getDate()
Accessor method.


getPattern

public java.lang.StringBuffer getPattern()
Accessor method.


getId

public int getId()
Accessor method.


setDate

public void setDate(java.util.Date value)
Mutator method.


setDate

public void setDate(java.sql.Date value)
Mutator method (overloaded).


setDate

public void setDate(java.lang.StringBuffer value)
Mutator method (overloaded).


setCalendar

public void setCalendar(java.lang.StringBuffer value)
This method is used only when the SOAP request is produced running the simple client, using hardcoded values or reading data from shell or property file. When the SOAP request is received from an actual SOAP message, this method IS NOT USED.

If the input date is defined using a different time zone, the Utilities class will convert the input date (in string format) into a local Calendar object, and set this object in the proper class field.

Parameters:
value - the input date in string value, e.g. "2010-02-26T15:40:00+01:00"

setPattern

public void setPattern(java.lang.StringBuffer value)
Mutator method.


setId

public void setId(int value)
Mutator method.


setId

public void setId(java.lang.StringBuffer value)
Mutator method (overloaded).


setId

public void setId(java.lang.String value)
Mutator method (overloaded).


hasValidID

public boolean hasValidID()
Helper method, used just to improve performance by reducing multiple checks (only for frequent calls). Current implementation verifies if the input entity number has been actually set.


toString

public java.lang.String toString()
Serialize all the data contained by this wrapper as a String object, dot separated.

Overrides:
toString in class java.lang.Object
Returns:
a string of the type "scott.tiger.42.prince consort road.london"

arrayToString

public java.lang.String arrayToString()
Serialize all the data contained by this wrapper as a String object. This is the "old plain version" of the toString() method, which can be used only if ALL input data (contained the SOAP request) are mandatory!

Returns:
a string of the type "rome.rm.via.garibaldi.12"

toArray

public java.lang.StringBuffer[] toArray(boolean complete)
Produce a StringBuffer[] array containing all data contained by this wrapper. If this method must be used in a test environment (where dummy input data should be complete), the input flag complete allows to add some hard-coded values if the creation of the array fails.

Specified by:
toArray in class WrapperIn
Parameters:
complete - if true some hard-coded data will be created if creation of the array fails
Returns:
a StringBuffer[] array with the data contained by this wrapper

Build 19/03/2014

Morpheus Technologies - making the Zion software
Copyright © 2009-2014 Morpheus Technologies. All Rights Reserved