Skip to content

SoapAction attributes

Danilo edited this page Jun 15, 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.

Sample

In the example below can see how actionAttributes sets the namespace tmp=http://tempuri.org
while actionQuotes encloses the SOAPAction value in the header in double quotes "http://my-site/GetData"
and actionNamespaceSlash adds the final slash to method namespace http://my-site/.

SOAPEngine *soap = [[SOAPEngine alloc] init];
    
soap.actionQuotes = YES;
soap.actionNamespaceSlash = YES;
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"];

Header of request :

Accept: "text/xml; charset=utf-8"
Content-Type: "text/xml; charset=utf-8"
SOAPAction: "http://my-site/GetData"

XML :

<GetData xmlns:tmp="http://tempuri.org" xmlns="http://my-site/">
	<tmp:text>ABCD</tmp:text>
</GetData>