SOAP WSDL Generate Code

DPDPackageObjServicesServiceSoapBinding / generatePackagesNumbersV1

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
LOCAL loXml
LOCAL lcSoapRequestBody
LOCAL lcEndpoint
LOCAL lcSoapAction
LOCAL lcContentType
LOCAL loHttp
LOCAL loResp
LOCAL loResponseXml
LOCAL lnStatusCode
LOCAL lcBeginTime
LOCAL lcEndTime
LOCAL lcFieldName
LOCAL lcInfo
LOCAL lcStatus
LOCAL lnPackageId
LOCAL lnParcelId
LOCAL lcReference
LOCAL lcWaybill
LOCAL lnSessionId

loXml = CreateObject('Chilkat_9_5_0.Xml')
loXml.Tag = "soapenv:Envelope"
loXml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
loXml.AddAttribute("xmlns:dpd","http://dpdservices.dpd.com.pl/")
loXml.UpdateChildContent("soapenv:Header","")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:parcels|dpd:reference","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:parcels|dpd:weight","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:parcels|dpd:sizeX","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:parcels|dpd:sizeY","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:parcels|dpd:sizeZ","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:parcels|dpd:content","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:parcels|dpd:customerData1","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:parcels|dpd:customerData2","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:parcels|dpd:customerData3","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:payerType","RECEIVER")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:receiver|dpd:address","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:receiver|dpd:city","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:receiver|dpd:company","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:receiver|dpd:countryCode","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:receiver|dpd:email","string")
loXml.UpdateChildContentInt("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:receiver|dpd:fid",1042)
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:receiver|dpd:name","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:receiver|dpd:phone","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:receiver|dpd:postalCode","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:ref1","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:ref2","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:ref3","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:reference","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:sender|dpd:address","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:sender|dpd:city","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:sender|dpd:company","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:sender|dpd:countryCode","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:sender|dpd:email","string")
loXml.UpdateChildContentInt("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:sender|dpd:fid",1042)
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:sender|dpd:name","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:sender|dpd:phone","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:sender|dpd:postalCode","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:carryIn","")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:cod|dpd:amount","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:cod|dpd:currency","PLN")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:cud","")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:declaredValue|dpd:amount","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:declaredValue|dpd:currency","PLN")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:dedicatedDelivery","")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:dox","")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:duty|dpd:amount","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:duty|dpd:currency","PLN")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:guarantee|dpd:type","TIME0930")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:guarantee|dpd:value","string")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:inPers","")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:pallet","")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:privPers","")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:rod","")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:selfCol|dpd:receiver","PRIV")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:tires","")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:services|dpd:tiresExport","")
loXml.UpdateChildContentInt("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:openUMLV1|dpd:packages|dpd:thirdPartyFID",1042)
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:pkgNumsGenerationPolicyV1","STOP_ON_FIRST_ERROR")
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:authDataV1|dpd:login","string")
loXml.UpdateChildContentInt("soapenv:Body|dpd:generatePackagesNumbersV1|dpd:authDataV1|dpd:masterFid",1042)
loXml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV1|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. 
loXml.EmitXmlDecl = 0
lcSoapRequestBody = loXml.GetXml()

lcEndpoint = "https://dpdservicesdemo.dpd.com.pl/DPDPackageObjServicesService/DPDPackageObjServices"
lcSoapAction = ""
*  For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
lcContentType = "text/xml"

loHttp = CreateObject('Chilkat_9_5_0.Http')

loHttp.ClearHeaders()
loHttp.SetRequestHeader("Content-Type",lcContentType)
loHttp.SetRequestHeader("SOAPAction",lcSoapAction)

loResp = loHttp.PostXml(lcEndpoint,lcSoapRequestBody,"utf-8")
IF (loHttp.LastMethodSuccess = 0) THEN
    ? loHttp.LastErrorText
    ? "Failed to send SOAP request."
    RELEASE loXml
    RELEASE loHttp
    CANCEL
ENDIF

* Get the XML response body.
loResponseXml = CreateObject('Chilkat_9_5_0.Xml')
loResp.GetBodyXml(loResponseXml)

lnStatusCode = loResp.StatusCode
? "response status code: " + STR(lnStatusCode)

RELEASE loResp

* If the status code does not indicate succcess, then show the response XML,
* which probably contains error information.
IF (lnStatusCode <> 200) THEN
    ? loResponseXml.GetXml()
    RELEASE loXml
    RELEASE loHttp
    RELEASE loResponseXml
    CANCEL
ENDIF

? loResponseXml.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).

