且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 wget 调用 Web 服务

更新时间:2023-08-31 17:39:28

你没有提到你使用的是哪个 web 服务器,或者你的 URL 是如何格式化的,但是要在 IIS 上调用用 .NET 编写的 web 服务操作,请使用这个语法:

You don't mention which webserver you are using, or how your URL is formatted, but to invoke a web service operation written in .NET on IIS use this syntax:

wget --post-file=soaprequest.xml --header="Content-Type: text/xml" --header="SOAPAction: \"soapaction\"" http://server/app/myservice.asmx -O response.xml

soapaction"值可以在 WSDL 中找到,也可以在 ASP.NET 为 myservice.asmx 中的操作创建的信息页面上找到.

The "soapaction" value can be found in the WSDL, or on the information page ASP.NET creates for the operation at myservice.asmx.