我是SOAP和xml的新手。我讀了一些教程,但似乎沒有足夠清楚。你如何發送SOAP請求?
我很高興,只是如何發送SOAP請求?我試圖做到這一點的方式是將我的SOAP請求(如下所示)保存爲: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>
然後我才能用瀏覽器打開該文件(testRequest.xml)才能被髮送..
我所得到的回報是一條錯誤消息指出: XML解析錯誤:語法錯誤 位置:本地主機/項目/的test.xml 1號線,1列:POST /MobileCashPayout.asmx HTTP/1.1 ^
我是否發送了錯誤的方式? 請幫我一下嗎?
XML內容以「<?xml」開頭。之前的所有內容都是HTTP標頭。你在使用什麼平臺? Java的? – 2012-07-14 14:08:49