LOCAL loXml
LOCAL lcSoapRequestBody
LOCAL lcEndpoint
LOCAL lcSoapAction
LOCAL lcContentType
LOCAL loHttp
LOCAL loResp
LOCAL loResponseXml
LOCAL lnStatusCode
LOCAL lcId
LOCAL lcIsAddressPossible
LOCAL lcIsImagePossible
LOCAL lcName
LOCAL lcDescription
LOCAL lcPageType
LOCAL x
LOCAL y
LOCAL lcOrientation
LOCAL lcLabelX
LOCAL lcLabelY
LOCAL lcTop
LOCAL lcBottom
LOCAL lcLeft
LOCAL lcRight
loXml = CreateObject('Chilkat.Xml')
loXml.Tag = "soapenv:Envelope"
loXml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
loXml.AddAttribute("xmlns:v3","http://oneclickforapp.dpag.de/V3")
loXml.UpdateChildContent("soapenv:Header","")
loXml.UpdateChildContent("soapenv:Body|v3:RetrievePageFormatsRequest","")
* 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://internetmarke.deutschepost.de/OneClickForApp/OneClickForAppServiceV3/OneClickForAppV3EJB"
lcSoapAction = " "* For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
lcContentType = "text/xml"
loHttp = CreateObject('Chilkat.Http')
loHttp.ClearHeaders()
loHttp.SetRequestHeader("Content-Type",lcContentType)
loHttp.SetRequestHeader("SOAPAction",lcSoapAction)
loResp = CreateObject('Chilkat.HttpResponse')
ERROR: Undefined variable(success)
ERROR: Undefined variable(success)
IF (ERROR: Undefined variable(success)
= 0) THEN
? loHttp.LastErrorText
? "Failed to send SOAP request."RELEASE loXml
RELEASE loHttp
RELEASE loResp
CANCELENDIF* Get the XML response body.
loResponseXml = CreateObject('Chilkat.Xml')
loResp.GetBodyXml(loResponseXml)
lnStatusCode = loResp.StatusCode
? "response status code: " + STR(lnStatusCode)
* 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 loResp
RELEASE loResponseXml
CANCELENDIF
? 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).
lcId = loResponseXml.GetChildContent("*:Body|*:RetrievePageFormatsResponse|*:pageFormat|*:id")
lcIsAddressPossible = loResponseXml.GetChildContent("*:Body|*:RetrievePageFormatsResponse|*:pageFormat|*:isAddressPossible")
lcIsImagePossible = loResponseXml.GetChildContent("*:Body|*:RetrievePageFormatsResponse|*:pageFormat|*:isImagePossible")
lcName = loResponseXml.GetChildContent("*:Body|*:RetrievePageFormatsResponse|*:pageFormat|*:name")
lcDescription = loResponseXml.GetChildContent("*:Body|*:RetrievePageFormatsResponse|*:pageFormat|*:description")
lcPageType = loResponseXml.GetChildContent("*:Body|*:RetrievePageFormatsResponse|*:pageFormat|*:pageType")
x = loResponseXml.GetChildContent("*:Body|*:RetrievePageFormatsResponse|*:pageFormat|*:pageLayout|*:size|*:x")
y = loResponseXml.GetChildContent("*:Body|*:RetrievePageFormatsResponse|*:pageFormat|*:pageLayout|*:size|*:y")
lcOrientation = loResponseXml.GetChildContent("*:Body|*:RetrievePageFormatsResponse|*:pageFormat|*:pageLayout|*:orientation")
x = loResponseXml.GetChildContent("*:Body|*:RetrievePageFormatsResponse|*:pageFormat|*:pageLayout|*:labelSpacing|*:x")
y = loResponseXml.GetChildContent("*:Body|*:RetrievePageFormatsResponse|*:pageFormat|*:pageLayout|*:labelSpacing|*:y")
lcLabelX = loResponseXml.GetChildContent("*:Body|*:RetrievePageFormatsResponse|*:pageFormat|*:pageLayout|*:labelCount|*:labelX")
lcLabelY = loResponseXml.GetChildContent("*:Body|*:RetrievePageFormatsResponse|*:pageFormat|*:pageLayout|*:labelCount|*:labelY")
lcTop = loResponseXml.GetChildContent("*:Body|*:RetrievePageFormatsResponse|*:pageFormat|*:pageLayout|*:margin|*:top")
lcBottom = loResponseXml.GetChildContent("*:Body|*:RetrievePageFormatsResponse|*:pageFormat|*:pageLayout|*:margin|*:bottom")
lcLeft = loResponseXml.GetChildContent("*:Body|*:RetrievePageFormatsResponse|*:pageFormat|*:pageLayout|*:margin|*:left")
lcRight = loResponseXml.GetChildContent("*:Body|*:RetrievePageFormatsResponse|*:pageFormat|*:pageLayout|*:margin|*:right")
RELEASE loXml
RELEASE loHttp
RELEASE loResp
RELEASE loResponseXml