SOAP WSDL Generate Code

DPDPackageObjServicesServiceSoapBinding / generateSpedLabelsV3

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:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
$oXml.AddAttribute("xmlns:dpd","http://dpdservices.dpd.com.pl/")
$oXml.UpdateChildContent "soapenv:Header",""
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:dpdServicesParamsV1|dpd:documentId","string"
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:dpdServicesParamsV1|dpd:pickupAddress|dpd:address","string"
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:dpdServicesParamsV1|dpd:pickupAddress|dpd:city","string"
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:dpdServicesParamsV1|dpd:pickupAddress|dpd:company","string"
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:dpdServicesParamsV1|dpd:pickupAddress|dpd:countryCode","string"
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:dpdServicesParamsV1|dpd:pickupAddress|dpd:email","string"
$oXml.UpdateChildContentInt "soapenv:Body|dpd:generateSpedLabelsV3|dpd:dpdServicesParamsV1|dpd:pickupAddress|dpd:fid",1042
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:dpdServicesParamsV1|dpd:pickupAddress|dpd:name","string"
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:dpdServicesParamsV1|dpd:pickupAddress|dpd:phone","string"
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:dpdServicesParamsV1|dpd:pickupAddress|dpd:postalCode","string"
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:dpdServicesParamsV1|dpd:policy","STOP_ON_FIRST_ERROR"
$oXml.UpdateChildContentInt "soapenv:Body|dpd:generateSpedLabelsV3|dpd:dpdServicesParamsV1|dpd:session|dpd:packages|dpd:packageId",123456
$oXml.UpdateChildContentInt "soapenv:Body|dpd:generateSpedLabelsV3|dpd:dpdServicesParamsV1|dpd:session|dpd:packages|dpd:parcels|dpd:parcelId",123456
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:dpdServicesParamsV1|dpd:session|dpd:packages|dpd:parcels|dpd:reference","string"
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:dpdServicesParamsV1|dpd:session|dpd:packages|dpd:parcels|dpd:waybill","string"
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:dpdServicesParamsV1|dpd:session|dpd:packages|dpd:reference","string"
$oXml.UpdateChildContentInt "soapenv:Body|dpd:generateSpedLabelsV3|dpd:dpdServicesParamsV1|dpd:session|dpd:sessionId",123456
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:dpdServicesParamsV1|dpd:session|dpd:sessionType","DOMESTIC"
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:outputDocFormatV1","PDF"
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:outputDocPageFormatV1","A4"
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:outputLabelType","BIC3"
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:labelVariant","string"
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:authDataV1|dpd:login","string"
$oXml.UpdateChildContentInt "soapenv:Body|dpd:generateSpedLabelsV3|dpd:authDataV1|dpd:masterFid",1042
$oXml.UpdateChildContent "soapenv:Body|dpd:generateSpedLabelsV3|dpd:authDataV1|dpd:password","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://dpdservicesdemo.dpd.com.pl/DPDPackageObjServicesService/DPDPackageObjServices"
Local $soapAction = ""
;  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 $sDocumentData = $oResponseXml.GetChildContent("*:Body|*:generateSpedLabelsV3Response|*:return|*:documentData")
Local $sDocumentId = $oResponseXml.GetChildContent("*:Body|*:generateSpedLabelsV3Response|*:return|*:documentId")
Local $iPackageId = $oResponseXml.GetChildIntValue("*:Body|*:generateSpedLabelsV3Response|*:return|*:session|*:packages|*:packageId")
Local $iParcelId = $oResponseXml.GetChildIntValue("*:Body|*:generateSpedLabelsV3Response|*:return|*:session|*:packages|*:parcels|*:parcelId")
Local $sReference = $oResponseXml.GetChildContent("*:Body|*:generateSpedLabelsV3Response|*:return|*:session|*:packages|*:parcels|*:reference")
Local $sDescription = $oResponseXml.GetChildContent("*:Body|*:generateSpedLabelsV3Response|*:return|*:session|*:packages|*:parcels|*:statusInfo|*:description")
Local $status = $oResponseXml.GetChildContent("*:Body|*:generateSpedLabelsV3Response|*:return|*:session|*:packages|*:parcels|*:statusInfo|*:status")
Local $sWaybill = $oResponseXml.GetChildContent("*:Body|*:generateSpedLabelsV3Response|*:return|*:session|*:packages|*:parcels|*:waybill")
$sReference = $oResponseXml.GetChildContent("*:Body|*:generateSpedLabelsV3Response|*:return|*:session|*:packages|*:reference")
$sDescription = $oResponseXml.GetChildContent("*:Body|*:generateSpedLabelsV3Response|*:return|*:session|*:packages|*:statusInfo|*:description")
$status = $oResponseXml.GetChildContent("*:Body|*:generateSpedLabelsV3Response|*:return|*:session|*:packages|*:statusInfo|*:status")
Local $iSessionId = $oResponseXml.GetChildIntValue("*:Body|*:generateSpedLabelsV3Response|*:return|*:session|*:sessionId")
$sDescription = $oResponseXml.GetChildContent("*:Body|*:generateSpedLabelsV3Response|*:return|*:session|*:statusInfo|*:description")
$status = $oResponseXml.GetChildContent("*:Body|*:generateSpedLabelsV3Response|*:return|*:session|*:statusInfo|*:status")
Request XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dpd="http://dpdservices.dpd.com.pl/">
    <soapenv:Header/>
    <soapenv:Body>
        <dpd:generateSpedLabelsV3>
            <dpd:dpdServicesParamsV1>
                <dpd:documentId>string</dpd:documentId>
                <dpd:pickupAddress>
                    <dpd:address>string</dpd:address>
                    <dpd:city>string</dpd:city>
                    <dpd:company>string</dpd:company>
                    <dpd:countryCode>string</dpd:countryCode>
                    <dpd:email>string</dpd:email>
                    <dpd:fid>1042</dpd:fid>
                    <dpd:name>string</dpd:name>
                    <dpd:phone>string</dpd:phone>
                    <dpd:postalCode>string</dpd:postalCode>
                </dpd:pickupAddress>
                <dpd:policy>STOP_ON_FIRST_ERROR</dpd:policy>
                <dpd:session>
                    <dpd:packages>
                        <dpd:packageId>123456</dpd:packageId>
                        <dpd:parcels>
                            <dpd:parcelId>123456</dpd:parcelId>
                            <dpd:reference>string</dpd:reference>
                            <dpd:waybill>string</dpd:waybill>
                        </dpd:parcels>
                        <dpd:reference>string</dpd:reference>
                    </dpd:packages>
                    <dpd:sessionId>123456</dpd:sessionId>
                    <dpd:sessionType>DOMESTIC</dpd:sessionType>
                </dpd:session>
            </dpd:dpdServicesParamsV1>
            <dpd:outputDocFormatV1>PDF</dpd:outputDocFormatV1>
            <dpd:outputDocPageFormatV1>A4</dpd:outputDocPageFormatV1>
            <dpd:outputLabelType>BIC3</dpd:outputLabelType>
            <dpd:labelVariant>string</dpd:labelVariant>
            <dpd:authDataV1>
                <dpd:login>string</dpd:login>
                <dpd:masterFid>1042</dpd:masterFid>
                <dpd:password>string</dpd:password>
            </dpd:authDataV1>
        </dpd:generateSpedLabelsV3>
    </soapenv:Body>
