el_*_*rdo 46 testing curl web-services
你们知道如何使用Curl命令行POST SOAP来测试Web服务吗?
我有一个文件(soap.xml),它附有所有肥皂消息,我似乎无法正确发布它.
谢谢!
lbz*_*lbz 42
发布字符串:
curl -d "String to post" "http://www.example.com/target"
Run Code Online (Sandbox Code Playgroud)
发布文件内容:
curl -d @soap.xml "http://www.example.com/target"
Run Code Online (Sandbox Code Playgroud)
Kri*_*s C 33
对于SOAP 1.2 Web服务,我通常使用
curl --header "content-type: application/soap+xml" --data @filetopost.xml http://domain/path
Run Code Online (Sandbox Code Playgroud)
Zib*_*bri 26
错误.这对我不起作用.
对我来说这个有用:
curl
-H 'SOAPACTION: "urn:samsung.com:service:MainTVAgent2:1#CheckPIN"'
-X POST
-H 'Content-type: text/xml'
-d @/tmp/pinrequest.xml
192.168.1.5:52235/MainTVServer2/control/MainTVAgent2
Run Code Online (Sandbox Code Playgroud)
curl -H "Content-Type: text/xml; charset=utf-8" \
-H "SOAPAction:" \
-d @soap.txt -X POST http://someurl
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
103032 次 |
最近记录: |