SOAP WSDL Generate Code

ShipServiceSoapBinding / CCReserve

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
load ./chilkat.dll

set xml [new_CkXml]

CkXml_put_Tag $xml "soapenv:Envelope"
CkXml_AddAttribute $xml "xmlns:ns" "http://www.parcelforce.net/ws/ship/v14"
CkXml_AddAttribute $xml "xmlns:soapenv" "http://schemas.xmlsoap.org/soap/envelope/"
CkXml_UpdateChildContent $xml "soapenv:Header" ""
CkXml_UpdateChildContent $xml "soapenv:Body|ns:CCReserveRequest|ns:Authentication|ns:UserName" "string"
CkXml_UpdateChildContent $xml "soapenv:Body|ns:CCReserveRequest|ns:Authentication|ns:Password" "string"
CkXml_UpdateChildContent $xml "soapenv:Body|ns:CCReserveRequest|ns:BookingReference" "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. 
CkXml_put_EmitXmlDecl $xml 0
set soapRequestBody [CkXml_getXml $xml]

set endpoint "https://expresslink-uat1.neopost-id.com/ws/"
set soapAction "CCReserve"
#  For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
set contentType "text/xml"

set http [new_CkHttp]

CkHttp_ClearHeaders $http
CkHttp_SetRequestHeader $http "Content-Type" $contentType
CkHttp_SetRequestHeader $http "SOAPAction" $soapAction

# resp is a CkHttpResponse
set resp [CkHttp_PostXml $http $endpoint $soapRequestBody "utf-8"]
if {[CkHttp_get_LastMethodSuccess $http] == 0} then {
    puts [CkHttp_lastErrorText $http]
    puts "Failed to send SOAP request."
    delete_CkXml $xml
    delete_CkHttp $http
    exit
}

# Get the XML response body.
set responseXml [new_CkXml]

CkHttpResponse_GetBodyXml $resp $responseXml

set statusCode [CkHttpResponse_get_StatusCode $resp]
puts "response status code: $statusCode"

delete_CkHttpResponse $resp

# If the status code does not indicate succcess, then show the response XML,
# which probably contains error information.
if {$statusCode != 200} then {
    puts [CkXml_getXml $responseXml]
    delete_CkXml $xml
    delete_CkHttp $http
    delete_CkXml $responseXml
    exit
}

puts [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).

