服务器无法处理服务器不承认HTTP头SOAPAction的价值: [英] System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction:

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

问题描述

这是例外,当我试图来调用Web服务的方法流:

An exception flows when I was trying to call a method on web service:

System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: http://localhost:53460/3Development/MyWebService.asmx/GetBasePath.
   at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest()
   at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message)
   at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)

Web服务的命名空间:

The web service's namespace:

[WebService(Namespace = "http://internaltest.temp.us/MyWebService.asmx")]

我做了一些研究,发现了这个异常流入,因为在这个项目中引用的Web服务的命名空间是从服务器Web服务的命名空间的不同,但我试着删除Web引用,并在项目重新添加,但结果还是一样。

I did some research and found out that this exception flows because the web service's namespace referenced in the project was different from the server web service's namespace, but I've tried removing web reference and add it again in the project, but the result was still the same.

我的情况是类似以下文章:

My situation was similar to the below article:

<一个href=\"http://bluebones.net/2003/07/server-did-not-recognize-http-header-soapaction/\">http://bluebones.net/2003/07/server-did-not-recognize-http-header-soapaction/

从文章:

所以基本上Web服务从 http://foo.com/servicename 感动
  到 http://bar.com/servicename 但Web服务的空间
  留校 http://foo.com/servicename 因为没有人改变了它。

So basically the web service was moved from http://foo.com/servicename to http://bar.com/servicename but the "namespace" of the web service stayed as http://foo.com/servicename because no one changed it.

问题是:

如何改变Web引用的命名空间?

How to change the namespace of the web reference?

推荐答案

在除了删除和添加Web引用,你可以尝试使用再生代理Wsdl.exe用的建议<一href=\"http://stackoverflow.com/questions/2441364/changing-the-namespace-for-a-web-reference-in-a-project-to-be-made-into-a-vs-pro\">here,与命名空间一次。希望它能帮助

In addition to removing and adding web-reference, you could try regenerating proxies using wsdl.exe as suggested here, with the namespace again. Hope it helps

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

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