SoapRequest Class Reference

The SoapRequest class is responsible for creating, managing and processing requests made to web services. It creates the connection, and once results are retrieved, deserializes the results into objects. In the event that an error occurs, it will send an NSError* object to the handler's onerror method. In the event of a SOAP fault, it will send a SoapFault object to the handler's onfault method. Otherwise, the request is successful and the resulting object is sent to the handler's onsuccess method.

Properties

url

The URL of the current SOAP request.

@property (retain, nonatomic) NSURL* url

soapAction

The name of the SOAP action to be performed

@property (retain, nonatomic) NSString* soapAction;

username

Sets or gets the username used to authenticate the request.

@property (retain, nonatomic) NSString* username

password

Sets or gets the password used to authenticate the request.

@property (retain, nonatomic) NSString* password

postData

The XML data posted to the request.

@property (retain, nonatomic) id postData

receivedData

The stored data as it is received by the request.

@property (retain, nonatomic) NSMutableData* receivedData

handler

The object that will handle the request.

@property (retain, nonatomic) SoapHandler* handler

deserializeTo

The name of or the allocation instance of the object into which the results are deserialized.

@property (retain, nonatomic) id deserializeTo

action

The selector to be performed once results are received.

@property SEL action

logging

Turns logging of the request on or off.

@property BOOL logging

defaultHandler

The default handler to use if another is not specified or if that handler's methods are not implemented.

@property (retain, nonatomic) id<SoapDelegate> defaultHandler

Instance Methods

cancel

Cancels the current request.

- (BOOL)cancel

send

Sends the request.

- (void)send

handleError:

Handles the error if encountered once the response is received.

- (void)handleError:(NSError*)error

handleFault:

Handles a SOAP fault if one is received from the response.

- (void)handleFault:(SoapFault*)fault

Class Methods

create:urlString:soapAction:postData:deserializeTo

Creates a new SoapRequest and returns it.

+ (SoapRequest*) create: (SoapHandler*) handler urlString: (NSString*) urlString soapAction: (NSString*) soapAction postData: (NSString*) postData deserializeTo: (id) deserializeTo
handler
The object that will handle the response of the request once processed.
urlString
The URL of the request.
soapAction
The name of the SOAP action to run.
postData
The SOAP data to post to the web service.
deserializeTo
The name of or instantiation of the object into which the response is deserialized.

create:sction:urlString:soapAction:postData:deserializeTo:

Creates a new SoapRequest and returns it.

+ (SoapRequest*) create: (SoapHandler*) handler action: (SEL) action urlString: (NSString*) urlString soapAction: (NSString*) soapAction postData: (NSString*) postData deserializeTo: (id) deserializeTo;
handler
The object that will handle the response of the request once processed.
action
The selector of a method into which the result is returned.
urlString
The URL of the request.
soapAction
The name of the SOAP action to run.
postData
The SOAP data to post to the web service.
deserializeTo
The name of or instantiation of the object into which the response is deserialized.

create:action:service:soapAction:postData:deserializeTo:

Creates a new SoapRequest and returns it.

+ (SoapRequest*) create: (SoapHandler*) handler action: (SEL) action service: (SoapService*) service soapAction: (NSString*) soapAction postData: (NSString*) postData deserializeTo: (id) deserializeTo;

Parameters

handler
The object that will handle the response of the request once processed.
action
The selector of a method into which the result is returned.
service
The SoapService that contains connection information for the request.
soapAction
The name of the SOAP action to run.
postData
The SOAP data to post to the web service.
deserializeTo
The name of or instantiation of the object into which the response is deserialized.