加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

xml – 如何发送SOAP请求?

发布时间:2020-12-16 07:43:21 所属栏目:百科 来源:网络整理
导读:我是SOAP和xml的新手.我读了很多教程,但似乎还不够清楚. 我感到困惑,只是发送SOAP请求如何?我试图这样做的方式是将我的SOAP请求(如下所示)保存为:testRequest.xml. POST /MobileCashPayout.asmx HTTP/1.1Host: 192.168.1.80Content-Type: application/soap
我是SOAP和xml的新手.我读了很多教程,但似乎还不够清楚.

我感到困惑,只是发送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解析错误:语法错误
位置:localhost / projects / test.xml
行号1,列1:POST /MobileCashPayout.asmx HTTP / 1.1
^

我发错了吗?
请帮我出来

在浏览器中打开此文档不会发送请求.你有几个选择:

>以任何熟悉的语言编写一个脚本,脚本应该连接到指定的服务器,并发送一个POST请求,与您的消息中提到的正文一样
>使用一些现有的程序为您做这个

如果你没有经验,我一定会推荐第二个选择.我个人最喜欢的是SoapUI,见here.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读