org.ksoap2.serialization
Class SoapSerializationEnvelope

java.lang.Object
  extended by org.ksoap2.SoapEnvelope
      extended by org.ksoap2.serialization.SoapSerializationEnvelope

public class SoapSerializationEnvelope
extends SoapEnvelope

Author:
Stefan Haustein This class extends the SoapEnvelope with Soap Serialization functionality.

Field Summary
 boolean dotNet
          Set this variable to true for compatibility with what seems to be the default encoding for .Net-Services.
 boolean implicitTypes
           
 java.util.Hashtable properties
           
 
Fields inherited from class org.ksoap2.SoapEnvelope
bodyIn, bodyOut, enc, ENC, ENC2001, encodingStyle, env, ENV, ENV2001, headerIn, headerOut, VER10, VER11, VER12, version, xsd, XSD, XSD1999, xsi, XSI, XSI1999
 
Constructor Summary
SoapSerializationEnvelope(int version)
           
 
Method Summary
 void addMapping(java.lang.String namespace, java.lang.String name, java.lang.Class clazz)
          Defines a direct mapping from a namespace and name to a java class (and vice versa)
 void addMapping(java.lang.String namespace, java.lang.String name, java.lang.Class clazz, Marshal marshal)
          Defines a direct mapping from a namespace and name to a java class (and vice versa), using the given marshal mechanism
 void addTemplate(SoapObject so)
          Adds a SoapObject to the class map.
 java.lang.Object[] getInfo(java.lang.Object type, java.lang.Object instance)
          Returns a string array containing the namespace, name, id and Marshal object for the given java object.
 java.lang.Object getResponse()
          Response from the soap call.
 java.lang.Object getResult()
          Deprecated. Please use the getResponse going forward
 void parseBody(org.xmlpull.v1.XmlPullParser parser)
           
 java.lang.Object read(org.xmlpull.v1.XmlPullParser parser, java.lang.Object owner, int index, java.lang.String namespace, java.lang.String name, PropertyInfo expected)
          Builds an object from the XML stream.
 java.lang.Object readInstance(org.xmlpull.v1.XmlPullParser parser, java.lang.String namespace, java.lang.String name, PropertyInfo expected)
          Returns a new object read from the given parser.
 void writeBody(org.xmlpull.v1.XmlSerializer writer)
          Serializes the request object to the given XmlSerliazer object
 void writeObjectBody(org.xmlpull.v1.XmlSerializer writer, KvmSerializable obj)
          Writes the body of an KvmSerializable object.
 
Methods inherited from class org.ksoap2.SoapEnvelope
parse, parseHeader, setOutputSoapObject, stringToBoolean, write, writeHeader
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

properties

public java.util.Hashtable properties

implicitTypes

public boolean implicitTypes

dotNet

public boolean dotNet
Set this variable to true for compatibility with what seems to be the default encoding for .Net-Services. This feature is an extremely ugly hack. A much better option is to change the configuration of the .Net-Server to standard Soap Serialization!

Constructor Detail

SoapSerializationEnvelope

public SoapSerializationEnvelope(int version)
Method Detail

parseBody

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

read

public java.lang.Object read(org.xmlpull.v1.XmlPullParser parser,
                             java.lang.Object owner,
                             int index,
                             java.lang.String namespace,
                             java.lang.String name,
                             PropertyInfo expected)
                      throws java.io.IOException,
                             org.xmlpull.v1.XmlPullParserException
Builds an object from the XML stream. This method is public for usage in conjuction with Marshal subclasses. Precondition: On the start tag of the object or property, so href can be read.

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

readInstance

public java.lang.Object readInstance(org.xmlpull.v1.XmlPullParser parser,
                                     java.lang.String namespace,
                                     java.lang.String name,
                                     PropertyInfo expected)
                              throws java.io.IOException,
                                     org.xmlpull.v1.XmlPullParserException
Returns a new object read from the given parser. If no mapping is found, null is returned. This method is used by the SoapParser in order to convert the XML code to Java objects.

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

getInfo

public java.lang.Object[] getInfo(java.lang.Object type,
                                  java.lang.Object instance)
Returns a string array containing the namespace, name, id and Marshal object for the given java object. This method is used by the SoapWriter in order to map Java objects to the corresponding SOAP section five XML code.


addMapping

public void addMapping(java.lang.String namespace,
                       java.lang.String name,
                       java.lang.Class clazz,
                       Marshal marshal)
Defines a direct mapping from a namespace and name to a java class (and vice versa), using the given marshal mechanism


addMapping

public void addMapping(java.lang.String namespace,
                       java.lang.String name,
                       java.lang.Class clazz)
Defines a direct mapping from a namespace and name to a java class (and vice versa)


addTemplate

public void addTemplate(SoapObject so)
Adds a SoapObject to the class map. During parsing, objects of the given type (namespace/name) will be mapped to corresponding copies of the given SoapObject, maintaining the structure of the template.


getResponse

public java.lang.Object getResponse()
                             throws SoapFault
Response from the soap call. Pulls the object from the wrapper object and returns it.

Returns:
response from the soap call.
Throws:
SoapFault
Since:
2.0.3

getResult

public java.lang.Object getResult()
Deprecated. Please use the getResponse going forward

See Also:
getResponse()

writeBody

public void writeBody(org.xmlpull.v1.XmlSerializer writer)
               throws java.io.IOException
Serializes the request object to the given XmlSerliazer object

Overrides:
writeBody in class SoapEnvelope
Parameters:
writer - XmlSerializer object to write the body into.
Throws:
java.io.IOException

writeObjectBody

public void writeObjectBody(org.xmlpull.v1.XmlSerializer writer,
                            KvmSerializable obj)
                     throws java.io.IOException
Writes the body of an KvmSerializable object. This method is public for access from Marshal subclasses.

Throws:
java.io.IOException