Web services 使用wget调用Web服务

Web services 使用wget调用Web服务,web-services,wget,Web Services,Wget,我能够使用CURL从Linux命令行调用web服务。 现在我尝试使用wget调用Web服务,但我总是收到以下错误: 500内部服务器错误 我使用以下语法: wget http://<endPoint> --post-file=soapRequest.xml --header="Content-Type: application/soap+xml" --output-document=soapResponse.xml wget http://--post file=soapReque

我能够使用CURL从Linux命令行调用web服务。 现在我尝试使用wget调用Web服务,但我总是收到以下错误: 500内部服务器错误

我使用以下语法:

wget http://<endPoint> --post-file=soapRequest.xml --header="Content-Type: application/soap+xml" --output-document=soapResponse.xml
wget http://--post file=soapRequest.xml--header=“内容类型:应用程序/soap+xml”--输出文档=soapResponse.xml
其中soapRequest.xml包含xml请求(由SoapUI验证)

wget返回的错误为:

Connecting to <host:port>... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2011-12-12 23:18:33 ERROR 500: Internal Server Error.
正在连接到。。。有联系的。
HTTP请求已发送,正在等待响应。。。500内部服务器错误
2011-12-12 23:18:33错误500:内部服务器错误。

我必须使用
--header=“Content Type:text/xml”

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

wget--post file=soaprequest.xml--header=“内容类型:text/xml”--header=“SOAPAction:\”SOAPAction“http://server/app/myservice.asmx -O response.xml


soapaction
”值可以在WSDL中找到,也可以在ASP.NET为
myservice.asmx

上的操作创建的信息页面上找到,这对我帮助很大。使用JBossWS可以很好地工作。