SOAP WSDL Generate Code

FinaInvoiceB2GBinding / getB2GOutgoingInvoiceList

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 *Envelope_xmlns;
    const char *MessageID;
    const char *MessageAckID;
    int MessageType;
    const char *AckStatus;
    int AckStatusCode;
    const char *AckStatusText;
    const char *XMLStandard;
    const char *SpecificationIdentifier;
    const char *DocumentTypeCode;
    const char *DocumentTypeText;
    const char *StatusCode;
    int CodeReason;
    const char *Note;
    const char *PartialAmount;
    const char *DocumentCurrencyCode;
    const char *BuyerID;
    const char *AdditionalBuyerID;
    const char *BuyerRegistrationName;
    const char *BuyerCompanyID;
    int InvoiceID;
    const char *SupplierInvoiceID;
    const char *DataInterchangeMethod;
    const char *InvoiceIssueDate;
    const char *InvoiceDate;
    const char *InvoiceTimestamp;
    const char *InvoicePayableAmount;

    xml = CkXml_Create();
    CkXml_putTag(xml,"soapenv:Envelope");
    CkXml_AddAttribute(xml,"xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/");
    CkXml_AddAttribute(xml,"xmlns","http://fina.hr/eracun/b2g/invoicewebservicecomponents/v0.1");
    CkXml_AddAttribute(xml,"xmlns:v0","http://fina.hr/eracun/b2g/sync/GetB2GOutgoingInvoiceList/v0.1");
    CkXml_AddAttribute(xml,"xmlns:b2gEracImpl","http://fina.hr/eracun/b2g/ws/erp/v0.1");
    CkXml_UpdateChildContent(xml,"soapenv:Header","");
    CkXml_UpdateChildContent(xml,"soapenv:Body|v0:GetB2GOutgoingInvoiceListMsg|HeaderSupplier|MessageID","string");
    CkXml_UpdateChildContent(xml,"soapenv:Body|v0:GetB2GOutgoingInvoiceListMsg|HeaderSupplier|SupplierID","string");
    CkXml_UpdateChildContent(xml,"soapenv:Body|v0:GetB2GOutgoingInvoiceListMsg|HeaderSupplier|AdditionalSupplierID","string");
    CkXml_UpdateChildContentInt(xml,"soapenv:Body|v0:GetB2GOutgoingInvoiceListMsg|HeaderSupplier|MessageType",123);
    CkXml_UpdateChildContent(xml,"soapenv:Body|v0:GetB2GOutgoingInvoiceListMsg|HeaderSupplier|MessageAttributes","string");
    CkXml_UpdateChildContent(xml,"soapenv:Body|v0:GetB2GOutgoingInvoiceListMsg|v0:Data|v0:B2GOutgoingInvoiceList|v0:DocumentCurrencyCode","true");
    CkXml_UpdateChildContent(xml,"soapenv:Body|v0:GetB2GOutgoingInvoiceListMsg|v0:Data|v0:B2GOutgoingInvoiceList|Filter","");

    // 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://prez.fina.hr/B2GFinaInvoiceWebService/services/B2GFinaInvoiceWebService";
    soapAction = "http://fina.hr/eracun/b2g/GetB2GOutgoingInvoiceList";
    //  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).

    Envelope_xmlns = CkXml_getAttrValue(responseXml,"xmlns");
    MessageID = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|MessageAck|MessageID");
    MessageAckID = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|MessageAck|MessageAckID");
    MessageType = CkXml_GetChildIntValue(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|MessageAck|MessageType");
    AckStatus = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|MessageAck|AckStatus");
    AckStatusCode = CkXml_GetChildIntValue(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|MessageAck|AckStatusCode");
    AckStatusText = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|MessageAck|AckStatusText");
    XMLStandard = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|DocumentType|XMLStandard");
    SpecificationIdentifier = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|DocumentType|SpecificationIdentifier");
    DocumentTypeCode = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|DocumentType|DocumentTypeCode");
    DocumentTypeText = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|DocumentType|DocumentTypeText");
    StatusCode = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|InvoiceStatus|StatusCode");
    CodeReason = CkXml_GetChildIntValue(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|InvoiceStatus|CodeReason");
    Note = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|InvoiceStatus|Note");
    PartialAmount = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|InvoiceStatus|PartialAmount");
    DocumentCurrencyCode = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|InvoiceStatus|DocumentCurrencyCode");
    BuyerID = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|*:BuyerID");
    AdditionalBuyerID = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|*:AdditionalBuyerID");
    BuyerRegistrationName = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|*:BuyerRegistrationName");
    BuyerCompanyID = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|*:BuyerCompanyID");
    InvoiceID = CkXml_GetChildIntValue(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|*:InvoiceID");
    SupplierInvoiceID = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|*:SupplierInvoiceID");
    DataInterchangeMethod = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|*:DataInterchangeMethod");
    InvoiceIssueDate = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|*:InvoiceIssueDate");
    InvoiceDate = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|*:InvoiceDate");
    InvoiceTimestamp = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|*:InvoiceTimestamp");
    InvoicePayableAmount = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|*:InvoicePayableAmount");
    DocumentCurrencyCode = CkXml_getChildContent(responseXml,"*:Body|*:GetB2GOutgoingInvoiceListAckMsg|*:B2GOutgoingInvoiceList|*:B2GOutgoingInvoice|*:DocumentCurrencyCode");


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

    }
Request XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://fina.hr/eracun/b2g/invoicewebservicecomponents/v0.1" xmlns:v0="http://fina.hr/eracun/b2g/sync/GetB2GOutgoingInvoiceList/v0.1" xmlns:b2gEracImpl="http://fina.hr/eracun/b2g/ws/erp/v0.1">
    <soapenv:Header/>
    <soapenv:Body>
        <v0:GetB2GOutgoingInvoiceListMsg>
            <HeaderSupplier>
                <MessageID>string</MessageID>
                <SupplierID>string</SupplierID>
                <AdditionalSupplierID>string</AdditionalSupplierID>
                <MessageType>123</MessageType>
                <MessageAttributes>string</MessageAttributes>
            </HeaderSupplier>
            <v0:Data>
                <v0:B2GOutgoingInvoiceList>
                    <v0:DocumentCurrencyCode>true</v0:DocumentCurrencyCode>
                    <Filter/>
                </v0:B2GOutgoingInvoiceList>
            </v0:Data>
        </v0:GetB2GOutgoingInvoiceListMsg>
    </soapenv:Body>
</soapenv:Envelope>
Response XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://fina.hr/eracun/b2g/invoicewebservicecomponents/v0.1" xmlns:v0="http://fina.hr/eracun/b2g/sync/GetB2GOutgoingInvoiceList/v0.1" xmlns:b2gEracImpl="http://fina.hr/eracun/b2g/ws/erp/v0.1">
    <soapenv:Header/>
    <soapenv:Body>
        <v0:GetB2GOutgoingInvoiceListAckMsg>
            <MessageAck>
                <MessageID>string</MessageID>
                <MessageAckID>string</MessageAckID>
                <MessageType>123</MessageType>
                <AckStatus>ACCEPTED</AckStatus>
                <AckStatusCode>1042</AckStatusCode>
                <AckStatusText>string</AckStatusText>
            </MessageAck>
            <v0:B2GOutgoingInvoiceList>
                <v0:B2GOutgoingInvoice>
                    <DocumentType>
                        <XMLStandard>UBL</XMLStandard>
                        <SpecificationIdentifier>urn:cen.eu:en16931:2017</SpecificationIdentifier>
                        <DocumentTypeCode>string</DocumentTypeCode>
                        <DocumentTypeText>string</DocumentTypeText>
                    </DocumentType>
                    <InvoiceStatus>
                        <StatusCode>RECEIVED</StatusCode>
                        <CodeReason>1042</CodeReason>
                        <Note>string</Note>
                        <PartialAmount>99.0</PartialAmount>
                        <DocumentCurrencyCode>string</DocumentCurrencyCode>
                    </InvoiceStatus>
                    <v0:BuyerID>string</v0:BuyerID>
                    <v0:AdditionalBuyerID>string</v0:AdditionalBuyerID>
                    <v0:BuyerRegistrationName>string</v0:BuyerRegistrationName>
                    <v0:BuyerCompanyID>string</v0:BuyerCompanyID>
                    <v0:InvoiceID>123</v0:InvoiceID>
                    <v0:SupplierInvoiceID>string</v0:SupplierInvoiceID>
                    <v0:DataInterchangeMethod>PKI</v0:DataInterchangeMethod>
                    <v0:InvoiceIssueDate>date</v0:InvoiceIssueDate>
                    <v0:InvoiceDate>date</v0:InvoiceDate>
                    <v0:InvoiceTimestamp>dateTime</v0:InvoiceTimestamp>
                    <v0:InvoicePayableAmount>99.0</v0:InvoicePayableAmount>
                    <v0:DocumentCurrencyCode>string</v0:DocumentCurrencyCode>
                </v0:B2GOutgoingInvoice>
            </v0:B2GOutgoingInvoiceList>
        </v0:GetB2GOutgoingInvoiceListAckMsg>
    </soapenv:Body>
</soapenv:Envelope>