SOAP WSDL Generate Code

SpringCMServiceSoap12 / ResetPassword

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:ResetPassword|spr:token" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:Id" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:Name" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:ObjectType" value: @"Document"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:Email" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:FirstName" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:LastName" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:PhoneNumber" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:FaxNumber" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:Company" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:Department" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:Title" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:Address1" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:Address2" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:Address3" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:City" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:ProvinceState" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:PostalCode" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:Country" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:Role" value: @"Primary"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:Status" value: @"Unknown"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:PersonaUid" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:ManagedByUid" value: @"string"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:EnabledUTCStartDate" value: @"dateTime"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:EnabledUTCEndDate" value: @"dateTime"];
[xml UpdateChildContent: @"soap:Body|spr:ResetPassword|spr:user|spr:UserId" 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/ResetPassword";
//  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|*:ResetPasswordResponse|*:ResetPasswordResult|*:ErrorObject|*:Id"];
NSString *Name = [responseXml GetChildContent: @"*:Body|*:ResetPasswordResponse|*:ResetPasswordResult|*:ErrorObject|*:Name"];
NSString *ObjectType = [responseXml GetChildContent: @"*:Body|*:ResetPasswordResponse|*:ResetPasswordResult|*:ErrorObject|*:ObjectType"];
NSString *Message = [responseXml GetChildContent: @"*:Body|*:ResetPasswordResponse|*:ResetPasswordResult|*:Message"];
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:ResetPassword>
            <spr:token>string</spr:token>
            <spr:user>
                <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:user>
        </spr:ResetPassword>
    </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:ResetPasswordResponse>
            <spr:ResetPasswordResult>
                <spr:ErrorObject>
                    <spr:Id>string</spr:Id>
                    <spr:Name>string</spr:Name>
                    <spr:ObjectType>Document</spr:ObjectType>
                </spr:ErrorObject>
                <spr:Message>string</spr:Message>
            </spr:ResetPasswordResult>
        </spr:ResetPasswordResponse>
    </soap:Body>
</soap:Envelope>