set Code [CkXml_GetChildIntValue $responseXml "*:Body|*:CCReserveReply|*:Alerts|*:Alert|*:Code"]
set Message [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:Alerts|*:Alert|*:Message"]
set v_Type [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:Alerts|*:Alert|*:Type"]
set PostOfficeID [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:PostOfficeID"]
set Business [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:Business"]
set AddressLine1 [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:Address|*:AddressLine1"]
set AddressLine2 [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:Address|*:AddressLine2"]
set AddressLine3 [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:Address|*:AddressLine3"]
set Town [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:Address|*:Town"]
set Postcode [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:Address|*:Postcode"]
set Country [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:Address|*:Country"]
set Open [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Mon|*:Hours|*:Open"]
set Close [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Mon|*:Hours|*:Close"]
set CloseLunch [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Mon|*:Hours|*:CloseLunch"]
set AfterLunchOpening [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Mon|*:Hours|*:AfterLunchOpening"]
set Open [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Tue|*:Hours|*:Open"]
set Close [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Tue|*:Hours|*:Close"]
set CloseLunch [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Tue|*:Hours|*:CloseLunch"]
set AfterLunchOpening [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Tue|*:Hours|*:AfterLunchOpening"]
set Open [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Wed|*:Hours|*:Open"]
set Close [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Wed|*:Hours|*:Close"]
set CloseLunch [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Wed|*:Hours|*:CloseLunch"]
set AfterLunchOpening [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Wed|*:Hours|*:AfterLunchOpening"]
set Open [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Thu|*:Hours|*:Open"]
set Close [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Thu|*:Hours|*:Close"]
set CloseLunch [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Thu|*:Hours|*:CloseLunch"]
set AfterLunchOpening [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Thu|*:Hours|*:AfterLunchOpening"]
set Open [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Fri|*:Hours|*:Open"]
set Close [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Fri|*:Hours|*:Close"]
set CloseLunch [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Fri|*:Hours|*:CloseLunch"]
set AfterLunchOpening [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Fri|*:Hours|*:AfterLunchOpening"]
set Open [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Sat|*:Hours|*:Open"]
set Close [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Sat|*:Hours|*:Close"]
set CloseLunch [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Sat|*:Hours|*:CloseLunch"]
set AfterLunchOpening [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Sat|*:Hours|*:AfterLunchOpening"]
set Open [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Sun|*:Hours|*:Open"]
set Close [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Sun|*:Hours|*:Close"]
set CloseLunch [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Sun|*:Hours|*:CloseLunch"]
set AfterLunchOpening [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Sun|*:Hours|*:AfterLunchOpening"]
set Open [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:BankHol|*:Hours|*:Open"]
set Close [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:BankHol|*:Hours|*:Close"]
set CloseLunch [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:BankHol|*:Hours|*:CloseLunch"]
set AfterLunchOpening [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:BankHol|*:Hours|*:AfterLunchOpening"]
set Distance [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:Distance"]
set Availability [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:Availability"]
set Longitude [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:Position|*:Longitude"]
set Latitude [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:Position|*:Latitude"]
set BookingReference [CkXml_getChildContent $responseXml "*:Body|*:CCReserveReply|*:PostOffice|*:BookingReference"]

delete_CkXml $xml
delete_CkHttp $http
delete_CkXml $responseXml
Request XML
<soapenv:Envelope xmlns:ns="http://www.parcelforce.net/ws/ship/v14" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header/>
    <soapenv:Body>
        <ns:CCReserveRequest>
            <ns:Authentication>
                <ns:UserName>string</ns:UserName>
                <ns:Password>string</ns:Password>
            </ns:Authentication>
            <ns:BookingReference>string</ns:BookingReference>
        </ns:CCReserveRequest>
    </soapenv:Body>
</soapenv:Envelope>
Response XML
<soapenv:Envelope xmlns:ns="http://www.parcelforce.net/ws/ship/v14" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header/>
    <soapenv:Body>
        <ns:CCReserveReply>
            <ns:Alerts>
                <ns:Alert>
                    <ns:Code>123</ns:Code>
                    <ns:Message>string</ns:Message>
                    <ns:Type>ERROR</ns:Type>
                </ns:Alert>
            </ns:Alerts>
            <ns:PostOffice>
                <ns:PostOfficeID>string</ns:PostOfficeID>
                <ns:Business>string</ns:Business>
                <ns:Address>
                    <ns:AddressLine1>string</ns:AddressLine1>
                    <ns:AddressLine2>string</ns:AddressLine2>
                    <ns:AddressLine3>string</ns:AddressLine3>
                    <ns:Town>string</ns:Town>
                    <ns:Postcode>string</ns:Postcode>
                    <ns:Country>string</ns:Country>
                </ns:Address>
                <ns:OpeningHours>
                    <ns:Mon>
                        <ns:Hours>
                            <ns:Open>string</ns:Open>
                            <ns:Close>string</ns:Close>
                            <ns:CloseLunch>string</ns:CloseLunch>
                            <ns:AfterLunchOpening>string</ns:AfterLunchOpening>
                        </ns:Hours>
                    </ns:Mon>
                    <ns:Tue>
                        <ns:Hours>
                            <ns:Open>string</ns:Open>
                            <ns:Close>string</ns:Close>
                            <ns:CloseLunch>string</ns:CloseLunch>
                            <ns:AfterLunchOpening>string</ns:AfterLunchOpening>
                        </ns:Hours>
                    </ns:Tue>
                    <ns:Wed>
                        <ns:Hours>
                            <ns:Open>string</ns:Open>
                            <ns:Close>string</ns:Close>
                            <ns:CloseLunch>string</ns:CloseLunch>
                            <ns:AfterLunchOpening>string</ns:AfterLunchOpening>
                        </ns:Hours>
                    </ns:Wed>
                    <ns:Thu>
                        <ns:Hours>
                            <ns:Open>string</ns:Open>
                            <ns:Close>string</ns:Close>
                            <ns:CloseLunch>string</ns:CloseLunch>
                            <ns:AfterLunchOpening>string</ns:AfterLunchOpening>
                        </ns:Hours>
                    </ns:Thu>
                    <ns:Fri>
                        <ns:Hours>
                            <ns:Open>string</ns:Open>
                            <ns:Close>string</ns:Close>
                            <ns:CloseLunch>string</ns:CloseLunch>
                            <ns:AfterLunchOpening>string</ns:AfterLunchOpening>
                        </ns:Hours>
                    </ns:Fri>
                    <ns:Sat>
                        <ns:Hours>
                            <ns:Open>string</ns:Open>
                            <ns:Close>string</ns:Close>
                            <ns:CloseLunch>string</ns:CloseLunch>
                            <ns:AfterLunchOpening>string</ns:AfterLunchOpening>
                        </ns:Hours>
                    </ns:Sat>
                    <ns:Sun>
                        <ns:Hours>
                            <ns:Open>string</ns:Open>
                            <ns:Close>string</ns:Close>
                            <ns:CloseLunch>string</ns:CloseLunch>
                            <ns:AfterLunchOpening>string</ns:AfterLunchOpening>
                        </ns:Hours>
                    </ns:Sun>
                    <ns:BankHol>
                        <ns:Hours>
                            <ns:Open>string</ns:Open>
                            <ns:Close>string</ns:Close>
                            <ns:CloseLunch>string</ns:CloseLunch>
                            <ns:AfterLunchOpening>string</ns:AfterLunchOpening>
                        </ns:Hours>
                    </ns:BankHol>
                </ns:OpeningHours>
                <ns:Distance>99.0</ns:Distance>
                <ns:Availability>true</ns:Availability>
                <ns:Position>
                    <ns:Longitude>99.0</ns:Longitude>
                    <ns:Latitude>99.0</ns:Latitude>
                </ns:Position>
                <ns:BookingReference>string</ns:BookingReference>
            </ns:PostOffice>
        </ns:CCReserveReply>
    </soapenv:Body>
</soapenv:Envelope>