I am new to SOAP and xml. I read a number of tutorials but nothing seems to be clear enough.
I am abit confused, Just how does one send an SOAP request? The way I have tried to do this is by saving my SOAP request (as seen below) as: testRequest.xml.
POST /MobileCashPayout.asmx HTTP/1.1
Host: 192.168.1.80
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?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>
<Payout xmlns="http://www.mycel.com/">
<Username>string</Username>
<Password>string</Password>
<referenceID>string</referenceID>
<sourceMsisdn>string</sourceMsisdn>
<destMsisdn>string</destMsisdn>
<Amount>decimal</Amount>
<MobilePin>string</MobilePin>
<cashInformation>string</cashInformation>
<merchantName>string</merchantName>
</Payout>
</soap12:Body>
</soap12:Envelope>
I then open the file (testRequest.xml) with a browser in order for it to be sent..
what I get in return is an error message stating: XML Parsing Error: syntax error Location: localhost/projects/test.xml Line Number 1, Column 1:POST /MobileCashPayout.asmx HTTP/1.1 ^
Am I sending it the wrong way? Please help me out?
Opening this document in browser wouldn't send a request. You have several options:
If you're inexperienced I would definitely recommend second option. My personal favourite is SoapUI, see here.
You cannot send a soap request when a browser as far as I know. I propose you use a tool like Soap UI
to send a request.
This blog post helped me. Python SOAP Request using Requests
On linux you can use
curl
to send the soap xml. Here's how to do it:Using the
testRequest.xml
file created you canHere is a link that describes the full process.