SOAP WSDL Generate Code

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
func chilkatTest() {
    let xml = CkoXml()
    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 = false
    var soapRequestBody: String? = xml.GetXml()

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

    let http = CkoHttp()

    http.ClearHeaders()
    http.SetRequestHeader("Content-Type", value: contentType)
    http.SetRequestHeader("SOAPAction", value: soapAction)

    var resp: CkoHttpResponse? = http.PostXml(endpoint, xmlDoc: soapRequestBody, charset: "utf-8")
    if http.LastMethodSuccess == false {
        print("\(http.LastErrorText)")
        print("Failed to send SOAP request.")
        return
    }

    // Get the XML response body.
    let responseXml = CkoXml()
    resp!.GetBodyXml(responseXml)

    var statusCode: Int = resp!.StatusCode.intValue
    print("response status code: \(statusCode)")

    resp = nil

    // If the status code does not indicate succcess, then show the response XML,
    // which probably contains error information.
    if statusCode != 200 {
        print("\(responseXml.GetXml())")
        return
    }

    print("\(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).

    var Id: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Id")
    var Name: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Name")
    var ObjectType: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:ObjectType")
    var v_Email: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Email")
    var FirstName: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:FirstName")
    var LastName: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:LastName")
    var PhoneNumber: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:PhoneNumber")
    var FaxNumber: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:FaxNumber")
    var Company: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Company")
    var Department: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Department")
    var Title: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Title")
    var Address1: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Address1")
    var Address2: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Address2")
    var Address3: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Address3")
    var City: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:City")
    var ProvinceState: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:ProvinceState")
    var PostalCode: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:PostalCode")
    var Country: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Country")
    var Role: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Role")
    var Status: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:Status")
    var PersonaUid: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:PersonaUid")
    var ManagedByUid: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:ManagedByUid")
    var EnabledUTCStartDate: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:EnabledUTCStartDate")
    var EnabledUTCEndDate: String? = responseXml.GetChildContent("*:Body|*:UserGetByAccountIdResponse|*:UserGetByAccountIdResult|*:SCMUserAccount|*:EnabledUTCEndDate")
    var UserId: String? = 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>