Asp.net 使用web服务会导致“;没有有效的操作参数”;无法处理请求;
我需要使用此.NET网站上的web服务: 对于初步消费,我使用Fiddler或curl。两者都给出相同的错误:Asp.net 使用web服务会导致“;没有有效的操作参数”;无法处理请求;,asp.net,web-services,soap,curl,fiddler,Asp.net,Web Services,Soap,Curl,Fiddler,我需要使用此.NET网站上的web服务: 对于初步消费,我使用Fiddler或curl。两者都给出相同的错误: <faultstring>Unable to handle request without a valid action parameter. Please supply a valid soap action.</faultstring> 没有有效的操作参数,无法处理请求。请提供有效的soap操作。 我的curl命令: curl-d@GetVersio
<faultstring>Unable to handle request without a valid action parameter. Please supply a valid soap action.</faultstring>
没有有效的操作参数,无法处理请求。请提供有效的soap操作。
我的curl命令:
curl-d@GetVersionNumber.xml
请参阅下面的文件GetVersionNumber.xml:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetVersionNumber xmlns="http://tempuri.org/YSI.Interfaces.WebServices/ItfResidentData" />
</soap:Body>
</soap:Envelope>
在SOAP:Envelope中添加SOAP-ENV:Header作为元素没有帮助
<SOAP-ENV:Header Content-Type="text/xml" Host="www.iyardiasp.com" SOAPAction="http://tempuri.org/YSI.Interfaces.WebServices/ItfResidentData/GetVersionNumber"/>
将Soap操作添加为标头没有帮助
在这种情况下,curl命令是:
curl-H“SOAPAction:”-d@GetVersionNumber.xml“”
答复是:
<faultstring>Server did not recognize the value of HTTP Header SOAPAction: http://tempuri.org/YSI.Interfaces.WebServices/ItfResidentData/GetVersionNumber.</faultstring>
服务器未识别HTTP标头SOAPAction的值:http://tempuri.org/YSI.Interfaces.WebServices/ItfResidentData/GetVersionNumber.
您需要提供,而不是SOAP头。下面是使用SoapUI执行完整请求时的样子(请注意第四行):
在GetVersionNumber.xml
文件中使用此选项:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:itf="http://tempuri.org/YSI.Interfaces.WebServices/ItfResidentData">
<soapenv:Body>
<itf:GetVersionNumber/>
</soapenv:Body>
</soapenv:Envelope>
Bogdan,请查看我在请求中添加的内容,谢谢Bogdan我用您的标题从Fiddler处检查过-工作正常,谢谢。从curl it not working yetBogdan开始,我尝试了几种变体:例如:curl-H“Content Type:application/soap+xml;SOAPAction:”;Host:www.iyardiasp.com“-d@GetVersionNumber.xml”。这是同样的结果
curl -H "Content-Type: text/xml;charset=UTF-8"
-H "SOAPAction: \"http://tempuri.org/YSI.Interfaces.WebServices/ItfResidentData/GetVersionNumber\""
-d @GetVersionNumber.xml
https://www.iyardiasp.com/8223third_17/webservices/ItfResidentData.asmx
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:itf="http://tempuri.org/YSI.Interfaces.WebServices/ItfResidentData">
<soapenv:Body>
<itf:GetVersionNumber/>
</soapenv:Body>
</soapenv:Envelope>