</soapenv:Envelope>
Response XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dpd="http://dpdservices.dpd.com.pl/">
    <soapenv:Header/>
    <soapenv:Body>
        <dpd:generateSpedLabelsV3Response>
            <dpd:return>
                <dpd:documentData>BqozVXeZZg==</dpd:documentData>
                <dpd:documentId>string</dpd:documentId>
                <dpd:session>
                    <dpd:packages>
                        <dpd:packageId>123456</dpd:packageId>
                        <dpd:parcels>
                            <dpd:parcelId>123456</dpd:parcelId>
                            <dpd:reference>string</dpd:reference>
                            <dpd:statusInfo>
                                <dpd:description>string</dpd:description>
                                <dpd:status>OK</dpd:status>
                            </dpd:statusInfo>
                            <dpd:waybill>string</dpd:waybill>
                        </dpd:parcels>
                        <dpd:reference>string</dpd:reference>
                        <dpd:statusInfo>
                            <dpd:description>string</dpd:description>
                            <dpd:status>OK</dpd:status>
                        </dpd:statusInfo>
                    </dpd:packages>
                    <dpd:sessionId>123456</dpd:sessionId>
                    <dpd:statusInfo>
                        <dpd:description>string</dpd:description>
                        <dpd:status>OK</dpd:status>
                    </dpd:statusInfo>
                </dpd:session>
            </dpd:return>
        </dpd:generateSpedLabelsV3Response>
    </soapenv:Body>
</soapenv:Envelope>