org.ksoap2
Class SoapEnvelope

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

public class SoapEnvelope
extends 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
 Object bodyIn
          The body object received with this envelope.
 Object bodyOut
          The body object to be sent with this envelope.
 String enc
          Encoding namespace, set by the constructor
static String ENC
          Namespace constant: http://schemas.xmlsoap.org/soap/encoding/
static String ENC2001
           
 String encodingStyle
           
 String env
          Envelope namespace, set by the constructor
static String ENV
          Namespace constant: http://schemas.xmlsoap.org/soap/envelope/
static 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
 String xsd
          Xml Schema data namespace, set by the constructor
static String XSD
          Namespace constant: http://www.w3.org/2001/XMLSchema
static String XSD1999
          Namespace constant: http://www.w3.org/1999/XMLSchema
 String xsi
          Xml Schema instance namespace, set by the constructor
static String XSI
          Namespace constant: http://www.w3.org/2001/XMLSchema
static 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(Object soapObject)
          Assigns the object to the envelope as the outbound message for the soap call.
static boolean stringToBoolean(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
clone, equals, finalize, 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 String ENV2001
See Also:
Constant Field Values

ENC2001

public static final String ENC2001
See Also:
Constant Field Values

ENV

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

See Also:
Constant Field Values

ENC

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

See Also:
Constant Field Values

XSD

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

See Also:
Constant Field Values

XSI

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

See Also:
Constant Field Values

XSD1999

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

See Also:
Constant Field Values

XSI1999

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

See Also:
Constant Field Values

bodyIn

public 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 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 String encodingStyle

version

public int version
The SOAP version, set by the constructor


env

public String env
Envelope namespace, set by the constructor


enc

public String enc
Encoding namespace, set by the constructor


xsi

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


xsd

public 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(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 IOException,
                  org.xmlpull.v1.XmlPullParserException
Parses the SOAP envelope from the given parser

Throws:
IOException
org.xmlpull.v1.XmlPullParserException

parseHeader

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

parseBody

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

write

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

Throws:
IOException

writeHeader

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

Throws:
IOException

writeBody

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

Throws:
IOException

setOutputSoapObject

public void setOutputSoapObject(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.


Copyright © 2002-2011. All Rights Reserved.