SOAPAction的问题:服务器无法识别http标头SOAPAction的值

时间:2015-07-03 16:25:00

标签: c# .net asmx soap-client webservice-client

我一直面临着WebService实现的许多问题。我知道这个网站有一些与之相关的主题,但我已经尝试了我找到的步骤,对我没什么用。

我创建了一个将由QAD ERP调用的.NET WebService。我在我们的服务器上安装了Web服务,可以通过以下地址访问:187.72.208.85/qadws/QADXmlWS.asmx

ERP正在调用Web服务发送以下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:Header></soap:Header>
<soap:Body>
<qdoc:Item xmlns:qdoc="http://187.72.208.85/QADWs/QADXmlWs/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<qdoc:file>
<qdoc:operation>A</qdoc:operation>
<qdoc:ptAdded>2015-06-09</qdoc:ptAdded>
<qdoc:ptCdCmmt/>
<qdoc:ptCdRef>DI</qdoc:ptCdRef>    
</qdoc:file>
</qdoc:Item>
</soap:Body>
</soap:Envelope>

网络服务代码是:

[WebService(Namespace = "http://187.72.208.85/QADWs/QADXmlWs/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
public class QADXmlWs : System.Web.Services.WebService
{       
    [WebMethod]
    public void Item(byte[] file)
    {                   
        File.WriteAllBytes(@"c:/ws/Item.xml", file);           
    }
}

当我调用Web Service时,它会给我以下错误:

<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Server did not recognize the value of HTTP SOAPAction: 'http://187.72.208.85/QADWs/QADXmlWs/Item'.</faultstring>
<detail />
</soap:Fault>

我不知道如何解决这个问题。 你能帮我解决这个问题吗?

0 个答案:

没有答案
相关问题