SOAP WSDL Generate Code

SpringCMServiceSoap / GroupFind

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 <CkXmlW.h>
#include <CkHttpW.h>
#include <CkHttpResponseW.h>

void ChilkatSample(void)
    {
    CkXmlW xml;
    xml.put_Tag(L"soapenv:Envelope");
    xml.AddAttribute(L"xmlns:soapenv",L"http://schemas.xmlsoap.org/soap/envelope/");
    xml.AddAttribute(L"xmlns:spr",L"http://www.springcm.com/atlas/webservices/v201308/scm/");
    xml.UpdateChildContent(L"soapenv:Header",L"");
    xml.UpdateChildContent(L"soapenv:Body|spr:GroupFind|spr:token",L"string");
    xml.UpdateChildContent(L"soapenv:Body|spr:GroupFind|spr:name",L"string");
    xml.UpdateChildContent(L"soapenv:Body|spr:GroupFind|spr:IncludeDeleted",L"true");

    // 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.put_EmitXmlDecl(false);
    const wchar_t *soapRequestBody = xml.getXml();

    const wchar_t *endpoint = L"https://soapna11.springcm.com/atlas/webservices/v201308/springcmservice.asmx";
    const wchar_t *soapAction = L"http://www.springcm.com/atlas/webservices/v201308/scm/GroupFind";
    //  For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
    const wchar_t *contentType = L"text/xml";

    CkHttpW http;

    http.ClearHeaders();
    http.SetRequestHeader(L"Content-Type",contentType);
    http.SetRequestHeader(L"SOAPAction",soapAction);

    CkHttpResponseW *resp = http.PostXml(endpoint,soapRequestBody,L"utf-8");
    if (http.get_LastMethodSuccess() == false) {
        wprintf(L"%s\n",http.lastErrorText());
        wprintf(L"Failed to send SOAP request.\n");
        return;
    }

    // Get the XML response body.
    CkXmlW responseXml;
    resp->GetBodyXml(responseXml);

    int statusCode = resp->get_StatusCode();
    wprintf(L"response status code: %d\n",statusCode);

    delete resp;

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

    wprintf(L"%s\n",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).

    const wchar_t *Id = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Id");
    const wchar_t *Name = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Name");
    const wchar_t *ObjectType = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:ObjectType");
    const wchar_t *IsPrivate = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:IsPrivate");
    Id = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Id");
    Name = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Name");
    ObjectType = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:ObjectType");
    const wchar_t *v_Email = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Email");
    const wchar_t *FirstName = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:FirstName");
    const wchar_t *LastName = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:LastName");
    const wchar_t *PhoneNumber = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:PhoneNumber");
    const wchar_t *FaxNumber = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:FaxNumber");
    const wchar_t *Company = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Company");
    const wchar_t *Department = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Department");
    const wchar_t *Title = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Title");
    const wchar_t *Address1 = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Address1");
    const wchar_t *Address2 = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Address2");
    const wchar_t *Address3 = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Address3");
    const wchar_t *City = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:City");
    const wchar_t *ProvinceState = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:ProvinceState");
    const wchar_t *PostalCode = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:PostalCode");
    const wchar_t *Country = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Country");
    const wchar_t *GroupType = responseXml.getChildContent(L"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:GroupType");
    }
Request XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:spr="http://www.springcm.com/atlas/webservices/v201308/scm/">
    <soapenv:Header/>
    <soapenv:Body>
        <spr:GroupFind>
            <spr:token>string</spr:token>
            <spr:name>string</spr:name>
            <spr:IncludeDeleted>true</spr:IncludeDeleted>
        </spr:GroupFind>
    </soapenv:Body>
</soapenv:Envelope>
Response XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:spr="http://www.springcm.com/atlas/webservices/v201308/scm/">
    <soapenv:Header/>
    <soapenv:Body>
        <spr:GroupFindResponse>
            <spr:GroupFindResult>
                <spr:SCMGroup>
                    <spr:Id>string</spr:Id>
                    <spr:Name>string</spr:Name>
                    <spr:ObjectType>Document</spr:ObjectType>
                    <spr:IsPrivate>true</spr:IsPrivate>
                    <spr:Members>
                        <spr:SCMContactInfo>
                            <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:SCMContactInfo>
                    </spr:Members>
                    <spr:GroupType>Distribution</spr:GroupType>
                </spr:SCMGroup>
            </spr:GroupFindResult>
        </spr:GroupFindResponse>
    </soapenv:Body>
</soapenv:Envelope>