我遇到了这个错误。当我使用 HttpWebRequest
调用 c# WebService 时。
System.Web.Services.Protocols.SoapException: Unable to handle request without a valid action parameter. Please supply a valid soap action.
我从 wsdl 中找到了 soap 操作并添加到请求中,但它仍然显示错误
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://localhost:33333/AccountService.asmx");
request.Method = "POST";
request.ContentType = "text/xml";
request.Accept = "text/xml";
request.Headers.Add("SOAPAction", "https://ttt/test.aspx"
谢谢
最佳答案
操作由您将 soap 信封发布到的 url 指定。可能是 url 有拼写错误,或者您正在尝试执行 SOAP 服务无法理解的操作。检查服务的 WSDL 并确保您正在调用正确的操作。
关于c# 无法处理没有有效操作参数的请求。请提供有效的 SOAP 操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8937399/