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
$oXml = ObjCreate("Chilkat_9_5_0.Xml")
$oXml.Tag = "soapenv:Envelope"
$oXml.AddAttribute("xmlns:ns","http://www.parcelforce.net/ws/ship/v14")
$oXml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
$oXml.UpdateChildContent "soapenv:Header",""
$oXml.UpdateChildContent "soapenv:Body|ns:CCReserveRequest|ns:Authentication|ns:UserName","string"
$oXml.UpdateChildContent "soapenv:Body|ns:CCReserveRequest|ns:Authentication|ns:Password","string"
$oXml.UpdateChildContent "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. 
$oXml.EmitXmlDecl = False
Local $soapRequestBody = $oXml.GetXml()

Local $sEndpoint = "https://expresslink-uat1.neopost-id.com/ws/"
Local $soapAction = "CCReserve"
;  For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
Local $sContentType = "text/xml"

$oHttp = ObjCreate("Chilkat_9_5_0.Http")

$oHttp.ClearHeaders 
$oHttp.SetRequestHeader "Content-Type",$sContentType
$oHttp.SetRequestHeader "SOAPAction",$soapAction

Local $oResp = $oHttp.PostXml($sEndpoint,$soapRequestBody,"utf-8")
If ($oHttp.LastMethodSuccess = False) Then
    ConsoleWrite($oHttp.LastErrorText & @CRLF)
    ConsoleWrite("Failed to send SOAP request." & @CRLF)
    Exit
EndIf

; Get the XML response body.
$oResponseXml = ObjCreate("Chilkat_9_5_0.Xml")
$oResp.GetBodyXml($oResponseXml)

Local $iStatusCode = $oResp.StatusCode
ConsoleWrite("response status code: " & $iStatusCode & @CRLF)

; If the status code does not indicate succcess, then show the response XML,
; which probably contains error information.
If ($iStatusCode <> 200) Then
    ConsoleWrite($oResponseXml.GetXml() & @CRLF)
    Exit
EndIf

ConsoleWrite($oResponseXml.GetXml() & @CRLF)

; 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).

Local $iCode = $oResponseXml.GetChildIntValue("*:Body|*:CCReserveReply|*:Alerts|*:Alert|*:Code")
Local $sMessage = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:Alerts|*:Alert|*:Message")
Local $sV_Type = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:Alerts|*:Alert|*:Type")
Local $sPostOfficeID = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:PostOfficeID")
Local $sBusiness = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:Business")
Local $sAddressLine1 = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:Address|*:AddressLine1")
Local $sAddressLine2 = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:Address|*:AddressLine2")
Local $sAddressLine3 = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:Address|*:AddressLine3")
Local $sTown = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:Address|*:Town")
Local $sPostcode = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:Address|*:Postcode")
Local $sCountry = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:Address|*:Country")
Local $sOpen = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Mon|*:Hours|*:Open")
Local $sClose = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Mon|*:Hours|*:Close")
Local $sCloseLunch = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Mon|*:Hours|*:CloseLunch")
Local $sAfterLunchOpening = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Mon|*:Hours|*:AfterLunchOpening")
$sOpen = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Tue|*:Hours|*:Open")
$sClose = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Tue|*:Hours|*:Close")
$sCloseLunch = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Tue|*:Hours|*:CloseLunch")
$sAfterLunchOpening = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Tue|*:Hours|*:AfterLunchOpening")
$sOpen = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Wed|*:Hours|*:Open")
$sClose = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Wed|*:Hours|*:Close")
$sCloseLunch = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Wed|*:Hours|*:CloseLunch")
$sAfterLunchOpening = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Wed|*:Hours|*:AfterLunchOpening")
$sOpen = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Thu|*:Hours|*:Open")
$sClose = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Thu|*:Hours|*:Close")
$sCloseLunch = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Thu|*:Hours|*:CloseLunch")
$sAfterLunchOpening = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Thu|*:Hours|*:AfterLunchOpening")
$sOpen = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Fri|*:Hours|*:Open")
$sClose = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Fri|*:Hours|*:Close")
$sCloseLunch = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Fri|*:Hours|*:CloseLunch")
$sAfterLunchOpening = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Fri|*:Hours|*:AfterLunchOpening")
$sOpen = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Sat|*:Hours|*:Open")
$sClose = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Sat|*:Hours|*:Close")
$sCloseLunch = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Sat|*:Hours|*:CloseLunch")
$sAfterLunchOpening = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Sat|*:Hours|*:AfterLunchOpening")
$sOpen = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Sun|*:Hours|*:Open")
$sClose = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Sun|*:Hours|*:Close")
$sCloseLunch = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Sun|*:Hours|*:CloseLunch")
$sAfterLunchOpening = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:Sun|*:Hours|*:AfterLunchOpening")
$sOpen = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:BankHol|*:Hours|*:Open")
$sClose = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:BankHol|*:Hours|*:Close")
$sCloseLunch = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:BankHol|*:Hours|*:CloseLunch")
$sAfterLunchOpening = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:OpeningHours|*:BankHol|*:Hours|*:AfterLunchOpening")
Local $sDistance = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:Distance")
Local $sAvailability = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:Availability")
Local $sLongitude = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:Position|*:Longitude")
Local $sLatitude = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:Position|*:Latitude")
Local $sBookingReference = $oResponseXml.GetChildContent("*:Body|*:CCReserveReply|*:PostOffice|*:BookingReference")
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>