SOAP WSDL Generate Code

DPDPackageObjServicesServiceSoapBinding / generatePackagesNumbersV4

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
require 'chilkat'

xml = Chilkat::CkXml.new()
xml.put_Tag("soapenv:Envelope")
xml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
xml.AddAttribute("xmlns:dpd","http://dpdservices.dpd.com.pl/")
xml.UpdateChildContent("soapenv:Header","")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:parcels|dpd:reference","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:parcels|dpd:weight","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:parcels|dpd:sizeX","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:parcels|dpd:sizeY","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:parcels|dpd:sizeZ","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:parcels|dpd:content","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:parcels|dpd:customerData1","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:parcels|dpd:customerData2","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:parcels|dpd:customerData3","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:payerType","RECEIVER")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:receiver|dpd:address","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:receiver|dpd:city","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:receiver|dpd:company","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:receiver|dpd:countryCode","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:receiver|dpd:email","string")
xml.UpdateChildContentInt("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:receiver|dpd:fid",1042)
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:receiver|dpd:name","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:receiver|dpd:phone","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:receiver|dpd:postalCode","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:ref1","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:ref2","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:ref3","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:reference","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:sender|dpd:address","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:sender|dpd:city","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:sender|dpd:company","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:sender|dpd:countryCode","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:sender|dpd:email","string")
xml.UpdateChildContentInt("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:sender|dpd:fid",1042)
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:sender|dpd:name","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:sender|dpd:phone","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:sender|dpd:postalCode","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:carryIn","")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:cod|dpd:amount","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:cod|dpd:currency","PLN")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:cud","")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:declaredValue|dpd:amount","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:declaredValue|dpd:currency","PLN")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:dedicatedDelivery","")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:documentsInternational","")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:dox","")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:dpdExpress","")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:dpdPickup|dpd:pudo","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:duty|dpd:amount","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:duty|dpd:currency","PLN")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:guarantee|dpd:type","TIME0930")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:guarantee|dpd:value","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:inPers","")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:pallet","")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:privPers","")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:rod","")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:selfCol|dpd:receiver","PRIV")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:tires","")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:services|dpd:tiresExport","")
xml.UpdateChildContentInt("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:openUMLFeV3|dpd:packages|dpd:thirdPartyFID",1042)
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:pkgNumsGenerationPolicyV1","STOP_ON_FIRST_ERROR")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:langCode","string")
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:authDataV1|dpd:login","string")
xml.UpdateChildContentInt("soapenv:Body|dpd:generatePackagesNumbersV4|dpd:authDataV1|dpd:masterFid",1042)
xml.UpdateChildContent("soapenv:Body|dpd:generatePackagesNumbersV4|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. 
xml.put_EmitXmlDecl(false)
soapRequestBody = xml.getXml()

endpoint = "https://dpdservicesdemo.dpd.com.pl/DPDPackageObjServicesService/DPDPackageObjServices"
soapAction = ""
#  For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
contentType = "text/xml"

http = Chilkat::CkHttp.new()

http.ClearHeaders()
http.SetRequestHeader("Content-Type",contentType)
http.SetRequestHeader("SOAPAction",soapAction)

# resp is a CkHttpResponse
resp = http.PostXml(endpoint,soapRequestBody,"utf-8")
if (http.get_LastMethodSuccess() == false)
    print http.lastErrorText() + "\n";
    print "Failed to send SOAP request." + "\n";
    exit
end

# Get the XML response body.
responseXml = Chilkat::CkXml.new()
resp.GetBodyXml(responseXml)

statusCode = resp.get_StatusCode()
print "response status code: " + statusCode.to_s() + "\n";

# If the status code does not indicate succcess, then show the response XML,
# which probably contains error information.
if (statusCode != 200)
    print responseXml.getXml() + "\n";
    exit
end

print responseXml.getXml() + "\n";

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

Status = responseXml.getChildContent("*:Body|*:generatePackagesNumbersV4Response|*:return|*:Status")
SessionId = responseXml.GetChildIntValue("*:Body|*:generatePackagesNumbersV4Response|*:return|*:SessionId")
BeginTime = responseXml.getChildContent("*:Body|*:generatePackagesNumbersV4Response|*:return|*:BeginTime")
EndTime = responseXml.getChildContent("*:Body|*:generatePackagesNumbersV4Response|*:return|*:EndTime")
Status = responseXml.getChildContent("*:Body|*:generatePackagesNumbersV4Response|*:return|*:Packages|*:Package|*:Status")
PackageId = responseXml.GetChildIntValue("*:Body|*:generatePackagesNumbersV4Response|*:return|*:Packages|*:Package|*:PackageId")
Reference = responseXml.getChildContent("*:Body|*:generatePackagesNumbersV4Response|*:return|*:Packages|*:Package|*:Reference")
ErrorId = responseXml.GetChildIntValue("*:Body|*:generatePackagesNumbersV4Response|*:return|*:Packages|*:Package|*:ValidationDetails|*:ValidationInfo|*:ErrorId")
ErrorCode = responseXml.getChildContent("*:Body|*:generatePackagesNumbersV4Response|*:return|*:Packages|*:Package|*:ValidationDetails|*:ValidationInfo|*:ErrorCode")
FieldNames = responseXml.getChildContent("*:Body|*:generatePackagesNumbersV4Response|*:return|*:Packages|*:Package|*:ValidationDetails|*:ValidationInfo|*:FieldNames")
Info = responseXml.getChildContent("*:Body|*:generatePackagesNumbersV4Response|*:return|*:Packages|*:Package|*:ValidationDetails|*:ValidationInfo|*:Info")
Status = responseXml.getChildContent("*:Body|*:generatePackagesNumbersV4Response|*:return|*:Packages|*:Package|*:Parcels|*:Parcel|*:Status")
ParcelId = responseXml.GetChildIntValue("*:Body|*:generatePackagesNumbersV4Response|*:return|*:Packages|*:Package|*:Parcels|*:Parcel|*:ParcelId")
Reference = responseXml.getChildContent("*:Body|*:generatePackagesNumbersV4Response|*:return|*:Packages|*:Package|*:Parcels|*:Parcel|*:Reference")
Waybill = responseXml.getChildContent("*:Body|*:generatePackagesNumbersV4Response|*:return|*:Packages|*:Package|*:Parcels|*:Parcel|*:Waybill")
ErrorId = responseXml.GetChildIntValue("*:Body|*:generatePackagesNumbersV4Response|*:return|*:Packages|*:Package|*:Parcels|*:Parcel|*:ValidationDetails|*:ValidationInfo|*:ErrorId")
ErrorCode = responseXml.getChildContent("*:Body|*:generatePackagesNumbersV4Response|*:return|*:Packages|*:Package|*:Parcels|*:Parcel|*:ValidationDetails|*:ValidationInfo|*:ErrorCode")
FieldNames = responseXml.getChildContent("*:Body|*:generatePackagesNumbersV4Response|*:return|*:Packages|*:Package|*:Parcels|*:Parcel|*:ValidationDetails|*:ValidationInfo|*:FieldNames")
Info = responseXml.getChildContent("*:Body|*:generatePackagesNumbersV4Response|*:return|*:Packages|*:Package|*:Parcels|*:Parcel|*:ValidationDetails|*:ValidationInfo|*:Info")
Request XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dpd="http://dpdservices.dpd.com.pl/">
    <soapenv:Header/>
    <soapenv:Body>
        <dpd:generatePackagesNumbersV4>
            <dpd:openUMLFeV3>
                <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:documentsInternational/>
                        <dpd:dox/>
                        <dpd:dpdExpress/>
                        <dpd:dpdPickup>
                            <dpd:pudo>string</dpd:pudo>
                        </dpd:dpdPickup>
                        <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:openUMLFeV3>
            <dpd:pkgNumsGenerationPolicyV1>STOP_ON_FIRST_ERROR</dpd:pkgNumsGenerationPolicyV1>
            <dpd:langCode>string</dpd:langCode>
            <dpd:authDataV1>
                <dpd:login>string</dpd:login>
                <dpd:masterFid>1042</dpd:masterFid>
                <dpd:password>string</dpd:password>
            </dpd:authDataV1>
        </dpd:generatePackagesNumbersV4>
    </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:generatePackagesNumbersV4Response>
            <dpd:return>
                <dpd:Status>string</dpd:Status>
                <dpd:SessionId>123456</dpd:SessionId>
                <dpd:BeginTime>dateTime</dpd:BeginTime>
                <dpd:EndTime>dateTime</dpd:EndTime>
                <dpd:Packages>
                    <dpd:Package>
                        <dpd:Status>string</dpd:Status>
                        <dpd:PackageId>123456</dpd:PackageId>
                        <dpd:Reference>string</dpd:Reference>
                        <dpd:ValidationDetails>
                            <dpd:ValidationInfo>
                                <dpd:ErrorId>1042</dpd:ErrorId>
                                <dpd:ErrorCode>string</dpd:ErrorCode>
                                <dpd:FieldNames>string</dpd:FieldNames>
                                <dpd:Info>string</dpd:Info>
                            </dpd:ValidationInfo>
                        </dpd:ValidationDetails>
                        <dpd:Parcels>
                            <dpd:Parcel>
                                <dpd:Status>string</dpd:Status>
                                <dpd:ParcelId>123456</dpd:ParcelId>
                                <dpd:Reference>string</dpd:Reference>
                                <dpd:Waybill>string</dpd:Waybill>
                                <dpd:ValidationDetails>
                                    <dpd:ValidationInfo>
                                        <dpd:ErrorId>1042</dpd:ErrorId>
                                        <dpd:ErrorCode>string</dpd:ErrorCode>
                                        <dpd:FieldNames>string</dpd:FieldNames>
                                        <dpd:Info>string</dpd:Info>
                                    </dpd:ValidationInfo>
                                </dpd:ValidationDetails>
                            </dpd:Parcel>
                        </dpd:Parcels>
                    </dpd:Package>
                </dpd:Packages>
            </dpd:return>
        </dpd:generatePackagesNumbersV4Response>
    </soapenv:Body>
</soapenv:Envelope>