com.tekann.webservice.client
Class AbstractSOAP

java.lang.Object
  extended by com.tekann.webservice.client.AbstractSOAP
Direct Known Subclasses:
ParserSOAP, SOAP, SyncSOAP

public abstract class AbstractSOAP
extends java.lang.Object

Author:
SUPERWABA

Field Summary
 java.lang.String alternativeReturnTag
          An alternative tag used to identify when a tag is a answer tag.
static boolean debug
          Turn this TRUE to print the xml in the console.
static boolean disableEncoding
          The SOAP request will ask the server for GZip or ZLib encoded response by default.
 java.lang.String mtd
           
 java.lang.String namespace
           
 int openTimeout
          An alternative open timeout for the connection.
static java.lang.String prefix
          The prefix string used when sending requests.
 int readTimeout
          An alternative read timeout.
static java.lang.String suffix
          The suffix string used when sending requests.
 java.lang.String uri
           
 boolean wasCompressionUsed
          A flag that indicates if the SOAP connection was using either GZIP or ZLIB.
 int writeTimeout
          An alternative write timeout.
 
Constructor Summary
AbstractSOAP(java.lang.String mtd, java.lang.String uri)
          Constructs a SOAP request with the given parameters.
 
Method Summary
 void execute()
          This method must be called to execute the soap request
abstract  java.lang.Object getAnswer()
          Returns the answer of the soap request.
abstract  void parseAnswer(totalcross.io.Stream receivedStream)
          Parse response.
 void setObjectParam(java.lang.String paramName, java.lang.String[] fieldNames, java.lang.String[] fieldValues)
          Sets an object param identifying it as .
 void setParam(boolean param)
          Sets a boolean parameter in the order of the method call, identifying it as
 void setParam(boolean[] param)
          Sets a boolean array parameter in the order of the method call, identifying it as
 void setParam(boolean[] param, java.lang.String paramName)
          Sets a boolean array parameter in the order of the method call, identifying it as .
 void setParam(boolean param, java.lang.String paramName)
          Sets a boolean parameter in the order of the method call, identifying it as .
 void setParam(byte[] param, java.lang.String paramName)
          Sets a int array parameter in the order of the method call, identifying it as .
 void setParam(double param)
          Sets a double parameter in the order of the method call, identifying it as
 void setParam(double[] param)
          Sets a double array parameter in the order of the method call, identifying it as
 void setParam(double[] param, java.lang.String paramName)
          Sets a double array parameter in the order of the method call, identifying it as .
 void setParam(double param, java.lang.String paramName)
          Sets a double parameter in the order of the method call, identifying it as .
 void setParam(int param)
          Sets a int parameter in the order of the method call, identifying it as
 void setParam(int[] param)
          Sets a int array parameter in the order of the method call, identifying it as
 void setParam(int[] param, java.lang.String paramName)
          Sets a int array parameter in the order of the method call, identifying it as .
 void setParam(int param, java.lang.String paramName)
          Sets a int parameter in the order of the method call, identifying it as .
 void setParam(java.lang.String param)
          Sets a string parameter in the order of the method call, identifying it as
 void setParam(java.lang.String[] param)
          Sets a String array parameter in the order of the method call, identifying it as .
 void setParam(java.lang.String[] param, java.lang.String paramName)
          Sets a String array parameter in the order of the method call, identifying it as .
 void setParam(java.lang.String[] param, java.lang.String paramName, java.lang.String paramType)
          Sets an array parameter in the order of the method call.
 void setParam(java.lang.String param, java.lang.String paramName)
          Sets a string parameter in the order of the method call, identifying it as .
 void setParam(java.lang.String param, java.lang.String paramName, java.lang.String paramType)
          Sets a parameter with the name and type specified.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static boolean debug
Turn this TRUE to print the xml in the console. You may also call HttpStream.debugHeader = true. Caution: don't use this on device, because it increases a lot the memory usage.


disableEncoding

public static boolean disableEncoding
The SOAP request will ask the server for GZip or ZLib encoded response by default.
To disable encoding, set this field to true.


wasCompressionUsed

public boolean wasCompressionUsed
A flag that indicates if the SOAP connection was using either GZIP or ZLIB. This is a ready-only flag, set during the execute method, and changing its value has no effect.


namespace

public java.lang.String namespace

uri

public java.lang.String uri

mtd

public java.lang.String mtd

openTimeout

public int openTimeout
An alternative open timeout for the connection. Defaults to 25 seconds.


readTimeout

public int readTimeout
An alternative read timeout. Defaults to 60 seconds.


writeTimeout

public int writeTimeout
An alternative write timeout. Defaults to 60 seconds.


alternativeReturnTag

