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
#include <C_CkXml.h>
#include <C_CkHttp.h>
#include <C_CkHttpResponse.h>

void ChilkatSample(void)
    {
    HCkXml xml;
    const char *soapRequestBody;
    const char *endpoint;
    const char *soapAction;
    const char *contentType;
    HCkHttp http;
    HCkHttpResponse resp;
    HCkXml responseXml;
    int statusCode;
    const char *Id;
    const char *Name;
    const char *ObjectType;
    const char *Message;

    xml = CkXml_Create();
    CkXml_putTag(xml,"soap:Envelope");
    CkXml_AddAttribute(xml,"xmlns:soap","http://www.w3.org/2003/05/soap-envelope");
    CkXml_AddAttribute(xml,"xmlns:spr","http://www.springcm.com/atlas/webservices/v201308/scm/");
    CkXml_UpdateChildContent(xml,"soap:Header","");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:token","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:Id","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:Name","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:ObjectType","Document");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:Email","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:FirstName","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:LastName","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:PhoneNumber","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:FaxNumber","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:Company","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:Department","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:Title","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:Address1","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:Address2","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:Address3","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:City","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:ProvinceState","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:PostalCode","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:Country","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:Role","Primary");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:Status","Unknown");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:PersonaUid","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:ManagedByUid","string");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:EnabledUTCStartDate","dateTime");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:EnabledUTCEndDate","dateTime");
    CkXml_UpdateChildContent(xml,"soap:Body|spr:ResetPassword|spr:user|spr:UserId","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. 
    CkXml_putEmitXmlDecl(xml,FALSE);
    soapRequestBody = CkXml_getXml(xml);

    endpoint = "https://soapna11.springcm.com/atlas/webservices/v201308/springcmservice.asmx";
    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"
    contentType = "text/xml";

    http = CkHttp_Create();

    CkHttp_ClearHeaders(http);
    CkHttp_SetRequestHeader(http,"Content-Type",contentType);
    CkHttp_SetRequestHeader(http,"SOAPAction",soapAction);

    resp = CkHttp_PostXml(http,endpoint,soapRequestBody,"utf-8");
    if (CkHttp_getLastMethodSuccess(http) == FALSE) {
        printf("%s\n",CkHttp_lastErrorText(http));
        printf("Failed to send SOAP request.\n");
        CkXml_Dispose(xml);
        CkHttp_Dispose(http);
        return;
    }

    // Get the XML response body.
    responseXml = CkXml_Create();
    CkHttpResponse_GetBodyXml(resp,responseXml);

    statusCode = CkHttpResponse_getStatusCode(resp);
    printf("response status code: %d\n",statusCode);

    CkHttpResponse_Dispose(resp);

    // If the status code does not indicate succcess, then show the response XML,
    // which probably contains error information.
    if (statusCode != 200) {
        printf("%s\n",CkXml_getXml(responseXml));
        CkXml_Dispose(xml);
        CkHttp_Dispose(http);
        CkXml_Dispose(responseXml);
        return;
    }

    printf("%s\n",CkXml_getXml(responseXml));

    // 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).

    Id = CkXml_getChildContent(responseXml,"*:Body|*:ResetPasswordResponse|*:ResetPasswordResult|*:ErrorObject|*:Id");
    Name = CkXml_getChildContent(responseXml,"*:Body|*:ResetPasswordResponse|*:ResetPasswordResult|*:ErrorObject|*:Name");
    ObjectType = CkXml_getChildContent(responseXml,"*:Body|*:ResetPasswordResponse|*:ResetPasswordResult|*:ErrorObject|*:ObjectType");
    Message = CkXml_getChildContent(responseXml,"*:Body|*:ResetPasswordResponse|*:ResetPasswordResult|*:Message");


    CkXml_Dispose(xml);
    CkHttp_Dispose(http);
    CkXml_Dispose(responseXml);

    }
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>