在class上增加SoapDocumentService(routingstyle:=SoapServiceRoutingStyle.RequestElement),解决了问题,但是在webmethod中却不能得到soapheader,请帮忙这种情况下怎样得到soapheader,
方法前添加如下语句试试:
[WebMethod]
[System.Web.Services.Protocols.SoapHeaderAttribute("AuthenticationInfo")]
说明:AuthenticationInfo是封装在soapheader中的一个类对象,存放认证的信息。
try to add
[SoapDocumentService(RoutingStyle=SoapServiceRoutingStyle.RequestElement)]
before your webservice class
你没说清楚是什么情况下产生的。
一种情况是:使用WSE后,客户端没有加SOAPHeader信息;
二种情况是:是VS.NET2003在Debug版时的一个Bug,你改在Release版发布服务就没这个问题了。
v三种情况是: WebService端类的命名空间与Proxy端代理类的命名空间不一致。
终于找到解决办法了 :)
停止IIS服务,清除Temporary ASP.NET Files目录
(%WINDOWS%/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files).
Problem goes away.
I face this problem
Server did not recogni