public java.lang.String alternativeReturnTag
An alternative tag used to identify when a tag is a answer tag.


prefix

public static java.lang.String prefix
The prefix string used when sending requests. Note that it uses UTF-8, so unicode characters are not supported.


suffix

public static java.lang.String suffix
The suffix string used when sending requests.

Constructor Detail

AbstractSOAP

public AbstractSOAP(java.lang.String mtd,
                    java.lang.String uri)
Constructs a SOAP request with the given parameters. The default namespace will be used, along with a open timeout of 25 seconds and a read timeout of 60 seconds.

Parameters:
mtd - The method you're calling.
uri - The complete URI.
Method Detail

setParam

public void setParam(java.lang.String param,
                     java.lang.String paramName,
                     java.lang.String paramType)
Sets a parameter with the name and type specified. Important: unicode characters are not accepted because the default header uses UTF-8.


setParam

public void setParam(java.lang.String param)
Sets a string parameter in the order of the method call, identifying it as

Parameters:
param -

setParam

public void setParam(java.lang.String param,
                     java.lang.String paramName)
Sets a string parameter in the order of the method call, identifying it as .

Parameters:
param -
paramName -

setParam

public void setParam(int param)
Sets a int parameter in the order of the method call, identifying it as

Parameters:
param -

setParam

public void setParam(int param,
                     java.lang.String paramName)
Sets a int parameter in the order of the method call, identifying it as .

Parameters:
param -
paramName -

setParam

public void setParam(double param)
Sets a double parameter in the order of the method call, identifying it as

Parameters:
param -

setParam

public void setParam(double param,
                     java.lang.String paramName)
Sets a double parameter in the order of the method call, identifying it as .

Parameters:
param -
paramName -

setParam

public void setParam(boolean param)
Sets a boolean parameter in the order of the method call, identifying it as

Parameters:
param -

setParam

public void setParam(boolean param,
                     java.lang.String paramName)
Sets a boolean parameter in the order of the method call, identifying it as .

Parameters:
param -
paramName -

setParam

public void setParam(java.lang.String[] param,
                     java.lang.String paramName,
                     java.lang.String paramType)
Sets an array parameter in the order of the method call. The array type will be and the name is . Important: unicode characters are not accepted because the default header uses UTF-8.

Parameters:
param -
paramName -
paramType -

setParam

public void setParam(java.lang.String[] param)
Sets a String array parameter in the order of the method call, identifying it as . Important: unicode characters are not accepted because the default header uses UTF-8.

Parameters:
param -

setParam

public void setParam(java.lang.String[] param,
                     java.lang.String paramName)
Sets a String array parameter in the order of the method call, identifying it as . Important: unicode characters are not accepted because the default header uses UTF-8.

Parameters:
param -
paramName -

setParam

public void setParam(int[] param)
Sets a int array parameter in the order of the method call, identifying it as

Parameters:
param -

setParam

public void setParam(int[] param,
                     java.lang.String paramName)
Sets a int array parameter in the order of the method call, identifying it as .

Parameters:
param -
paramName -

setParam

public void setParam(byte[] param,
                     java.lang.String paramName)
Sets a int array parameter in the order of the method call, identifying it as .

Parameters:
param -
paramName -

setParam

public void setParam(double[] param)
Sets a double array parameter in the order of the method call, identifying it as

Parameters:
param -

setParam

public void setParam(double[] param,
                     java.lang.String paramName)
Sets a double array parameter in the order of the method call, identifying it as .

Parameters:
param -
paramName -

setParam

public void setParam(boolean[] param)
Sets a boolean array parameter in the order of the method call, identifying it as

Parameters:
param -

setParam

public void setParam(boolean[] param,
                     java.lang.String paramName)
Sets a boolean array parameter in the order of the method call, identifying it as .

Parameters:
param -
paramName -

setObjectParam

public void setObjectParam(java.lang.String paramName,
                           java.lang.String[] fieldNames,
                           java.lang.String[] fieldValues)
Sets an object param identifying it as . The object fields names and values must be informed as the String arrays and . Important: unicode characters are not accepted because the default header uses UTF-8.

Parameters:
paramName -
fieldNames -
fieldValues -

execute

public void execute()
             throws totalcross.xml.soap.SOAPException
This method must be called to execute the soap request

Throws:
totalcross.xml.soap.SOAPException

parseAnswer

public abstract void parseAnswer(totalcross.io.Stream receivedStream)
                          throws java.lang.Exception
Parse response.

Parameters:
receivedStream -
Throws:
java.lang.Exception

getAnswer

public abstract java.lang.Object getAnswer()
Returns the answer of the soap request. Important: the values may be escaped; use totalcross.ui.html.EscapeHtml.unescape to convert it back.

Returns:
Object