lcBeginTime = loResponseXml.GetChildContent("*:Body|*:generatePackagesNumbersV1Response|*:return|*:beginTime")
lcEndTime = loResponseXml.GetChildContent("*:Body|*:generatePackagesNumbersV1Response|*:return|*:endTime")
lcFieldName = loResponseXml.GetChildContent("*:Body|*:generatePackagesNumbersV1Response|*:return|*:packages|*:invalidFields|*:fieldName")
lcInfo = loResponseXml.GetChildContent("*:Body|*:generatePackagesNumbersV1Response|*:return|*:packages|*:invalidFields|*:info")
lcStatus = loResponseXml.GetChildContent("*:Body|*:generatePackagesNumbersV1Response|*:return|*:packages|*:invalidFields|*:status")
lnPackageId = loResponseXml.GetChildIntValue("*:Body|*:generatePackagesNumbersV1Response|*:return|*:packages|*:packageId")
lnParcelId = loResponseXml.GetChildIntValue("*:Body|*:generatePackagesNumbersV1Response|*:return|*:packages|*:parcels|*:parcelId")
lcReference = loResponseXml.GetChildContent("*:Body|*:generatePackagesNumbersV1Response|*:return|*:packages|*:parcels|*:reference")
lcStatus = loResponseXml.GetChildContent("*:Body|*:generatePackagesNumbersV1Response|*:return|*:packages|*:parcels|*:status")
lcWaybill = loResponseXml.GetChildContent("*:Body|*:generatePackagesNumbersV1Response|*:return|*:packages|*:parcels|*:waybill")
lcReference = loResponseXml.GetChildContent("*:Body|*:generatePackagesNumbersV1Response|*:return|*:packages|*:reference")
lcStatus = loResponseXml.GetChildContent("*:Body|*:generatePackagesNumbersV1Response|*:return|*:packages|*:status")
lnSessionId = loResponseXml.GetChildIntValue("*:Body|*:generatePackagesNumbersV1Response|*:return|*:sessionId")
lcStatus = loResponseXml.GetChildContent("*:Body|*:generatePackagesNumbersV1Response|*:return|*:status")

RELEASE loXml
RELEASE loHttp
RELEASE loResponseXml

Request XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dpd="http://dpdservices.dpd.com.pl/">
    <soapenv:Header/>
    <soapenv:Body>
        <dpd:generatePackagesNumbersV1>
            <dpd:openUMLV1>
                <dpd:packages>
                    <dpd:parcels>
                        <dpd:reference>string</dpd:reference>
                        <dpd:weight>string</dpd:weight>
                        <dpd:sizeX>string</dpd:sizeX>
                        <dpd:sizeY>string</dpd:sizeY>
                        <dpd:sizeZ>string</dpd:sizeZ>
                        <dpd:content>string</dpd:content>
                        <dpd:customerData1>string</dpd:customerData1>
                        <dpd:customerData2>string</dpd:customerData2>
                        <dpd:customerData3>string</dpd:customerData3>
                    </dpd:parcels>
                    <dpd:payerType>RECEIVER</dpd:payerType>
                    <dpd:receiver>
                        <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:receiver>
                    <dpd:ref1>string</dpd:ref1>
                    <dpd:ref2>string</dpd:ref2>
                    <dpd:ref3>string</dpd:ref3>
                    <dpd:reference>string</dpd:reference>
                    <dpd:sender>
                        <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:sender>
                    <dpd:services>
                        <dpd:carryIn/>
                        <dpd:cod>
                            <dpd:amount>string</dpd:amount>
                            <dpd:currency>PLN</dpd:currency>
                        </dpd:cod>
                        <dpd:cud/>
                        <dpd:declaredValue>
                            <dpd:amount>string</dpd:amount>
                            <dpd:currency>PLN</dpd:currency>
                        </dpd:declaredValue>
                        <dpd:dedicatedDelivery/>
                        <dpd:dox/>
                        <dpd:duty>
                            <dpd:amount>string</dpd:amount>
                            <dpd:currency>PLN</dpd:currency>
                        </dpd:duty>
                        <dpd:guarantee>
                            <dpd:type>TIME0930</dpd:type>
                            <dpd:value>string</dpd:value>
                        </dpd:guarantee>
                        <dpd:inPers/>
                        <dpd:pallet/>
                        <dpd:privPers/>
                        <dpd:rod/>
                        <dpd:selfCol>
                            <dpd:receiver>PRIV</dpd:receiver>
                        </dpd:selfCol>
                        <dpd:tires/>
                        <dpd:tiresExport/>
                    </dpd:services>
                    <dpd:thirdPartyFID>1042</dpd:thirdPartyFID>
                </dpd:packages>
            </dpd:openUMLV1>
            <dpd:pkgNumsGenerationPolicyV1>STOP_ON_FIRST_ERROR</dpd:pkgNumsGenerationPolicyV1>
            <dpd:authDataV1>
                <dpd:login>string</dpd:login>
                <dpd:masterFid>1042</dpd:masterFid>
                <dpd:password>string</dpd:password>
            </dpd:authDataV1>
        </dpd:generatePackagesNumbersV1>
    </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:generatePackagesNumbersV1Response>
            <dpd:return>
                <dpd:beginTime>dateTime</dpd:beginTime>
                <dpd:endTime>dateTime</dpd:endTime>
                <dpd:packages>
                    <dpd:invalidFields>
                        <dpd:fieldName>string</dpd:fieldName>
                        <dpd:info>string</dpd:info>
                        <dpd:status>OK</dpd:status>
                    </dpd:invalidFields>
                    <dpd:packageId>123456</dpd:packageId>
                    <dpd:parcels>
                        <dpd:parcelId>123456</dpd:parcelId>
                        <dpd:reference>string</dpd:reference>
                        <dpd:status>OK</dpd:status>
                        <dpd:waybill>string</dpd:waybill>
                    </dpd:parcels>
                    <dpd:reference>string</dpd:reference>
                    <dpd:status>OK</dpd:status>
                </dpd:packages>
                <dpd:sessionId>123456</dpd:sessionId>
                <dpd:status>OK</dpd:status>
            </dpd:return>
        </dpd:generatePackagesNumbersV1Response>
    </soapenv:Body>
</soapenv:Envelope>