日期:2014-05-17  浏览次数:20395 次

ajax如何调用带有SoapHeader的 web service?
ajax如何调用带有SoapHeader的 web service?

能否告知如何做?

Ajax访问Xml Web Service的我会做,但是访问 带有SoapHeader的 web service还不明白怎么做?

------解决方案--------------------
这个是jquery的例子:
C# code

[WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class WebService4JQuery : System.Web.Services.WebService
    {
        
        public TestHeader THeader;

        [WebMethod]
        [SoapHeader("THeader")]
        public string TestSoapHeader()
        {

            return "THeader Value: " + THeader.HeaderData;
        }
    }

    public class TestHeader : SoapHeader
    {
        public string HeaderData { get; set; }
    }