SOAP WSDL Generate Code

SpringCMServiceSoap / FolderSearch

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_CkXmlW.h>
#include <C_CkHttpW.h>
#include <C_CkHttpResponseW.h>

void ChilkatSample(void)
    {
    HCkXmlW xml;
    const wchar_t *soapRequestBody;
    const wchar_t *endpoint;
    const wchar_t *soapAction;
    const wchar_t *contentType;
    HCkHttpW http;
    HCkHttpResponseW resp;
    HCkXmlW responseXml;
    int statusCode;
    const wchar_t *Id;
    const wchar_t *Name;
    const wchar_t *ObjectType;
    const wchar_t *ParentFolderId;
    const wchar_t *CreatedBy;
    const wchar_t *CreatedDate;
    const wchar_t *UpdatedBy;
    const wchar_t *UpdatedDate;
    const wchar_t *Security;
    const wchar_t *Description;
    const wchar_t *GroupName;
    const wchar_t *FieldName;
    const wchar_t *Value;
    const wchar_t *HighValue;
    const wchar_t *ExcludeFromSearch;
    const wchar_t *SetName;
    int SetNumber;
    const wchar_t *DataType;
    const wchar_t *v_string;

    xml = CkXmlW_Create();
    CkXmlW_putTag(xml,L"soapenv:Envelope");
    CkXmlW_AddAttribute(xml,L"xmlns:soapenv",L"http://schemas.xmlsoap.org/soap/envelope/");
    CkXmlW_AddAttribute(xml,L"xmlns:spr",L"http://www.springcm.com/atlas/webservices/v201308/scm/");
    CkXmlW_UpdateChildContent(xml,L"soapenv:Header",L"");
    CkXmlW_UpdateChildContent(xml,L"soapenv:Body|spr:FolderSearch|spr:token",L"string");
    CkXmlW_UpdateChildContent(xml,L"soapenv:Body|spr:FolderSearch|spr:search|spr:AtLeastOneWord",L"string");
    CkXmlW_UpdateChildContent(xml,L"soapenv:Body|spr:FolderSearch|spr:search|spr:WithAllWords",L"string");
    CkXmlW_UpdateChildContent(xml,L"soapenv:Body|spr:FolderSearch|spr:search|spr:WithoutWords",L"string");
    CkXmlW_UpdateChildContent(xml,L"soapenv:Body|spr:FolderSearch|spr:search|spr:WithPhrase",L"string");
    CkXmlW_UpdateChildContent(xml,L"soapenv:Body|spr:FolderSearch|spr:search|spr:StartDate",L"dateTime");
    CkXmlW_UpdateChildContent(xml,L"soapenv:Body|spr:FolderSearch|spr:search|spr:EndDate",L"dateTime");
    CkXmlW_UpdateChildContent(xml,L"soapenv:Body|spr:FolderSearch|spr:search|spr:LimitFolderId",L"string");
    CkXmlW_UpdateChildContent(xml,L"soapenv:Body|spr:FolderSearch|spr:search|spr:LimitIncludeSubfolders",L"true");
    CkXmlW_UpdateChildContentInt(xml,L"soapenv:Body|spr:FolderSearch|spr:search|spr:StartHitIndex",1042);
    CkXmlW_UpdateChildContentInt(xml,L"soapenv:Body|spr:FolderSearch|spr:search|spr:MaxHits",1042);
    CkXmlW_UpdateChildContent(xml,L"soapenv:Body|spr:FolderSearch|spr:search|spr:Name",L"string");
    CkXmlW_UpdateChildContent(xml,L"soapenv:Body|spr:FolderSearch|spr:loadExtendedMetadata",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. 
    CkXmlW_putEmitXmlDecl(xml,FALSE);
    soapRequestBody = CkXmlW_getXml(xml);

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

    http = CkHttpW_Create();

    CkHttpW_ClearHeaders(http);
    CkHttpW_SetRequestHeader(http,L"Content-Type",contentType);
    CkHttpW_SetRequestHeader(http,L"SOAPAction",soapAction);

    resp = CkHttpW_PostXml(http,endpoint,soapRequestBody,L"utf-8");
    if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        wprintf(L"Failed to send SOAP request.\n");
        CkXmlW_Dispose(xml);
        CkHttpW_Dispose(http);
        return;
    }

    // Get the XML response body.
    responseXml = CkXmlW_Create();
    CkHttpResponseW_GetBodyXml(resp,responseXml);

    statusCode = CkHttpResponseW_getStatusCode(resp);
    wprintf(L"response status code: %d\n",statusCode);

    CkHttpResponseW_Dispose(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",CkXmlW_getXml(responseXml));
        CkXmlW_Dispose(xml);
        CkHttpW_Dispose(http);
        CkXmlW_Dispose(responseXml);
        return;
    }

    wprintf(L"%s\n",CkXmlW_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 = CkXmlW_getChildContent(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:Id");
    Name = CkXmlW_getChildContent(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:Name");
    ObjectType = CkXmlW_getChildContent(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:ObjectType");
    ParentFolderId = CkXmlW_getChildContent(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:ParentFolderId");
    CreatedBy = CkXmlW_getChildContent(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:CreatedBy");
    CreatedDate = CkXmlW_getChildContent(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:CreatedDate");
    UpdatedBy = CkXmlW_getChildContent(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:UpdatedBy");
    UpdatedDate = CkXmlW_getChildContent(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:UpdatedDate");
    Security = CkXmlW_getChildContent(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:Security");
    Description = CkXmlW_getChildContent(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:Description");
    GroupName = CkXmlW_getChildContent(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:Metadata|*:SCMMetadata|*:GroupName");
    FieldName = CkXmlW_getChildContent(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:Metadata|*:SCMMetadata|*:FieldName");
    Value = CkXmlW_getChildContent(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:Metadata|*:SCMMetadata|*:Value");
    HighValue = CkXmlW_getChildContent(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:Metadata|*:SCMMetadata|*:HighValue");
    ExcludeFromSearch = CkXmlW_getChildContent(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:Metadata|*:SCMMetadata|*:ExcludeFromSearch");
    SetName = CkXmlW_getChildContent(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:Metadata|*:SCMMetadata|*:SetName");
    SetNumber = CkXmlW_GetChildIntValue(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:Metadata|*:SCMMetadata|*:SetNumber");
    DataType = CkXmlW_getChildContent(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:Metadata|*:SCMMetadata|*:DataType");
    v_string = CkXmlW_getChildContent(responseXml,L"*:Body|*:FolderSearchResponse|*:FolderSearchResult|*:SCMFolder|*:LimitAttributeGroups|*:string");


    CkXmlW_Dispose(xml);
    CkHttpW_Dispose(http);
    CkXmlW_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:FolderSearch>
            <spr:token>string</spr:token>
            <spr:search>
                <spr:AtLeastOneWord>string</spr:AtLeastOneWord>
                <spr:WithAllWords>string</spr:WithAllWords>
                <spr:WithoutWords>string</spr:WithoutWords>
                <spr:WithPhrase>string</spr:WithPhrase>
                <spr:StartDate>dateTime</spr:StartDate>
                <spr:EndDate>dateTime</spr:EndDate>
                <spr:LimitFolderId>string</spr:LimitFolderId>
                <spr:LimitIncludeSubfolders>true</spr:LimitIncludeSubfolders>
                <spr:StartHitIndex>1042</spr:StartHitIndex>
                <spr:MaxHits>1042</spr:MaxHits>
                <spr:Name>string</spr:Name>
            </spr:search>
            <spr:loadExtendedMetadata>true</spr:loadExtendedMetadata>
        </spr:FolderSearch>
    </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:FolderSearchResponse>
            <spr:FolderSearchResult>
                <spr:SCMFolder>
                    <spr:Id>string</spr:Id>
                    <spr:Name>string</spr:Name>
                    <spr:ObjectType>Document</spr:ObjectType>
                    <spr:ParentFolderId>string</spr:ParentFolderId>
                    <spr:CreatedBy>string</spr:CreatedBy>
                    <spr:CreatedDate>dateTime</spr:CreatedDate>
                    <spr:UpdatedBy>string</spr:UpdatedBy>
                    <spr:UpdatedDate>dateTime</spr:UpdatedDate>
                    <spr:Security>list of enumerated string values</spr:Security>
                    <spr:Description>string</spr:Description>
                    <spr:Metadata>
                        <spr:SCMMetadata>
                            <spr:GroupName>string</spr:GroupName>
                            <spr:FieldName>string</spr:FieldName>
                            <spr:Value>string</spr:Value>
                            <spr:HighValue>string</spr:HighValue>
                            <spr:ExcludeFromSearch>true</spr:ExcludeFromSearch>
                            <spr:SetName>string</spr:SetName>
                            <spr:SetNumber>1042</spr:SetNumber>
                            <spr:DataType>String</spr:DataType>
                        </spr:SCMMetadata>
                    </spr:Metadata>
                    <spr:LimitAttributeGroups>
                        <spr:string>string</spr:string>
                    </spr:LimitAttributeGroups>
                </spr:SCMFolder>
            </spr:FolderSearchResult>
        </spr:FolderSearchResponse>
    </soapenv:Body>
</soapenv:Envelope>