SpringCMServiceSoap12 / UserGetByAccountId
ASP AutoIt C C (Unicode) C++ C++ (Unicode) C# DataFlex Delphi Foxpro Go Java Node.js Objective-C Perl PHP Extension PowerBuilder Powershell PureBasic Python CkPython Ruby SQL Server Swift TCL VB.NET VB6 VBScript Xojo
#import <CkoXml.h>
#import <NSString.h>
#import <CkoHttp.h>
#import <CkoHttpResponse.h>
CkoXml *xml = [[CkoXml alloc] init];
xml.Tag = @"soap:Envelope";
[xml AddAttribute: @"xmlns:soap" value: @"http://www.w3.org/2003/05/soap-envelope"];
[xml AddAttribute: @"xmlns:spr" value: @"http://www.springcm.com/atlas/webservices/v201308/scm/"];
[xml UpdateChildContent: @"soap:Header" value: @""];
[xml UpdateChildContent: @"soap:Body|spr:UserGetByAccountId|spr:token" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:UserGetByAccountId|spr:accountId" value: @"string"];
// In a SOAP HTTP request, including the XML declaration (<?xml version="1.0" encoding="UTF-8"?>) in the XML body is generally not required.
xml.EmitXmlDecl = NO;
NSString *soapRequestBody = [xml GetXml];
NSString *endpoint = @"https://soapna11.springcm.com/atlas/webservices/v201308/springcmservice.asmx";
NSString *soapAction = @"http://www.springcm.com/atlas/webservices/v201308/scm/UserGetByAccountId";
// For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
NSString *contentType = @"text/xml";
CkoHttp *http = [[CkoHttp alloc] init];
[http ClearHeaders];
[http SetRequestHeader: @"Content-Type" value: contentType];
[http SetRequestHeader: @"SOAPAction" value: soapAction];
CkoHttpResponse *resp = [http PostXml: endpoint xmlDoc: soapRequestBody charset: @"utf-8"];
if (http.LastMethodSuccess == NO) {
NSLog(@"%@",http.LastErrorText);
NSLog(@"%@",@"Failed to send SOAP request.");
return;
}
// Get the XML response body.
CkoXml *responseXml = [[CkoXml alloc] init];
[resp GetBodyXml: responseXml];
int statusCode = [resp.StatusCode intValue];
NSLog(@"%@%d",@"response status code: ",statusCode);
// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.
if (statusCode != 200) {
NSLog(@"%@",[responseXml GetXml]);
return;
}
NSLog(@"%@",[responseXml GetXml]);
// Parse the successful SOAP response XML.
// This is a sample of the response XML, but the namespace prefixes will be different.
// We can parse the result using "*" for the namespace prefixes (see below).
NSString *Id = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Id"];
NSString *Name = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Name"];
NSString *ObjectType = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:ObjectType"];
NSString *v_Email = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Email"];
NSString *FirstName = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:FirstName"];
NSString *LastName = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:LastName"];
NSString *PhoneNumber = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:PhoneNumber"];
NSString *FaxNumber = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:FaxNumber"];
NSString *Company = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Company"];
NSString *Department = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Department"];
NSString *Title = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Title"];
NSString *Address1 = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Address1"];
NSString *Address2 = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Address2"];
NSString *Address3 = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Address3"];
NSString *City = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:City"];
NSString *ProvinceState = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:ProvinceState"];
NSString *PostalCode = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:PostalCode"];
NSString *Country = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Country"];
NSString *Role = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Role"];
NSString *Status = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Status"];
NSString *PersonaUid = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:PersonaUid"];
NSString *ManagedByUid = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:ManagedByUid"];
NSString *EnabledUTCStartDate = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:EnabledUTCStartDate"];
NSString *EnabledUTCEndDate = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:EnabledUTCEndDate"];
NSString *UserId = [responseXml GetChildContent: @"*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:UserId"];
Request XML
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:spr="http://www.springcm.com/atlas/webservices/v201308/scm/">
<soap:Header/>
<soap:Body>
<spr:UserGetByAccountId>
<spr:token>string</spr:token>
<spr:accountId>string</spr:accountId>
</spr:UserGetByAccountId>
</soap:Body>
</soap:Envelope>
Response XML
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:spr="http://www.springcm.com/atlas/webservices/v201308/scm/">
<soap:Header/>
<soap:Body>
<spr:UserGetByAccountIdResponse>
<spr:UserGetByAccountIdResult>
<spr:SCMUserAccount>
<spr:Id>string</spr:Id>
<spr:Name>string</spr:Name>
<spr:ObjectType>Document</spr:ObjectType>
<spr:Email>string</spr:Email>
<spr:FirstName>string</spr:FirstName>
<spr:LastName>string</spr:LastName>
<spr:PhoneNumber>string</spr:PhoneNumber>
<spr:FaxNumber>string</spr:FaxNumber>
<spr:Company>string</spr:Company>
<spr:Department>string</spr:Department>
<spr:Title>string</spr:Title>
<spr:Address1>string</spr:Address1>
<spr:Address2>string</spr:Address2>
<spr:Address3>string</spr:Address3>
<spr:City>string</spr:City>
<spr:ProvinceState>string</spr:ProvinceState>
<spr:PostalCode>string</spr:PostalCode>
<spr:Country>string</spr:Country>
<spr:Role>Primary</spr:Role>
<spr:Status>Unknown</spr:Status>
<spr:PersonaUid>string</spr:PersonaUid>
<spr:ManagedByUid>string</spr:ManagedByUid>
<spr:EnabledUTCStartDate>dateTime</spr:EnabledUTCStartDate>
<spr:EnabledUTCEndDate>dateTime</spr:EnabledUTCEndDate>
<spr:UserId>string</spr:UserId>
</spr:SCMUserAccount>
</spr:UserGetByAccountIdResult>
</spr:UserGetByAccountIdResponse>
</soap:Body>
</soap:Envelope>