2011-12-13 131 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