HTTPrequest does not work for SOAP (XML)

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Enricoys
Junior Coder
Posts: 27
Joined: Mon Jan 06, 2014 1:18 pm

HTTPrequest does not work for SOAP (XML)

Post by Enricoys » Mon Aug 15, 2022 9:05 am

I am trying to send a SOAP (XML) file to a webservice. I expected that HTTPrequest would do this job, however I can't get it working. As a work around I am now using the CURL command shown below which works fine. What should I do different to make HTTPrequest work?

Code: Select all

Let>XMLfile=C:\XML\testfile.xml
Let>XMLoutputfile=C:\XML\testoutput.xml
Let>curl="c:\Windows\System32\curl.exe"
let>curlheader=-H "Content-Type: text/xml; charset=utf-8" -H "SOAPAction:"
Let>endpoint=https://<myURLendpoint>
Let>CURLcmd="%curl%  %curlheader%  -d @"%XMLfile%"  -X POST  %endpoint%  -o "%XMLoutputfile%"  -s -i"
Run>cmd.exe /c %CURLcmd%
I have tried the following HTTPrequest, however it returns error:
500 HTTP/1.1 500 Internal Server Error

Code: Select all

Let>HTTP_POSTFILES=upload1=C:\XML\testfile.xml
Let>HTTP_CUSTOM_HEADERS=Content-Type: text/xml; charset=utf-8
Let>endpoint=https://<myURLendpoint>
Let>HTTP_SSL=1
HTTPRequest>%Endpoint%,,POST,,HTMLResponse
I also tried to change the HTTP_CUSTOM_HEADERS without effect in:
Let>HTTP_CUSTOM_HEADERS=Content-Type: text/xml; charset=utf-8; SOAPAction:
Furthermore I tried Let>HTTP_SSL=11 and Let>HTTP_SSL=12 without positive effect.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: HTTPrequest does not work for SOAP (XML)

Post by Marcus Tettmar » Mon Aug 15, 2022 11:49 am

Hi,

HTTP_CUSTOM_HEADERS needs the list CRLF delimited. So try this:

Let>HTTP_CUSTOM_HEADERS=Content-Type: text/xml; charset=utf-8%CRLF%SOAPAction:

That should mirror the headers you're sending via Curl, in case that is the issue.

If that doesn't work I'd really need to be able to try it. If you're able to share the info/url privately for us to try feel free to email to support.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Enricoys
Junior Coder
Posts: 27
Joined: Mon Jan 06, 2014 1:18 pm

Re: HTTPrequest does not work for SOAP (XML)

Post by Enricoys » Mon Aug 15, 2022 2:09 pm

Hi Marcus,
Thanks for this quick reply. Unfortunately your remark was not the solution. Still the same error.
I will send a email to support.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts