org.ksoap2
Class SoapEnvelope

java.lang.Object
  extended by org.ksoap2.SoapEnvelope
Direct Known Subclasses:
SoapSerializationEnvelope

public class SoapEnvelope
extends java.lang.Object

A SOAP envelope, holding head and body objects. While this basic envelope supports literal encoding as content format via KDom, The SoapSerializationEnvelope provides support for the SOAP Serialization format specification and simple object serialization.


Field Summary
 java.lang.Object bodyIn
          The body object received with this envelope.
 java.lang.Object bodyOut
          The body object to be sent with this envelope.
 java.lang.String enc
          Encoding namespace, set by the constructor
static java.lang.String ENC
          Namespace constant: http://schemas.xmlsoap.org/soap/encoding/
static java.lang.String ENC2001
           
 java.lang.String encodingStyle
           
 java.lang.String env
          Envelope namespace, set by the constructor
static java.lang.String ENV
          Namespace constant: http://schemas.xmlsoap.org/soap/envelope/
static java.lang.String ENV2001
           
 org.kxml2.kdom.Element[] headerIn
          Incoming header elements
 org.kxml2.kdom.Element[] headerOut
          Outgoing header elements
static int VER10
          SOAP Version 1.0 constant
static int VER11
          SOAP Version 1.1 constant
static int VER12
          SOAP Version 1.2 constant
 int version
          The SOAP version, set by the constructor
 java.lang.String xsd
          Xml Schema data namespace, set by the constructor
static java.lang.String XSD
          Namespace constant: http://www.w3.org/2001/XMLSchema
static java.lang.String XSD1999
          Namespace constant: http://www.w3.org/1999/XMLSchema
 java.lang.String xsi
          Xml Schema instance namespace, set by the constructor
static java.lang.String XSI
          Namespace constant: http://www.w3.org/2001/XMLSchema
static java.lang.String XSI1999
          Namespace constant: http://www.w3.org/1999/XMLSchema
 
Constructor Summary
SoapEnvelope(int version)
          Initializes a SOAP Envelope.
 
Method Summary
 void parse(org.xmlpull.v1.XmlPullParser parser)
          Parses the SOAP envelope from the given parser
 void parseBody(org.xmlpull.v1.XmlPullParser parser)
           
 void parseHeader(org.xmlpull.v1.XmlPullParser parser)
           
 void setOutputSoapObject(java.lang.Object soapObject)
          Assigns the object to the envelope as the outbound message for the soap call.
static boolean stringToBoolean(java.lang.String booleanAsString)
          Returns true for the string values "1" and "true", ignoring upper/lower case and whitespace, false otherwise.
 void write(org.xmlpull.v1.XmlSerializer writer)
          Writes the complete envelope including header and body elements to the given XML writer.
 void writeBody(org.xmlpull.v1.XmlSerializer writer)
          Writes the SOAP body stored in the object variable bodyIn, Overwrite this method for customized writing of the soap message body.
 void writeHeader(org.xmlpull.v1.XmlSerializer writer)
          Writes the header elements contained in headerOut
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VER10

public static final int VER10
SOAP Version 1.0 constant

See Also:
Constant Field Values

VER11

public static final int VER11
SOAP Version 1.1 constant

See Also:
Constant Field Values

VER12

public static final int VER12
SOAP Version 1.2 constant

See Also:
Constant Field Values

ENV2001

public static final java.lang.String ENV2001
See Also:
Constant Field Values

ENC2001

public static final java.lang.String ENC2001
See Also:
Constant Field Values

ENV

public static final java.lang.String ENV
Namespace constant: http://schemas.xmlsoap.org/soap/envelope/

See Also:
Constant Field Values

ENC

public static final java.lang.String ENC
Namespace constant: http://schemas.xmlsoap.org/soap/encoding/

See Also:
Constant Field Values

XSD

public static final java.lang.String XSD
Namespace constant: http://www.w3.org/2001/XMLSchema

See Also:
Constant Field Values

XSI

public static final java.lang.String XSI
Namespace constant: http://www.w3.org/2001/XMLSchema

See Also:
Constant Field Values

XSD1999

public static final java.lang.String XSD1999
Namespace constant: http://www.w3.org/1999/XMLSchema

See Also:
Constant Field Values

XSI1999

public static final java.lang.String XSI1999
Namespace constant: http://www.w3.org/1999/XMLSchema

See Also:
Constant Field Values

bodyIn

public java.lang.Object bodyIn
The body object received with this envelope. Will be an KDom Node for literal encoding. For SOAP Serialization, please refer to SoapSerializationEnvelope.


bodyOut

public java.lang.Object bodyOut
The body object to be sent with this envelope. Must be a KDom Node modelling the remote call including all parameters for literal encoding. For SOAP Serialization, please refer to SoapSerializationEnvelope


headerIn

public org.kxml2.kdom.Element[] headerIn
Incoming header elements


headerOut

public org.kxml2.kdom.Element[] headerOut
Outgoing header elements


encodingStyle

public java.lang.String encodingStyle

version

public int version
The SOAP version, set by the constructor


env

public java.lang.String env
Envelope namespace, set by the constructor


enc

public java.lang.String enc
Encoding namespace, set by the constructor


xsi

public java.lang.String xsi
Xml Schema instance namespace, set by the constructor


xsd

public java.lang.String xsd
Xml Schema data namespace, set by the constructor

Constructor Detail

SoapEnvelope

public SoapEnvelope(int version)
Initializes a SOAP Envelope. The version parameter must be set to one of VER10, VER11 or VER12

Method Detail

stringToBoolean

public static boolean stringToBoolean(java.lang.String booleanAsString)
Returns true for the string values "1" and "true", ignoring upper/lower case and whitespace, false otherwise.


parse

public void parse(org.xmlpull.v1.XmlPullParser parser)
           throws java.io.IOException,
                  org.xmlpull.v1.XmlPullParserException
Parses the SOAP envelope from the given parser

Throws:
java.io.IOException
org.xmlpull.v1.XmlPullParserException

parseHeader

public void parseHeader(org.xmlpull.v1.XmlPullParser parser)
                 throws java.io.IOException,
                        org.xmlpull.v1.XmlPullParserException
Throws:
java.io.IOException
org.xmlpull.v1.XmlPullParserException

parseBody

public void parseBody(org.xmlpull.v1.XmlPullParser parser)
               throws java.io.IOException,
                      org.xmlpull.v1.XmlPullParserException
Throws:
java.io.IOException
org.xmlpull.v1.XmlPullParserException

write

public void write(org.xmlpull.v1.XmlSerializer writer)
           throws java.io.IOException
Writes the complete envelope including header and body elements to the given XML writer.

Throws:
java.io.IOException

writeHeader

public void writeHeader(org.xmlpull.v1.XmlSerializer writer)
                 throws java.io.IOException
Writes the header elements contained in headerOut

Throws:
java.io.IOException

writeBody

public void writeBody(org.xmlpull.v1.XmlSerializer writer)
               throws java.io.IOException
Writes the SOAP body stored in the object variable bodyIn, Overwrite this method for customized writing of the soap message body.

Throws:
java.io.IOException

setOutputSoapObject

public void setOutputSoapObject(java.lang.Object soapObject)
Assigns the object to the envelope as the outbound message for the soap call.

Parameters:
soapObject - the object to send in the soap call.