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 <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 *IsPrivate;
    const char *v_Email;
    const char *FirstName;
    const char *LastName;
    const char *PhoneNumber;
    const char *FaxNumber;
    const char *Company;
    const char *Department;
    const char *Title;
    const char *Address1;
    const char *Address2;
    const char *Address3;
    const char *City;
    const char *ProvinceState;
    const char *PostalCode;
    const char *Country;
    const char *GroupType;

    xml = CkXml_Create();
    CkXml_putTag(xml,"soapenv:Envelope");
    CkXml_AddAttribute(xml,"xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/");
    CkXml_AddAttribute(xml,"xmlns:spr","http://www.springcm.com/atlas/webservices/v201308/scm/");
    CkXml_UpdateChildContent(xml,"soapenv:Header","");
    CkXml_UpdateChildContent(xml,"soapenv:Body|spr:GroupFind|spr:token","string");
    CkXml_UpdateChildContent(xml,"soapenv:Body|spr:GroupFind|spr:name","string");
    CkXml_UpdateChildContent(xml,"soapenv:Body|spr:GroupFind|spr:IncludeDeleted","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. 
    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/GroupFind";
    //  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|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Id");
    Name = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Name");
    ObjectType = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:ObjectType");
    IsPrivate = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:IsPrivate");
    Id = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Id");
    Name = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Name");
    ObjectType = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:ObjectType");
    v_Email = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Email");
    FirstName = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:FirstName");
    LastName = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:LastName");
    PhoneNumber = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:PhoneNumber");
    FaxNumber = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:FaxNumber");
    Company = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Company");
    Department = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Department");
    Title = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Title");
    Address1 = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Address1");
    Address2 = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Address2");
    Address3 = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Address3");
    City = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:City");
    ProvinceState = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:ProvinceState");
    PostalCode = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:PostalCode");
    Country = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Country");
    GroupType = CkXml_getChildContent(responseXml,"*:Body|*:GroupFindResponse|*:GroupFindResult|*:SCMGroup|*:GroupType");


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

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