C # Unable to process request without a valid action parameter. Please put a valid soap action

I get this error. When I call C # WebService using HttpWebRequest .

 System.Web.Services.Protocols.SoapException: Unable to handle request without a valid action parameter. Please supply a valid soap action. 

from wsdl I found a soap action, and I added to the request, but still it shows an error

 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" 

thanks

+4
source share
2 answers

The action is determined by the URL to which you send the envelope with soap. Most likely, the URL has a typo or you are trying to perform an action that the SOAP service does not understand. Check the WSDL for the service and make sure that you invoke the correct action.

+4
source
 request.Headers.Add("SOAPAction", "https://ttt/test.aspx/methodname") 

The method name should be specified after 'test.aspx/' in the above URL.

+1
source

Source: https://habr.com/ru/post/1391981/


All Articles