Hi Everyone,
I have a vendor that hasn't yet upgraded from their SOAP apis.
Using the code shown below, I get a 500 error message, but when I use POSTMAN with the headers and body shown in the 2 images below the code,
I get a 200 response and the data I'm expecting.
Can anyone point me in the right direction for doing this in xbasic.
I'm aware of the deprecation of soap, but I'm using build 8301
Any help is greatly appreciated.
Gregg
image.png
image.png
I have a vendor that hasn't yet upgraded from their SOAP apis.
Using the code shown below, I get a 500 error message, but when I use POSTMAN with the headers and body shown in the 2 images below the code,
I get a 200 response and the data I'm expecting.
Can anyone point me in the right direction for doing this in xbasic.
I'm aware of the deprecation of soap, but I'm using build 8301
Any help is greatly appreciated.
Gregg
Code:
dim soapRequest as c soapRequest = <<%text% <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <ShipmentInquiry xmlns="http://tempuri.org/"> <Housebill>403076</Housebill> </ShipmentInquiry> </soap12:Body> </soap12:Envelope> %text% dim url as c url = "https://ssworldtrak.com/WTKServicesSNAP/shipments.asmx" dim headers as c headers = <<%txt% Content-Type: application/soap+xml; charset=utf-8 Content-Length: <contentlength> %txt% dim response as P ' Replace <contentlength> with the actual length of the soapRequest headers = strtran(headers, "<contentlength>", str(len(soapRequest))) debug(1) response = http_post(url, soapRequest, headers)
image.png
Comment