SOAP WSDL Generate Code

WageFileServicesSOAP12Binding / getWageFileStatus

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 *wfid;
    int receiptYear;
    const wchar_t *version;
    const wchar_t *receiptDate;
    const wchar_t *statusCode;
    const wchar_t *statusDescription;
    const wchar_t *statusDate;
    const wchar_t *filingMethod;
    int w3Count;
    const wchar_t *originalFilename;
    const wchar_t *returnCode;
    const wchar_t *transactionTimestamp;
    const wchar_t *errorInfo;
    const wchar_t *errorDateInfo;
    const wchar_t *deprecationDate;
    const wchar_t *sunsetDate;

    xml = CkXmlW_Create();
    CkXmlW_putTag(xml,L"soap:Envelope");
    CkXmlW_AddAttribute(xml,L"xmlns:soap",L"http://www.w3.org/2003/05/soap-envelope");
    CkXmlW_AddAttribute(xml,L"xmlns:impl",L"urn:parameters.v3.ewr.ws.ssa.gov");
    CkXmlW_AddAttribute(xml,L"xmlns:ns0",L"urn:skeleton.v3.ewr.ws.ssa.gov");
    CkXmlW_UpdateChildContent(xml,L"soap:Header",L"");
    CkXmlW_UpdateChildContent(xml,L"soap:Body|ns0:GetWageFileStatusRequest|impl:confirmationNumber",L"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. 
    CkXmlW_putEmitXmlDecl(xml,FALSE);
    soapRequestBody = CkXmlW_getXml(xml);

    endpoint = L"https://ws.ssa.gov/ewrwsv3/services/WageFileServices";
    soapAction = L"getWageFileStatus";
    //  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).

    wfid = CkXmlW_getChildContent(responseXml,L"*:Body|*:GetWageFileStatusResponse|*:wfid");
    receiptYear = CkXmlW_GetChildIntValue(responseXml,L"*:Body|*:GetWageFileStatusResponse|*:receiptYear");
    version = CkXmlW_getChildContent(responseXml,L"*:Body|*:GetWageFileStatusResponse|*:version");
    receiptDate = CkXmlW_getChildContent(responseXml,L"*:Body|*:GetWageFileStatusResponse|*:receiptDate");
    statusCode = CkXmlW_getChildContent(responseXml,L"*:Body|*:GetWageFileStatusResponse|*:statusCode");
    statusDescription = CkXmlW_getChildContent(responseXml,L"*:Body|*:GetWageFileStatusResponse|*:statusDescription");
    statusDate = CkXmlW_getChildContent(responseXml,L"*:Body|*:GetWageFileStatusResponse|*:statusDate");
    filingMethod = CkXmlW_getChildContent(responseXml,L"*:Body|*:GetWageFileStatusResponse|*:filingMethod");
    w3Count = CkXmlW_GetChildIntValue(responseXml,L"*:Body|*:GetWageFileStatusResponse|*:w3Count");
    originalFilename = CkXmlW_getChildContent(responseXml,L"*:Body|*:GetWageFileStatusResponse|*:originalFilename");
    returnCode = CkXmlW_getChildContent(responseXml,L"*:Body|*:GetWageFileStatusResponse|*:response|*:returnCode");
    transactionTimestamp = CkXmlW_getChildContent(responseXml,L"*:Body|*:GetWageFileStatusResponse|*:response|*:transactionTimestamp");
    errorInfo = CkXmlW_getChildContent(responseXml,L"*:Body|*:GetWageFileStatusResponse|*:response|*:errorInfo");
    errorDateInfo = CkXmlW_getChildContent(responseXml,L"*:Body|*:GetWageFileStatusResponse|*:response|*:errorDateInfo");
    deprecationDate = CkXmlW_getChildContent(responseXml,L"*:Body|*:GetWageFileStatusResponse|*:response|*:deprecationDate");
    sunsetDate = CkXmlW_getChildContent(responseXml,L"*:Body|*:GetWageFileStatusResponse|*:response|*:sunsetDate");


    CkXmlW_Dispose(xml);
    CkHttpW_Dispose(http);
    CkXmlW_Dispose(responseXml);

    }
Request XML
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:impl="urn:parameters.v3.ewr.ws.ssa.gov" xmlns:ns0="urn:skeleton.v3.ewr.ws.ssa.gov">
    <soap:Header/>
    <soap:Body>
        <ns0:GetWageFileStatusRequest>
            <impl:confirmationNumber>string</impl:confirmationNumber>
        </ns0:GetWageFileStatusRequest>
    </soap:Body>
</soap:Envelope>
Response XML
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ns0="urn:skeleton.v3.ewr.ws.ssa.gov" xmlns:impl="urn:parameters.v3.ewr.ws.ssa.gov">
    <soap:Header/>
    <soap:Body>
        <ns0:GetWageFileStatusResponse>
            <impl:wfid>string</impl:wfid>
            <impl:receiptYear>1042</impl:receiptYear>
            <impl:version>string</impl:version>
            <impl:receiptDate>dateTime</impl:receiptDate>
            <impl:statusCode>string</impl:statusCode>
            <impl:statusDescription>string</impl:statusDescription>
            <impl:statusDate>dateTime</impl:statusDate>
            <impl:filingMethod>string</impl:filingMethod>
            <impl:w3Count>1042</impl:w3Count>
            <impl:originalFilename>string</impl:originalFilename>
            <impl:response>
                <impl:returnCode>string</impl:returnCode>
                <impl:transactionTimestamp>dateTime</impl:transactionTimestamp>
                <impl:errorInfo>string</impl:errorInfo>
                <impl:errorDateInfo>dateTime</impl:errorDateInfo>
                <impl:deprecationDate>dateTime</impl:deprecationDate>
                <impl:sunsetDate>dateTime</impl:sunsetDate>
            </impl:response>
        </ns0:GetWageFileStatusResponse>
    </soap:Body>
</soap:Envelope>