2011-12-13 132 views
0

我正在编写一个.net web服务,它将被java程序所收敛。 我收到此错误:.net web服务在soap中。服务器无法识别HTTP标头SOAPAction的值

System.Web.Services.Protocols.SoapException:服务器无法识别HTTP标头SOAPAction的值:。 在System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest() 在System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage消息) 在System.Web.Services.Protocols.SoapServerProtocol.Initialize() 在系统.Web.Services.Protocols.ServerProtocol.SetContext(类型类型,HttpContext上下文,HttpRequest请求,HttpResponse响应) at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type,HttpContext context,HttpRequest request,HttpResponse response,Boolean & abortProcessing)

你知道这是什么意思?我搜索了很多,但找不到解决方案!

+0

做你碰巧检查此线程http://stackoverflow.com/questions/352174/server-did-not-recognize-the-value-of-http-header-soapaction-c-sharp -javascript和此http://social.msdn.microsoft.com/Forums/eu/biztalkgeneral/thread/ef3693e9-77a3-48e3-ac1b-0029d21b401f 或者尝试将SoapDocumentServiceAttribute设置为service.http://msdn.microsoft。 COM/EN-US /库/ system.web.services.protocols.soapdocumentserviceattribute.aspx – Aravind

回答

1

.Net WCF将自动编码头和消息,而java不编码头。标题不匹配,因为一个是编码,而另一个不是。

所以,你必须打开的

   Client prxy = new Client("BindingName"); 
      prxy.Endpoint.Contract.ProtectionLevel =System.Net.Security.ProtectionLevel.Sign; 
      prxy.Open(); 

我希望这可以帮助,我不认为你可以做到这一点的配置文件,你可以做到这一点的代码。 GL!

这是为.Net客户端,对不起。但你可能会从中得到一些东西!

Msdn, how to set the protectionlevel of a service