public class SOAP
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
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.
To disable encoding, set this field to true. |
protected HttpStream |
hs
The HttpStream used to retrieve the last response.
|
java.lang.String |
mtd |
java.lang.String |
namespace |
java.lang.String |
namespaceId |
int |
openTimeout
The open timeout for the connection.
|
protected int |
paramIndex |
static java.lang.String |
prefix
The prefix string used when sending requests.
|
int |
readTimeout
The read timeout.
|
protected java.lang.StringBuffer |
sbuf |
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
The write timeout.
|
Constructor and Description |
---|
SOAP(java.lang.String mtd,
java.lang.String uri)
Constructs a SOAP request with the given parameters.
|
Modifier and Type | Method and Description |
---|---|
protected HttpStream.Options |
createOptions()
Creates the options that will be sent to the HttpStream.
|
void |
execute()
This method must be called to execute the soap request
|
java.lang.Object |
getAnswer()
Returns the answer of the soap request.
|
void |
setObjectArrayParam(java.lang.String paramName,
java.lang.String[] fieldNames,
Vector fieldValues) |
void |
setObjectParam(java.lang.String paramName,
java.lang.String[] fieldNames,
java.lang.String[] fieldValues)
Sets an object param identifying it as
paramName . |
void |
setParam(boolean param)
Sets a boolean parameter in the order of the method call, identifying it
as
arg+index |
void |
setParam(boolean[] param)
Sets a boolean array parameter in the order of the method call,
identifying it as
arg+index |
void |
setParam(boolean[] param,
java.lang.String paramName)
Sets a boolean array parameter in the order of the method call,
identifying it as
paramName . |
void |
setParam(boolean param,
java.lang.String paramName)
Sets a boolean parameter in the order of the method call, identifying it
as
paramName . |
void |
setParam(byte[] param,
java.lang.String paramName)
Sets a byte array parameter in the order of the method call, identifying it
as
paramName . |
void |
setParam(double param)
Sets a double parameter in the order of the method call, identifying it as
arg+index |
void |
setParam(double[] param)
Sets a double array parameter in the order of the method call, identifying
it as
arg+index |
void |
setParam(double[] param,
java.lang.String paramName)
Sets a double array parameter in the order of the method call, identifying
it as
paramName . |
void |
setParam(double param,
java.lang.String paramName)
Sets a double parameter in the order of the method call, identifying it as
paramName . |
void |
setParam(int param)
Sets a int parameter in the order of the method call, identifying it as
arg+index |
void |
setParam(int[] param)
Sets a int array parameter in the order of the method call, identifying it
as
arg+index |
void |
setParam(int[] param,
java.lang.String paramName)
Sets a int array parameter in the order of the method call, identifying it
as
paramName . |
void |
setParam(int param,
java.lang.String paramName)
Sets a int parameter in the order of the method call, identifying it as
paramName . |
void |
setParam(java.lang.String param)
Sets a string parameter in the order of the method call, identifying it as
arg+index |
void |
setParam(java.lang.String[] param)
Sets a String array parameter in the order of the method call, identifying
it as
arg+index . |
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
paramName . |
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
paramName . |
void |
setParam(java.lang.String param,
java.lang.String paramName,
java.lang.String paramType)
Sets a parameter with the name and type specified.
|
void |
useProxy(java.lang.String address,
int port,
java.lang.String username,
java.lang.String password)
Set the proxy settings to be used by this SOAP connection.
|
public static boolean debug
HttpStream.debugHeader = true
.
Caution: don't use this on device because it increases a lot the memory usage.public static boolean disableEncoding
protected HttpStream hs
public boolean wasCompressionUsed
public java.lang.String namespace
public java.lang.String namespaceId
public java.lang.String uri
public java.lang.String mtd
public int openTimeout
public int readTimeout
public int writeTimeout
public java.lang.String alternativeReturnTag
protected int paramIndex
public static java.lang.String prefix
public static java.lang.String suffix
protected java.lang.StringBuffer sbuf
public SOAP(java.lang.String mtd, java.lang.String uri)
mtd
- The method you're calling.uri
- The complete URI.public void setParam(java.lang.String param, java.lang.String paramName, java.lang.String paramType)
public void setParam(java.lang.String param)
arg+index
param
- public void setParam(java.lang.String param, java.lang.String paramName)
paramName
.param
- paramName
- public void setParam(int param)
arg+index
param
- public void setParam(int param, java.lang.String paramName)
paramName
.param
- paramName
- public void setParam(double param)
arg+index
param
- public void setParam(double param, java.lang.String paramName)
paramName
.param
- paramName
- public void setParam(boolean param)
arg+index
param
- public void setParam(boolean param, java.lang.String paramName)
paramName
.param
- paramName
- public void setParam(java.lang.String[] param, java.lang.String paramName, java.lang.String paramType)
paramType
and the name is paramName
. Important: unicode
characters are not accepted because the default header uses UTF-8.param
- paramName
- paramType
- public void setParam(java.lang.String[] param)
arg+index
. Important: unicode characters are not accepted because
the default header uses UTF-8.param
- public void setParam(java.lang.String[] param, java.lang.String paramName)
paramName
. Important: unicode characters are not accepted because
the default header uses UTF-8.param
- paramName
- public void setParam(int[] param)
arg+index
param
- public void setParam(int[] param, java.lang.String paramName)
paramName
.param
- paramName
- public void setParam(byte[] param, java.lang.String paramName)
paramName
.param
- paramName
- public void setParam(double[] param)
arg+index
param
- public void setParam(double[] param, java.lang.String paramName)
paramName
.param
- paramName
- public void setParam(boolean[] param)
arg+index
param
- public void setParam(boolean[] param, java.lang.String paramName)
paramName
.param
- paramName
- public void setObjectParam(java.lang.String paramName, java.lang.String[] fieldNames, java.lang.String[] fieldValues)
paramName
. The object fields
names and values must be informed as the String arrays paramName
- fieldNames
- fieldValues
- public void setObjectArrayParam(java.lang.String paramName, java.lang.String[] fieldNames, Vector fieldValues)
public java.lang.Object getAnswer()
protected HttpStream.Options createOptions()
public void useProxy(java.lang.String address, int port, java.lang.String username, java.lang.String password)
address
- the proxy addressport
- the proxy portusername
- the username for basic proxy authorization. Passing a null value disables proxy authorization.password
- the password for basic proxy authorization. Passing a null value disables proxy authorization.public void execute() throws SOAPException
SOAPException