Hello,
I am trying to consume a SOAP web-service using GoLang. I am sending a sample request and expected response
below. Kindly note that the text in bold-and-italics in the Request are user inputs and in the Response is the expected
response (contents of file in hex).
SOAP Request:
POST /service1.asmx HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Body>
<userName>dynamicString</userName> //user input
<passWord>dynamicString</passWord> //user input
<FileName>dynamicString</FileName> //user input
</getFile>
</soap12:Body>
</soap12:Envelope>
SOAP Response:
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Body>
<getFileResult>fileContentsinHexFormat</getFileResult> //file contents in hex format
</getFileResponse>
</soap12:Body>
</soap12:Envelope>
I could not find any GoLang libraries to do it automatically. I could communicate with the server, but due to some error in
formatting the request, the server always sends a 500 error status code. The main problem is to insert the user inputs in
the request (in correct format). Can someone kindly help me out with a nice way of forming the SOAP request? Code
snippets will be very helpful. Thank you for your time and efforts.
Cheers!
Mustafizur