Skip to content

Commit

Permalink
fix #74, enhancement #75
Browse files Browse the repository at this point in the history
  • Loading branch information
priore committed Oct 1, 2015
1 parent 6d75722 commit ba3c984
Show file tree
Hide file tree
Showing 15 changed files with 96 additions and 70 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.24, Oct 1, 2015
- added new method that return a formatted dictionary for a sub-child with attributes.
- added new property to define attributes for the soap action tag.
- replaced the statement "retain" of the properties in the statement "strong".
- fixes during retrieval of the class name when you pass a user-object.

1.23.0, Sep 29, 2015
- supports attributes for child tag.
- fixes for soap message with inside another XML base format.
Expand All @@ -8,7 +14,6 @@
- fixes for the default tag names for an array parameter.
- fixes for duplicate symbols when a project already use XPathQuery.
- fixes when a WSDL definition not contain location attribute or soapAction attribute.
- bitcode enabled for iOS9.

1.22.0, Sep 23, 2015
- added support for text password on WS-Security.
Expand Down
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,24 +255,23 @@ settings for Social [**OAuth2.0**](http://www.wikipedia.org/wiki/OAuth) token :

```

[**Attributes**](http://www.w3schools.com/xml/xml_attributes.asp) :
Params with [**Attributes**](http://www.w3schools.com/xml/xml_attributes.asp) :

``` objective-c
// chapter attributes
NSDictionary *attrChapter = @{@"versesOrder": @"asc"};
NSDictionary *chapter = @{@"value": @"1", @"attributes": attrChapter};
// book
NSMutableDictionary *book = [NSMutableDictionary dictionaryWithObject:@"Genesis" forKey:@"name"];
// chapter
NSDictionary *attr = @{@"order": @"asc"};
NSDictionary *child = [soap dictionaryForKey:@"chapter" value:@"1" attributes:attr];
[book addEntriesFromDictionary:child]; // add chapter to book
// book attributes
NSDictionary *attrBook = @{@"rack": @"2"};
NSDictionary *book = @{@"name": @"Genesis", @"chapter": chapter};
[soap setValue:book forKey:@"Book" attributes:attrBook];
[soap setValue:book forKey:@"Book" attributes:@{@"rack": @"2"}];
```
creates an XML message as below:
it builds a request like this:
``` xml
<Book rack="2">
<name>Genesis</name>
<chapter versesOrder="asc">1</chapter>
<name>Genesis</name>
<chapter order="asc">1</chapter>
</Book>
```

Expand Down
2 changes: 1 addition & 1 deletion SOAPEngine.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'SOAPEngine'
s.version = '1.23'
s.version = '1.24'
s.summary = 'This generic SOAP client allows you to access web services using a your iOS and Mac OS X app.'
s.license = { :type => 'Shareware', :file => 'LICENSE.txt' }
s.authors = { 'Danilo Priore' => '[email protected]' }
Expand Down
59 changes: 35 additions & 24 deletions SOAPEngine64.framework/Headers/SOAPEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
//
// email support: [email protected]
//
// Version : 1.23
// Version : 1.24
// Changelog : https://github.com/priore/SOAPEngine/blob/master/CHANGELOG.txt
// Updates : https://github.com/priore/SOAPEngine
//
#define SOAPEngineFrameworkVersion @"1.23" DEPRECATED_ATTRIBUTE
#define SOAPEngineFrameworkVersion @"1.24" DEPRECATED_ATTRIBUTE

#import <Foundation/Foundation.h>

Expand Down Expand Up @@ -87,52 +87,57 @@ typedef enum
@interface SOAPEngine : NSObject

// return the current request URL
@property (nonatomic, retain, readonly) NSURL *requestURL;
@property (nonatomic, strong, readonly) NSURL *requestURL;

// return the current SOAP Action
@property (nonatomic, retain, readonly) NSString *soapAction;
@property (nonatomic, strong, readonly) NSString *soapAction;

// return the current method name
@property (nonatomic, retain, readonly) NSString *methodName;
@property (nonatomic, strong, readonly) NSString *methodName;

// return the current response
@property (nonatomic, retain, readonly) NSURLResponse *response;
@property (nonatomic, strong, readonly) NSURLResponse *response;

// adds the quotes in the SOAPAction header
// eg. SOAPAction = http://temp.org become SOAPAction = "http://temp.org".
@property (nonatomic, assign) BOOL actionQuotes;

// add last path slash for action namespace
// eg. xmlns="http://temp.org" become xmlns="http://temp.org/"
@property (nonatomic, assign) BOOL actionNamespaceSlash;

// add attributes on SOAP Action TAG
// eg. <soapAction attr="value">...</soapAction>
@property (nonatomic, strong) NSDictionary *actionAttributes;

// return the last status code of connection
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
@property (nonatomic, assign) NSInteger statusCode;

//sets a custom name for the user-agent (default is "SOAPEngine").
@property (nonatomic, retain) NSString *userAgent;
@property (nonatomic, strong) NSString *userAgent;

// sets a custom date format for dates (default yyyy-mm-dd)
// http://unicode.org/reports/tr35/tr35-6.html#Date_Format_Patterns
@property (nonatomic, retain) NSString *dateFormat;
@property (nonatomic, strong) NSString *dateFormat;

// sets to indicate that the nil values ​​are replaced with xsi:nil="true"
@property (nonatomic, assign) BOOL replaceNillable;

// sets the default tag name, default is "input", when using setValue without key value or for array items
@property (nonatomic, retain) NSString *defaultTagName;
@property (nonatomic, strong) NSString *defaultTagName;

// sets the prefix of the user object you want to replace
@property (nonatomic, retain) NSString *prefixObjectName;
@property (nonatomic, strong) NSString *prefixObjectName;

// sets the value of replacing for the prefix of the user object
@property (nonatomic, retain) NSString *replacePrefixObjectName;
@property (nonatomic, strong) NSString *replacePrefixObjectName;

// sets the type of permission you want to use (none, wss, basic or custom).
@property (nonatomic, assign) SOAPAuthorization authorizationMethod;

// sets a custom content for the custom authorization method (xml format).
@property (nonatomic, retain) NSString *header;
@property (nonatomic, strong) NSString *header;

// enables retrieval of the contents of the SOAP header in the server response.
@property (nonatomic, assign) BOOL responseHeader;
Expand All @@ -148,22 +153,22 @@ typedef enum

// sets username and password for selected authorization method
// or for server authorization or for client certifcate password.
@property (nonatomic, retain) NSString *username;
@property (nonatomic, retain) NSString *password;
@property (nonatomic, retain) NSString *email; // for PAYPAL auth
@property (nonatomic, retain) NSString *signature; // for PAYPAL auth
@property (nonatomic, strong) NSString *username;
@property (nonatomic, strong) NSString *password;
@property (nonatomic, strong) NSString *email; // for PAYPAL auth
@property (nonatomic, strong) NSString *signature; // for PAYPAL auth
// when calling PayPal APIs, you must authenticate each request using a set of API credentials
// PayPal associates a set of API credentials with a specific PayPal account
// you can generate credentials from this https://developer.paypal.com/docs/classic/api/apiCredentials/

// extended values for social logins
@property (nonatomic, retain) NSString *apiKey;
@property (nonatomic, retain) NSString *socialName;
@property (nonatomic, retain) NSString *token;
@property (nonatomic, strong) NSString *apiKey;
@property (nonatomic, strong) NSString *socialName;
@property (nonatomic, strong) NSString *token;

// sets the custom attributes for Envelope tag, eg.
// for extra namespace definitions (xmlns:tmp="http://temp.org").
@property (nonatomic, retain) NSString *envelope;
// for extra namespace definitions eg. xmlns:tmp="http://temp.org".
@property (nonatomic, strong) NSString *envelope;

// sets the SOAP version you want to use (v.1.1 or v.1.2).
@property (nonatomic, assign) SOAPVersion version;
Expand All @@ -175,8 +180,8 @@ typedef enum
// that require authorization using a client certificate (p12)
// to convert a PAYPAL certificate to a p12 use the command shown below :
// openssl pkcs12 -export -in cert_key_pem.txt -inkey cert_key_pem.txt -out paypal_cert.p12
@property (nonatomic, retain) NSString *clientCerficateName;
@property (nonatomic, retain) NSString *clientCertificatePassword;
@property (nonatomic, strong) NSString *clientCerficateName;
@property (nonatomic, strong) NSString *clientCertificatePassword;

// enables the conversion of special characters in a compatible html format (eg &amp;)
@property (nonatomic, assign) BOOL escapingHTML;
Expand Down Expand Up @@ -229,6 +234,11 @@ typedef enum
- (void)setImage:(UIImage*)image forKey:(NSString*)key attributes:(NSDictionary*)attributes __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_4_3);
#endif

// return a formatted dictionary for a sub-child with attributes
// eg. ["key": ["value": key-value, "attributes": ["attr": attr-value]]]
// this generates an XML like this: <key attr="attr-value">key-value</key>
- (NSDictionary*)dictionaryForKey:(NSString*)key value:(id)value attributes:(NSDictionary*)attributes;

// clear all parameters
- (void)clearValues;

Expand Down Expand Up @@ -314,7 +324,8 @@ completeWithDictionary:(SOAPEngineCompleteBlockWithDictionary)complete
receivedDataSize:(SOAPEngineReceiveDataSizeBlock)receive
sendedDataSize:(SOAPEngineSendDataSizeBlock)sended;

// request with wsdl
// request with WSDL
// note: better use requestURL, read this https://github.com/priore/SOAPEngine#optimizations
- (void)requestWSDL:(id)wsdlURL operation:(NSString*)operation;

- (void)requestWSDL:(id)wsdlURL
Expand Down
Binary file modified SOAPEngine64.framework/Info.plist
Binary file not shown.
Binary file modified SOAPEngine64.framework/SOAPEngine64
Binary file not shown.
Binary file modified SOAPEngine64.framework/_CodeSignature/CodeDirectory
Binary file not shown.
6 changes: 3 additions & 3 deletions SOAPEngine64.framework/_CodeSignature/CodeResources
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<dict>
<key>Headers/SOAPEngine.h</key>
<data>
aiNoB3svOLM6jOP1koZHNo1+bwg=
lU1czB8O2OpX+dYfHQ6HUDVO290=
</data>
<key>Info.plist</key>
<data>
zU7m5gJIFD9yFh8hZkbpL3eRi9c=
Jmwf4jTaToB8rDQIOJDLNOrCjgw=
</data>
<key>Modules/module.modulemap</key>
<data>
Expand All @@ -21,7 +21,7 @@
<dict>
<key>Headers/SOAPEngine.h</key>
<data>
aiNoB3svOLM6jOP1koZHNo1+bwg=
lU1czB8O2OpX+dYfHQ6HUDVO290=
</data>
<key>Modules/module.modulemap</key>
<data>
Expand Down
Binary file modified SOAPEngine64.framework/_CodeSignature/CodeSignature
Binary file not shown.
59 changes: 35 additions & 24 deletions SOAPEngineOSX.framework/Versions/A/Headers/SOAPEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
//
// email support: [email protected]
//
// Version : 1.23
// Version : 1.24
// Changelog : https://github.com/priore/SOAPEngine/blob/master/CHANGELOG.txt
// Updates : https://github.com/priore/SOAPEngine
//
#define SOAPEngineFrameworkVersion @"1.23" DEPRECATED_ATTRIBUTE
#define SOAPEngineFrameworkVersion @"1.24" DEPRECATED_ATTRIBUTE

#import <Foundation/Foundation.h>

Expand Down Expand Up @@ -87,52 +87,57 @@ typedef enum
@interface SOAPEngine : NSObject

// return the current request URL
@property (nonatomic, retain, readonly) NSURL *requestURL;
@property (nonatomic, strong, readonly) NSURL *requestURL;

// return the current SOAP Action
@property (nonatomic, retain, readonly) NSString *soapAction;
@property (nonatomic, strong, readonly) NSString *soapAction;

// return the current method name
@property (nonatomic, retain, readonly) NSString *methodName;
@property (nonatomic, strong, readonly) NSString *methodName;

// return the current response
@property (nonatomic, retain, readonly) NSURLResponse *response;
@property (nonatomic, strong, readonly) NSURLResponse *response;

// adds the quotes in the SOAPAction header
// eg. SOAPAction = http://temp.org become SOAPAction = "http://temp.org".
@property (nonatomic, assign) BOOL actionQuotes;

// add last path slash for action namespace
// eg. xmlns="http://temp.org" become xmlns="http://temp.org/"
@property (nonatomic, assign) BOOL actionNamespaceSlash;

// add attributes on SOAP Action TAG
// eg. <soapAction attr="value">...</soapAction>
@property (nonatomic, strong) NSDictionary *actionAttributes;

// return the last status code of connection
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
@property (nonatomic, assign) NSInteger statusCode;

//sets a custom name for the user-agent (default is "SOAPEngine").
@property (nonatomic, retain) NSString *userAgent;
@property (nonatomic, strong) NSString *userAgent;

// sets a custom date format for dates (default yyyy-mm-dd)
// http://unicode.org/reports/tr35/tr35-6.html#Date_Format_Patterns
@property (nonatomic, retain) NSString *dateFormat;
@property (nonatomic, strong) NSString *dateFormat;

// sets to indicate that the nil values ​​are replaced with xsi:nil="true"
@property (nonatomic, assign) BOOL replaceNillable;

// sets the default tag name, default is "input", when using setValue without key value or for array items
@property (nonatomic, retain) NSString *defaultTagName;
@property (nonatomic, strong) NSString *defaultTagName;

// sets the prefix of the user object you want to replace
@property (nonatomic, retain) NSString *prefixObjectName;
@property (nonatomic, strong) NSString *prefixObjectName;

// sets the value of replacing for the prefix of the user object
@property (nonatomic, retain) NSString *replacePrefixObjectName;
@property (nonatomic, strong) NSString *replacePrefixObjectName;

// sets the type of permission you want to use (none, wss, basic or custom).
@property (nonatomic, assign) SOAPAuthorization authorizationMethod;

// sets a custom content for the custom authorization method (xml format).
@property (nonatomic, retain) NSString *header;
@property (nonatomic, strong) NSString *header;

// enables retrieval of the contents of the SOAP header in the server response.
@property (nonatomic, assign) BOOL responseHeader;
Expand All @@ -148,22 +153,22 @@ typedef enum

// sets username and password for selected authorization method
// or for server authorization or for client certifcate password.
@property (nonatomic, retain) NSString *username;
@property (nonatomic, retain) NSString *password;
@property (nonatomic, retain) NSString *email; // for PAYPAL auth
@property (nonatomic, retain) NSString *signature; // for PAYPAL auth
@property (nonatomic, strong) NSString *username;
@property (nonatomic, strong) NSString *password;
@property (nonatomic, strong) NSString *email; // for PAYPAL auth
@property (nonatomic, strong) NSString *signature; // for PAYPAL auth
// when calling PayPal APIs, you must authenticate each request using a set of API credentials
// PayPal associates a set of API credentials with a specific PayPal account
// you can generate credentials from this https://developer.paypal.com/docs/classic/api/apiCredentials/

// extended values for social logins
@property (nonatomic, retain) NSString *apiKey;
@property (nonatomic, retain) NSString *socialName;
@property (nonatomic, retain) NSString *token;
@property (nonatomic, strong) NSString *apiKey;
@property (nonatomic, strong) NSString *socialName;
@property (nonatomic, strong) NSString *token;

// sets the custom attributes for Envelope tag, eg.
// for extra namespace definitions (xmlns:tmp="http://temp.org").
@property (nonatomic, retain) NSString *envelope;
// for extra namespace definitions eg. xmlns:tmp="http://temp.org".
@property (nonatomic, strong) NSString *envelope;

// sets the SOAP version you want to use (v.1.1 or v.1.2).
@property (nonatomic, assign) SOAPVersion version;
Expand All @@ -175,8 +180,8 @@ typedef enum
// that require authorization using a client certificate (p12)
// to convert a PAYPAL certificate to a p12 use the command shown below :
// openssl pkcs12 -export -in cert_key_pem.txt -inkey cert_key_pem.txt -out paypal_cert.p12
@property (nonatomic, retain) NSString *clientCerficateName;
@property (nonatomic, retain) NSString *clientCertificatePassword;
@property (nonatomic, strong) NSString *clientCerficateName;
@property (nonatomic, strong) NSString *clientCertificatePassword;

// enables the conversion of special characters in a compatible html format (eg &amp;)
@property (nonatomic, assign) BOOL escapingHTML;
Expand Down Expand Up @@ -229,6 +234,11 @@ typedef enum
- (void)setImage:(UIImage*)image forKey:(NSString*)key attributes:(NSDictionary*)attributes __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_4_3);
#endif

// return a formatted dictionary for a sub-child with attributes
// eg. ["key": ["value": key-value, "attributes": ["attr": attr-value]]]
// this generates an XML like this: <key attr="attr-value">key-value</key>
- (NSDictionary*)dictionaryForKey:(NSString*)key value:(id)value attributes:(NSDictionary*)attributes;

// clear all parameters
- (void)clearValues;

Expand Down Expand Up @@ -314,7 +324,8 @@ completeWithDictionary:(SOAPEngineCompleteBlockWithDictionary)complete
receivedDataSize:(SOAPEngineReceiveDataSizeBlock)receive
sendedDataSize:(SOAPEngineSendDataSizeBlock)sended;

// request with wsdl
// request with WSDL
// note: better use requestURL, read this https://github.com/priore/SOAPEngine#optimizations
- (void)requestWSDL:(id)wsdlURL operation:(NSString*)operation;

- (void)requestWSDL:(id)wsdlURL
Expand Down
4 changes: 2 additions & 2 deletions SOAPEngineOSX.framework/Versions/A/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.23</string>
<string>1.24</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>1.23</string>
<string>1.24</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
Expand Down
Binary file modified SOAPEngineOSX.framework/Versions/A/SOAPEngineOSX
Binary file not shown.
Binary file modified SOAPEngineOSX.framework/Versions/A/_CodeSignature/CodeDirectory
Binary file not shown.
Loading

0 comments on commit ba3c984

Please sign in to comment.