Just trying to get a response from the appropriate place, but I am getting an error related to the header "SOAPAction" (website changed);
values QSYS2.http_post(
'https://portal.website.asmx',
'''<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetInfo xmlns="https://portal.website.com">
<PartnerKey>123ABC</PartnerKey>
</Getinfo>
</soap:Body>
</soap:Envelope>
''',
'{
"sslTolerate":"true",
"SOAPAction":"GetInfo"
}'
);
Exact error is "INVALID PROPERTY : SOAPAction". I have never built a SOAP request before, and I am wondering if the DB2 HTTP tools can work with this or not, but based on that error, I am not sure they can. Again, never done this before, so I am working with whatever documentation I can dig up online.
It can be done, but a SOAP service is a bit more complex than a JSON REST service..
For example, the SOAP Action is passed as a SOAPAction
header with SOAP 1.1.
With SOAP 1.2 it is passed as part of the content type.
You've done neither in your example...
If you're trying to pass it as 1.1 header, you'd need
'{
"sslTolerate":"true",
"headers":{"Content-Type":"text/xml","SOAPAction":"GetInfo"}
}'
For 1.2 it'd look like so
'{
"sslTolerate":"true",
"headers":{"Content-Type":"application/soap+xml;charset=UTF-8;action="GetInfo"}
}'
I would suggest asking the web service owner if a WSDL is available. Then use tooling, for instance SoapUI, that can import the WSDL allowing you to see the format of the request and what actually gets sent.
Once you understand what you need to send, you'll have a better chance of doing so successfully.
IBM, as part of the "Integrated Web Services (IWS)" includes in the Web Services Client for ILE a wsdl2rpg
shell script that can generate a ILE RPG Web service client stub that simplifies calling a SOAP web service from RPG.
There is at least one open source WSDL2RPG
type utility that came before IBM's tooling.