Skip to content

SoapAction attributes

Danilo edited this page Jun 19, 2020 · 3 revisions

Overview

The actionAttributes, actionQuotes and actionNamespaceSlash properties allow to set namespaces, double quotes and slashes in everything related the called method, also called soapAction.

Samples

Property actionAttributes

In the example below can see how sets the namespace eg. tmp=http://tempuri.org.

SOAPEngine *soap = [[SOAPEngine alloc] init];
    
soap.actionAttributes = @{@"xmlns:tmp" : @"http://tempuri.org"};
    
[soap setValue:@"ABCD" forKey:@"tmp:text"];
[soap requestURL:@"http://my-site/my-service.asmx" soapAction:@"http://my-site/GetData"];
XML :
<GetData xmlns:tmp="http://tempuri.org" xmlns="http://my-site/">
	<tmp:text>ABCD</tmp:text>
</GetData>

Property actionQuotes

In the example below can see how encloses the SOAPAction value in the header of request in double quotes eg. "http://my-site/GetData"

soap.actionQuotes = YES;
Header of request :
Accept: "text/xml; charset=utf-8"
Content-Type: "text/xml; charset=utf-8"
SOAPAction: "http://my-site/GetData"

Property actionNamespaceSlash

In the example below can see how adds the final slash to method namespace eg. http://my-site/.

soap.actionNamespaceSlash = YES;
    
[soap setValue:@"ABCD" forKey:@"tmp:text"];
[soap requestURL:@"http://my-site/my-service.asmx" soapAction:@"http://my-site/GetData"];
XML :
<GetData xmlns="http://my-site/">
	<tmp:text>ABCD</tmp:text>
</GetData>