Use ChilkatAx-win32.pkg
Procedure TestHandle hoXml
Boolean iSuccess
String sSoapRequestBody
String sEndpoint
String sSoapAction
String sContentType
Handle hoHttp
Handle hoResp
onseXml Handle hoResponseXml
Integer iStatusCode
String sLink
String sWalletBallance
String sTemp1
Get Create (RefClass(cComChilkatXml)) To hoXml
If (Not(IsComObjectCreated(hoXml))) BeginSend CreateComObject of hoXml
EndSetComTagOf hoXml To"soapenv:Envelope"GetComAddAttributeOf hoXml "xmlns:soapenv""http://schemas.xmlsoap.org/soap/envelope/"To iSuccess
GetComAddAttributeOf hoXml "xmlns:v3""http://oneclickforapp.dpag.de/V3"To iSuccess
SendComUpdateChildContentTo hoXml "soapenv:Header"""SendComUpdateChildContentTo hoXml "soapenv:Body|v3:CheckoutShoppingCartPDFRequest|v3:userToken""string"SendComUpdateChildContentTo hoXml "soapenv:Body|v3:CheckoutShoppingCartPDFRequest|v3:pageFormatId""int"SendComUpdateChildContentTo hoXml "soapenv:Body|v3:CheckoutShoppingCartPDFRequest|v3:positions|v3:productCode""int"SendComUpdateChildContentTo hoXml "soapenv:Body|v3:CheckoutShoppingCartPDFRequest|v3:positions|v3:voucherLayout""AddressZone"SendComUpdateChildContentTo hoXml "soapenv:Body|v3:CheckoutShoppingCartPDFRequest|v3:positions|v3:position|v3:labelX""int"SendComUpdateChildContentTo hoXml "soapenv:Body|v3:CheckoutShoppingCartPDFRequest|v3:positions|v3:position|v3:labelY""int"SendComUpdateChildContentTo hoXml "soapenv:Body|v3:CheckoutShoppingCartPDFRequest|v3:positions|v3:position|v3:page""int"SendComUpdateChildContentTo hoXml "soapenv:Body|v3:CheckoutShoppingCartPDFRequest|v3:total""int"// In a SOAP HTTP request, including the XML declaration (<?xml version="1.0" encoding="UTF-8"?>) in the XML body is generally not required. SetComEmitXmlDeclOf hoXml ToFalseGetComGetXmlOf hoXml To sSoapRequestBody
Move"https://internetmarke.deutschepost.de/OneClickForApp/OneClickForAppServiceV3/OneClickForAppV3EJB"To sEndpoint
Move" "To sSoapAction
// For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"Move"text/xml"To sContentType
Get Create (RefClass(cComChilkatHttp)) To hoHttp
If (Not(IsComObjectCreated(hoHttp))) BeginSend CreateComObject of hoHttp
EndSendComClearHeadersTo hoHttp
SendComSetRequestHeaderTo hoHttp "Content-Type" sContentType
SendComSetRequestHeaderTo hoHttp "SOAPAction" sSoapAction
Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
If (Not(IsComObjectCreated(hoResp))) BeginSend CreateComObject of hoResp
End
ERROR: Undefined variable(success)
ERROR: Undefined variable(success)
If (ERROR: Undefined variable(success)
= False) BeginGetComLastErrorTextOf hoHttp To sTemp1
Showln sTemp1
Showln"Failed to send SOAP request."Procedure_ReturnEnd// Get the XML response body.Get Create (RefClass(cComChilkatXml)) To hoResponseXml
If (Not(IsComObjectCreated(hoResponseXml))) BeginSend CreateComObject of hoResponseXml
End
Get pvComObject of hoResponseXml to vResponseXml
GetComGetBodyXmlOf hoResp vResponseXml To iSuccess
GetComStatusCodeOf hoResp To iStatusCode
Showln"response status code: " iStatusCode
// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.If (iStatusCode <> 200) BeginGetComGetXmlOf hoResponseXml To sTemp1
Showln sTemp1
Procedure_ReturnEndGetComGetXmlOf hoResponseXml To sTemp1
Showln sTemp1
// 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).GetComGetChildContentOf hoResponseXml "*:Body|*:CheckoutShoppingCartPDFResponse|*:link"To sLink
GetComGetChildContentOf hoResponseXml "*:Body|*:CheckoutShoppingCartPDFResponse|*:walletBallance"To sWalletBallance
End_Procedure