SOAP WSDL Generate Code

InvoiceServiceImplServiceSoapBinding / UploadCompany

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:inv",L"http://invoice.carvajal.com/invoiceService/");
    xml.UpdateChildContent(L"soapenv:Header",L"");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:name",L"string");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:number",L"string");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:status",L"string");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:email",L"string");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:configuration|inv:senderConfiguration|inv:publishTimeLimit",L"string");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:configuration|inv:senderConfiguration|inv:cancellationsStatementTime",L"string");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:configuration|inv:senderConfiguration|inv:existsConfigDomain",L"true");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:configuration|inv:senderConfiguration|inv:customerDomain|inv:email",L"string");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:configuration|inv:senderConfiguration|inv:customerDomain|inv:password",L"string");
    xml.UpdateChildContentInt(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:configuration|inv:senderConfiguration|inv:customerDomain|inv:port",1042);
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:configuration|inv:senderConfiguration|inv:customerDomain|inv:smtpHost",L"string");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:configuration|inv:senderConfiguration|inv:deliveryReportsChannels",L"true");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:configuration|inv:senderConfiguration|inv:advanceCUFEQR",L"true");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:configuration|inv:senderConfiguration|inv:messagebusTransformation",L"true");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:configuration|inv:subscriptionConfiguration",L"");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:configuration|inv:governmentConfiguration|inv:obliged",L"string");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:configuration|inv:billingPlanConfiguration|inv:type",L"string");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:configuration|inv:government_configuration_event",L"");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:configuration|inv:reporting_configuration",L"");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:properties|inv:property|inv:name",L"string");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:properties|inv:property|inv:value",L"string");
    xml.UpdateChildContent(L"soapenv:Body|inv:UploadCompanyRequest|inv:company|inv:creationDateOriginal",L"dateTime");

    // 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://wscenf.cen.biz/isows/InvoiceService";
    const wchar_t *soapAction = L"http://invoice.carvajal.com/invoiceService/UploadCompany";
    //  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 *status = responseXml.getChildContent(L"*:Body|*:UploadCompanyResponse|*:status");
    }
Request XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inv="http://invoice.carvajal.com/invoiceService/">
    <soapenv:Header/>
    <soapenv:Body>
        <inv:UploadCompanyRequest>
            <inv:company>
                <inv:name>string</inv:name>
                <inv:number>string</inv:number>
                <inv:status>string</inv:status>
                <inv:email>string</inv:email>
                <inv:configuration>
                    <inv:senderConfiguration>
                        <inv:publishTimeLimit>string</inv:publishTimeLimit>
                        <inv:cancellationsStatementTime>string</inv:cancellationsStatementTime>
                        <inv:existsConfigDomain>true</inv:existsConfigDomain>
                        <inv:customerDomain>
                            <inv:email>string</inv:email>
                            <inv:password>string</inv:password>
                            <inv:port>1042</inv:port>
                            <inv:smtpHost>string</inv:smtpHost>
                        </inv:customerDomain>
                        <inv:deliveryReportsChannels>true</inv:deliveryReportsChannels>
                        <inv:advanceCUFEQR>true</inv:advanceCUFEQR>
                        <inv:messagebusTransformation>true</inv:messagebusTransformation>
                    </inv:senderConfiguration>
                    <inv:subscriptionConfiguration/>
                    <inv:governmentConfiguration>
                        <inv:obliged>string</inv:obliged>
                    </inv:governmentConfiguration>
                    <inv:billingPlanConfiguration>
                        <inv:type>string</inv:type>
                    </inv:billingPlanConfiguration>
                    <inv:government_configuration_event/>
                    <inv:reporting_configuration/>
                </inv:configuration>
                <inv:properties>
                    <inv:property>
                        <inv:name>string</inv:name>
                        <inv:value>string</inv:value>
                    </inv:property>
                </inv:properties>
                <inv:creationDateOriginal>dateTime</inv:creationDateOriginal>
            </inv:company>
        </inv:UploadCompanyRequest>
    </soapenv:Body>
</soapenv:Envelope>
Response XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inv="http://invoice.carvajal.com/invoiceService/">
    <soapenv:Header/>
    <soapenv:Body>
        <inv:UploadCompanyResponse>
            <inv:status>string</inv:status>
        </inv:UploadCompanyResponse>
    </soapenv:Body>
</soapenv:Envelope>