消息=服务器不承认HTTP头的SOAPAction值:错误 [英] Message=Server did not recognize the value of HTTP Header SOAPAction: error

查看:2433
本文介绍了消息=服务器不承认HTTP头的SOAPAction值:错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我创建了一个Web服务。而我会能够击中使用SOAPUI Web服务,但是当我试图通过我的代码来调用我得到这个错误。 ?
任何想法



确定Web服务代码如下所示:

  [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] 
[WebServiceBindingAttribute(NAME =SoapBinding,命名空间=XYZ)]
[System.ComponentModel.ToolboxItem(假)]
〔WebService的空间(namespace =HTTP://搜索)]
//要允许此Web服务从脚本调用,使用ASP.NET AJAX,取消注释以下行。
// [System.Web.Script.Services.ScriptService]
公共类存根:System.Web.Services.WebService
{
公共存根()
{
Log.Debug(这一点,的String.Format(这只是一个测试邮件));
}


[的WebMethod]
公开回应searchAsset(请求serviceTag)
{
}

和我的客户端代码:

 搜索_search =新搜索(); 
_search.url;
_search.n.wcred;
_search.searchAsset(请求);


解决方案

这解决了我的问题与SOAPACTION:

  [SoapDocumentService(RoutingStyle = SoapServiceRoutingStyle.RequestElement)] 

SoapServiceRoutingStyle枚举
的SOAPAction的SOAP消息是基于SOAPAction HTTP头路由。
RequestElement SOAP消息是基于所述SOAP消息的XML元素之后的第一个子元素上进行路由。


HI Guys, I have created a web service. And I m able to hit the web service using SOAPUI but when i try to call through my code I get this error. Any ideas?

ok the web service code looks like this:

[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[WebServiceBindingAttribute(Name = "SoapBinding", Namespace = "xyz")]
[System.ComponentModel.ToolboxItem(false)]
[WebService(Namespace = "http://Search")]
// 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 Stub : System.Web.Services.WebService
{
    public Stub()
    {
        Log.Debug(this,string.Format("this is just a test message"));
    }


    [WebMethod]
    public Response searchAsset(Request serviceTag)
    {
    }

And my client code is:

Search _search = new Search();
_search.url;
_search.n.wcred;
_search.searchAsset(request);

解决方案

This solved my problem with the SoapAction:

[SoapDocumentService(RoutingStyle = SoapServiceRoutingStyle.RequestElement)]

SoapServiceRoutingStyle Enumeration SoapAction The SOAP message is routed based on the SOAPAction HTTP header. RequestElement The SOAP Message is routed based on the first child element following the XML element of the SOAP message.

这篇关于消息=服务器不承认HTTP头的SOAPAction值:错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