A light Web Service client framework targeting iOS platform.
You have a few options:
If you use this option, make sure:
-ObjC
flag to your "Other Linker flags"./usr/include/libxml2
to your "Header Search Paths"libxml2.dylib
If you use this option, make sure:
libxml2.dylib
libPico.a
After the service proxy is generated from wsdl, service invocation through Pico runtime is extremely easy:
// start progress activity
[self.view makeToastActivity];
// Get shared service client
StockQuoteServiceClient *client = [StockQuoteServiceClient sharedClient];
client.debug = YES; // enable request/response message logging
// Build request object
GetQuote *request = [[[GetQuote alloc] init] autorelease];
request.symbol = _symbolText.text;
// make API call and register callbacks
[client getQuote:request success:^(GetQuoteResponse *responseObject) {
// stop progress activity
[self.view hideToastActivity];
// show result
_resultText.text = responseObject.getQuoteResult;
} failure:^(NSError *error, id<PicoBindable> soapFault) {
// stop progress activity
[self.view hideToastActivity];
if (error) { // http or parsing error
[self.view makeToast:[error localizedDescription] duration:3.0 position:@"center" title:@"Error"];
} else if (soapFault) {
SOAP11Fault *soap11Fault = (SOAP11Fault *)soapFault;
[self.view makeToast:soap11Fault.faultstring duration:3.0 position:@"center" title:@"SOAP Fault"];
}
}];
All samples are in the Examples folder, following samples are included:
XML Schema Data Types | Objective-C Data Types |
---|---|
xsd:base64Binary | NSData |
xsd:boolean | NSNumber with bool value |
xsd:byte | NSNumber |
xsd:date | NSDate |
xsd:dateTime | NSDate |
xsd:decimal | NSNumber with double value |
xsd:double | NSNumber with double value |
xsd:duration | NSString |
xsd:float | NSNumber with float value |
xsd:g | NSDate |
xsd:hexBinary | NSData |
xsd:int | NSNumber with int value |
xsd:integer | NSNumber with long value |
xsd:long | NSNumber with long value |
xsd:NOTATION | NSString |
xsd:Qname | NSString |
xsd:short | NSNumber with short value |
xsd:string | NSString |
xsd:time | NSDate |
xsd:unsignedByte | NSNumber with short value |
xsd:unsignedInt | NSNumber with long value |
xsd:unsignedShort | NSNumber with int value |
(The MIT License)
Copyright (c) 2013 Leansoft Technology 51startup@sina.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.