如何从命令行调用 SOAP wsdl Web 服务 [英] How to do a SOAP wsdl web services call from the command line
问题描述
我需要对 https://sandbox.mediamind 进行 SOAP 网络服务调用.com/Eyeblaster.MediaMind.API/V2/AuthenticationService.svc?wsdl 并在传递参数时使用 ClientLogin 操作:ApplicationKey、Password 和 UserName.响应是 UserSecurityToken.它们都是字符串.
I need to make a SOAP webservice call to https://sandbox.mediamind.com/Eyeblaster.MediaMind.API/V2/AuthenticationService.svc?wsdl and to use the operation ClientLogin while passing through the parameters: ApplicationKey, Password, and UserName. The response is UserSecurityToken. They are all strings.
这是完整解释我想要做的事情的链接:https://sandbox.mediamind.com/Eyeblaster.MediaMind.API.Doc/?v=3
Here is the link fully explaining what I am trying to do: https://sandbox.mediamind.com/Eyeblaster.MediaMind.API.Doc/?v=3
如何在命令行上执行此操作?(Windows 和/或 Linux 会有所帮助)
How can I do this on the command line? (Windows and/or Linux would be helpful)
推荐答案
这是一个标准的普通 SOAP Web 服务.SSH 在这里无关.我只是用 curl (one-liner) 调用它:
It's a standard, ordinary SOAP web service. SSH has nothing to do here. I just called it with curl (one-liner):
$ curl -X POST -H "Content-Type: text/xml" \
-H 'SOAPAction: "http://api.eyeblaster.com/IAuthenticationService/ClientLogin"' \
--data-binary @request.xml \
https://sandbox.mediamind.com/Eyeblaster.MediaMind.API/V2/AuthenticationService.svc
其中 request.xml
文件包含以下内容:
Where request.xml
file has the following contents:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.eyeblaster.com/">
<soapenv:Header/>
<soapenv:Body>
<api:ClientLogin>
<api:username>user</api:username>
<api:password>password</api:password>
<api:applicationKey>key</api:applicationKey>
</api:ClientLogin>
</soapenv:Body>
</soapenv:Envelope>
我得到了这个漂亮的 500:
I get this beautiful 500:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode>s:Security.Authentication.UserPassIncorrect</faultcode>
<faultstring xml:lang="en-US">The username, password or application key is incorrect.</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>
您是否尝试过 soapui?
这篇关于如何从命令行调用 SOAP wsdl Web 服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!