Genivia Home Documentation
gsoapios.mm File Reference

updated Wed Apr 8 2020 by Robert van Engelen
 
Functions | Variables
gsoapios.mm File Reference
#import "gsoapios.h"
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
Include dependency graph for gsoapios.mm:

Functions

static int soap_ios_copy (struct soap *soap, struct soap_plugin *dst, struct soap_plugin *src)
 Duplicates the plugin context for the soap context. More...
 
static void soap_ios_delete (struct soap *soap, struct soap_plugin *p)
 Destroys the plugin context. More...
 
static int soap_ios_init (struct soap *soap, soap_ios_data *data)
 Initializes the plugin data. More...
 
static SOAP_SOCKET soap_ios_open (struct soap *soap, const char *endpoint, const char *host, int port)
 Extracts states from soap context and saves states for soap connection. More...
 
static int soap_ios_close (struct soap *soap)
 
static int soap_ios_send (struct soap *soap, const char *buf, size_t len)
 Buffers the http/soap request in plugin data. More...
 
static size_t soap_ios_recv (struct soap *soap, char *buf, size_t len)
 Sends soap request, buffers soap response and serialize the response. More...
 
int soap_ios (struct soap *soap, struct soap_plugin *p, void *arg)
 Save the old callbacks and set new callbacks to handle soap client applications on iOS platforms (iPhone and iPad) More...
 
void soap_ios_setcachepolicy (struct soap *soap, unsigned int policy)
 Sets cache policy The constants used to specify interaction with the cached responses are: More...
 
void soap_ios_settimeoutinterval (struct soap *soap, double seconds)
 Sets timeout interval. More...
 

Variables

const char soap_ios_id [13] = SOAP_IOS_ID
 

Function Documentation

int soap_ios ( struct soap *  soap,
struct soap_plugin *  p,
void *  arg 
)

Save the old callbacks and set new callbacks to handle soap client applications on iOS platforms (iPhone and iPad)

Parameters
soapThe soap context
[in]pThe soap plugin data
[in]argThe arguments for soap plugin
Returns
SOAP_OK if registration is successfull; SOAP_EOM otherwise

Usage:

1 struct soap *soap = soap_new();
2 soap_register_plugin(soap, soap_ios);
static int soap_ios_close ( struct soap *  soap)
static
Parameters
soapThe soap context
Returns
0

Note: This open function does not create a real socket for communication. The actual connection establishment happens in the frecv callback

static int soap_ios_copy ( struct soap *  soap,
struct soap_plugin *  dst,
struct soap_plugin *  src 
)
static

Duplicates the plugin context for the soap context.

Parameters
soapThe soap context
[out]dstThe destination plugin data to store to
[in]srcThe sources plugin data to be copied from
Returns
SOAP_OK if registration is successfull; SOAP_ERR otherwise
static void soap_ios_delete ( struct soap *  soap,
struct soap_plugin *  p 
)
static

Destroys the plugin context.

Parameters
soapcontext
[in]pplugin data
static int soap_ios_init ( struct soap *  soap,
soap_ios_data data 
)
static

Initializes the plugin data.

Parameters
soapThe soap context
[out]dataThe plugin data to be initialized
Returns
SOAP_OK if initialization is sucessful; SOAP_ERR otherwise
static SOAP_SOCKET soap_ios_open ( struct soap *  soap,
const char *  endpoint,
const char *  host,
int  port 
)
static

Extracts states from soap context and saves states for soap connection.

Parameters
soapThe soap context
[in]endpointThe Web service's endpoint
[in]hostThe host name
[in]portThe port numer
Returns
1 A valid socket

Note: This open function does not create a real socket for communication. The actual connection establishment happens in the frecv callback

static size_t soap_ios_recv ( struct soap *  soap,
char *  buf,
size_t  len 
)
static

Sends soap request, buffers soap response and serialize the response.

Parameters
soapThe soap context
[out]bufThe buffer for the received data
[in]lenThe number of bytes received
Returns
The number of bytes received

Note: This recv function sends a synchronous soap request through NSURLRequest, receives soap response, serializes response.

static int soap_ios_send ( struct soap *  soap,
const char *  buf,
size_t  len 
)
static

Buffers the http/soap request in plugin data.

Parameters
soapThe soap context
[in]bufThe buffer holding the serialized http/soap request
[in]lenThe buffer size
Returns
The number of bytes buffered

Note: This send function does not send any data to its peer. Rather it buffers the serialied soap request including http header to the plugin data. The sending happens actually in frecv function.

void soap_ios_setcachepolicy ( struct soap *  soap,
unsigned int  policy 
)

Sets cache policy The constants used to specify interaction with the cached responses are:

enum { NSURLRequestUseProtocolCachePolicy = 0, NSURLRequestReloadIgnoringLocalCacheData = 1, NSURLRequestReloadIgnoringCacheData = NSURLRequestReloadIgnoringLocalCacheData, NSURLRequestReturnCacheDataElseLoad = 2, NSURLRequestReturnCacheDataDontLoad = 3, NSURLRequestReloadIgnoringLocalAndRemoteCacheData =4, NSURLRequestReloadRevalidatingCacheData = 5 };

Parameters
soapThe soap context
[in]policyThe policy to be specified for he request
void soap_ios_settimeoutinterval ( struct soap *  soap,
double  seconds 
)

Sets timeout interval.

Parameters
soapThe soap context
[in]secondsThe value for the timeout interval to be specifed (in seconds)
soapThe soap context
[in]secondsThe value for the timeout interval to be specified (in seconds)

Variable Documentation

const char soap_ios_id[13] = SOAP_IOS_ID

plugin identification for plugin registry