http://www.cnblogs.com/fineboy/archive/2005/08/10/211403.html

解决方案 »

  1.   


    非常感谢!不过上面这个是简单的调用,不包含soap header 部分。现在的问题是,JAVA写的WEBservice 需要验证SOAP头信息,而.net默认是不发SOAP头过去的 ,肯定要自己定义了,自定义方法:
    Inherits System.Web.Services.Protocols.SoapHttpClientProtocol        Public Class MySoapHeader
                Inherits SoapHeader
                Public Username As String
                Public Password As String
            End Class但是怎么样将这个soap包一起发送到java 的webserivce 呢?.net 中通过引用   java 的 webseice  后自动生产代理类
          <System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace:="http://test/AVExternalWS", ResponseNamespace:="http://test/AVExternalWS", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _
            Public Function aliReceiveCancelAV(<System.Xml.Serialization.XmlElementAttribute(IsNullable:=True)> ByVal in0 As String) As <System.Xml.Serialization.XmlElementAttribute("out", IsNullable:=True)> String
                Dim results() As Object = Me.Invoke("aliReceiveCancelAV", New Object() {in0})
                Return CType(results(0), String)
            End Function现在的问题是怎么样向这类中添加自定义SOAP header,这样似乎也不对<System.Web.Services.Protocols.SoapDocumentMethodAttribute("MySoapHeader", RequestNamespace:="http://test/AVExternalWS", ResponseNamespace:="http://test/AVExternalWS", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> 
      

  2.   

    楼主你的问题搞定了么? 能分享一下解决办法么?
    我遇到跟你一样的问题。 
    调用 JAVA web服务带了SOAPHEADER那怎么调,在.NET程序中根本不能看到头信息