SDMConnectivity Public APIs

SDMConnectivity Public APIs

Note: The SAP Mobile Platform APIs and their descriptions are available after the installation of SAP Mobile Platform at the following location within your installation folder: ...\UnwiredPlatform\ClientAPI\apidoc.
-(id)initWithURL:(NSURL *)newURL
+(id)requestWithURL:(NSURL *)newURL
-(void) setUserName:(NSString*)username
-(void) setPassword:(NSString*)username
-(void) setClientDelegate:(id)clientDelegate
-(void) setDidFinishSelector:(SEL)didFinishSelector
-(void) setDidFailSelector:(SEL)didFinishSelector
-(void) setRequestMethod:(NSString*)httpMethod
-(void) startAsynchronous
-(void) startSynchronous
-(void) cancel
-(void) setUploadProgressDelegate
-(void) setDownloadProgressDelegate
-(void) setShowAccurateProgress
-(void)setMaxConcurrentHTTPRequestCount:(const unsigned char)cnt  
-(NSInteger) getMaxConcurrentHTTPRequestCount
-(NSString*) responseString
-(NSData*) responseData
-addRequestHeader:(NSString*)header value:(NSString*)value
-appendPostData:(NSData*)postData
-(void) buildPostBody
-(void) setClientCertificateIdentity:(SecIdentityRef)anIdentity
-(void) setEtag:(NSString*)etag withMatchType:(EtagMatchType)matchType;

Technical Details

The SDMConnectivity library wraps internally the socket based CFNetwork APIs and uses NSOperationQueue to collect and fire asynchronous requests. The number of maximum concurrent HTTP requests is limited to MAX_CONCURRENT_THREADS (Default: 5).

The SDMHttpRequestDelegate protocol defines default delegate methods for request status related housekeeping. Client classes can implement this protocol to hook in for requestStarted / requestFinished / requestFailed default delegates.

In cases when clients prefer to use custom selectors for request notifications, they do not need to adapt the SDMHttpRequestDelegate protocol, but rather register themselves as delegates and set their own selectors as didStartSelector / didFinishSelector / didFailSelector.

The SDMProgressDelegate defines default delegate methods for upload and download progress notification. The protocol has to be adapted by client classes to hook in for didReceiveBytes / didSendBytes / incrementDownloadSizeBy / incrementUploadSizeBy delegates. You can choose to register a download or upload progress delegate using SDMHttpRequest instance methods -setUploadProgressDelegate and -setDownloadProgressDelegate.

The factory method instantiates SUPRequest by default. SUPRequest must be used to communicate through Online Data Proxy channel; it is part of the SAP Mobile Platform ODP libraries, which have to be linked to the project. The SDMConnectivity library provides the means to transparently choose between SUPRequest using connections through the Online Data Proxy (ODP) Channel or SDMHttpRequest which leverages the usage of classical HTTP/HTTPS connections.

Protocols:
SDMHttpRequestDelegate

+ requestStarted:
+ requestFinished:
+ requestFailed:
+ requestRedirected:
+ request:didRecieveData:
+ authenticationNeededForRequest:
+ proxyAuthenticationNeededForRequest:


SDMProgressDelegate

+ setProgress:
+ request:didReceiveBytes:
+ request:didSendBytes:
+ request:incrementDownloadSizeBy:
+ request:incrementUploadSizeBy: