You must Sign In to post a response.
  • Category: Webservices

    Server did not recognize the value of HTTP Header SOAPAction:

    Hi All,

    I created a Webservice to receive the SOAP request as remote server.

    I have an app that send request to Webservice and get an error:

    The following error message was sent: System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: . at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest() at System.

    Could you please help me to fix this problem?

    My SOAP file:

    <soap-env:Body>
    <Parent xmlns="http://abc.com">

    <Info SEGMENT="1">
    <NAME>Helen</NAME>
    <ID>110</ID>
    <NUMCARD>4526245</NUMCARD>
    </Info>

    Code in WS:

    [WebService(Namespace = "http://abc.com")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
    [System.Web.Script.Services.ScriptService]
    public class Transfer : System.Web.Services.WebService
    {

    [WebMethod]
    public string Parent()
    {
    string stt = "";
    string records = "";
    int statusCode = 0;

    try
    {
    XmlDocument xmlSoapRequest = new XmlDocument();
    using (Stream receiveStr = HttpContext.Current.Request.InputStream)
    {
    receiveStr.Position = 0;
    using (StreamReader readStr = new StreamReader(receiveStr, Encoding.UTF8))
    {
    xmlSoapRequest.Load(readStr);
    }
    }

    // Deat data from XML file.
    DataTable dt = ReadXmlFile(xmlSoapRequest);

    //Insert data to ODB
    records = insToODB(dt);

    }
  • #758657
    This error may occur when you are using wrong Namespace to refer WebService, When adding a web reference, you get to choose the namespace, but it will be relative to the default namespace of the project. I don't know of any way to change that.
    see below link for more details
    http://weblogs.asp.net/mrdave/69371

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #758672
    Hi Han,

    When adding a web reference, you get to choose the namespace, but it will be relative to the default namespace of the project. I don't know of any way to change that.

    OTOH, you could try using the WSDL.EXE program to generate your proxy classes. This accepts a /namespace switch that allows you to set the full namespace for the proxy classes.

    I would have to know what you were doing with your project template to know how to help you with that.

    Regards,
    Nirav Lalan
    DNS Gold Member
    "If you can dream it, you can do it."


  • Sign In to post your comments