Soap Class Reference

The Soap class contains static methods used internally to convert Objective-C objects to and from XML formats suitable for SOAP compliance.

Inherits from NSObject*

Tasks

Creating an envelope

Serialization

Deserialization

Calling web services

XML handling

Conversion methods

Utility methods

Class Methods

createEnvelope:forNamespace:forParameters:

Creates the XML request for the SOAP envelope.

+ (NSString*) createEnvelope: (NSString*) method forNamespace: (NSString*) ns forParameters: (NSString*) params

Parameters

method
The name of the SOAP method.
ns
The namespace of the called web service.
params
The XML string of parameters to append to the envelope.

createEnvelope:forNamespace:forParameters:withHeaders:

Creates the XML request for the SOAP envelope with optional SOAP headers.

+ (NSString*) createEnvelope: (NSString*) method forNamespace: (NSString*) ns forParameters: (NSString*) params withHeaders: (NSDictionary*) headers

Parameters

method
The name of the SOAP method.
ns
The namespace of the called web service.
params
The XML string of parameters to append to the envelope.
headers
The SOAP headers to send with the envelope.

createEnvelope:forNamespace:containing:

Creates the XML request for the SOAP envelope.

+ (NSString*) createEnvelope: (NSString*) method forNamespace: (NSString*) ns containing: (NSDictionary*) containing

createEnvelope:forNamespace:containing:withHeaders:

Creates the XML request for the SOAP envelope with optional SOAP headers.

+ (NSString*) createEnvelope: (NSString*) method forNamespace: (NSString*) ns containing: (NSDictionary*) containing withHeaders: (NSDictionary*) headers

Parameters

method
The name of the SOAP method.
ns
The namespace of the called web service.
containing
The NSDictionary* containing name/value pairs to send parameters to the request.
headers
The SOAP headers to send with the envelope.

createEnvelope:forNamespace:withParameters:

Creates the XML request for the SOAP envelope.

+ (NSString*) createEnvelope: (NSString*) method forNamespace: (NSString*) ns withParameters: (NSArray*) params

Parameters

method
The name of the SOAP method.
ns
The namespace of the called web service.
params
The array of SoapParameter objects used to send parameters to the request.

createEnvelope:forNamespace:withParameters:withHeaders:

Creates the XML request for the SOAP envelope with optional SOAP headers.

+ (NSString*) createEnvelope: (NSString*) method forNamespace: (NSString*) ns withParameters: (NSArray*) params withHeaders: (NSDictionary*) headers

Parameters

method
The name of the SOAP method.
ns
The namespace of the called web service.
params
The array of SoapParameter objects used to send parameters to the request.
headers
The SOAP headers to send with the envelope.

createEnvelope:ofAction:forNamespace:containing:

Creates the XML request for the SOAP envelope.

+ (NSString*) createEnvelope: (NSString*) method ofAction: (NSString*) action forNamespace: (NSString*) ns containing: (SoapObject*) containing

Parameters

method
The name of the SOAP method.
action
The name of the action to perform.
ns
The namespace of the called web service.
containing
The object used to send parameters to the request.

createEnvelope:ofAction:forNamespace:containing:withHeaders:

Creates the XML request for the SOAP envelope with optional SOAP headers.

+ (NSString*) createEnvelope: (NSString*) method ofAction: (NSString*) action forNamespace: (NSString*) ns containing: (SoapObject*) containing withHeaders: (NSDictionary*) headers

Parameters

method
The name of the SOAP method.
action
The name of the action to perform.
ns
The namespace of the called web service.
containing
The object used to send parameters to the request.
headers
The SOAP headers to send with the envelope.

serialize:

Serializes an object to a string, XML representation.

+ (NSString*) serialize: (id) object

serialize:withName:

Serializes an object to a string, XML representation with a specific node name.

+ (NSString*) serialize: (id) object withName: (NSString*) nodeName

deserialize:

Deserializes an element to a string value.

+ (id) deserialize: (CXMLNode*) element

deserialize:forObject:

Deserializes a node into an object.

+ (id) deserialize: (CXMLNode*) element forObject: (NSObject*) object

objectFromNode:

Creates and object of string values from the node.

+(id)objectFromNode:(CXMLNode*)node

callService:data:action:delegate:

Calls an HTTP service.

+ (NSMutableData*) callService: (NSString*) service data: (NSString*) data action: (NSString*) action delegate: (SEL) delegate

getNode:withName:

Gets the node from another node by name.

+ (CXMLNode*) getNode: (CXMLNode*) element withName: (NSString*) name

findNodes:xpath:

Finds nodes in a parent with a given XPath query.

+ (NSArray*) findNodes: (CXMLNode*) node xpath: (NSString*) xpath

findNode:xpath:

Finds a single node with the given XPath query.

+ (CXMLNode*) findNode: (CXMLNode*) node xpath: (NSString*) xpath

getNodeValue:withName:

Gets the value of a named node from a parent node.

+ (NSString*) getNodeValue: (CXMLNode*) node withName: (NSString*) name

convert:toType:

Converts a string to a specific type.

+ (id) convert: (NSString*) value toType: (NSString*) toType

dateFromString:

Converts a string to a date.

+ (NSDate*) dateFromString: (NSString*) value

getDateString:

Converts a date to a string.

+ (NSString*) getDateString: (NSDate*) value

dataFromString:

Return NSData from a string.

+(NSData*) dataFromString:(NSString*) value

getBase64String:

Returns a string version of binary data.

+(NSString*)getBase64String:(NSData*) value

isArray:

Determines if an object is an array.

+ (BOOL) isArray: (NSObject*) value

isObject:

Determines if an object is an object with properties.

+ (BOOL) isObject: (NSObject*) value

md5:

Generates an MD5 hash.

+(NSString*)md5:(NSString*)value

generateHash:

Creates a unique hash for the object's contents.

+(NSUInteger)generateHash:(SoapObject*)value