【发布时间】:2011-10-10 12:18:06
【问题描述】:
我正在使用 c# 使用 wsdl,但我收到以下错误 “无法理解 SOAP 标头 To”。
是什么导致了这个问题,我该如何解决?
感谢您的回复, 根据您的建议,我尝试了以下代码:
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class MyHeader : SoapHeader
{
public bool _MustUnderstand;
public MyHeader() { }
public bool MustUnderstand
{
get { return _MustUnderstand; }
set { _MustUnderstand = value; }
}
}
public class Service : System.Web.Services.WebService
{
public MyHeader MustUnderstand;
public Service ()
{
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
[SoapHeader("MustUnderstand")]
public void Nokia()
{
MustUnderstand = new MyHeader();
MustUnderstand.MustUnderstand = true;
WebService connect = new WebService();
long publicKeyK ;
publicKeyK= connect.GetPublicKey(out publicKeyK);
}
}
(我在 mustUnderstand 属性上也设置了 false ...)
我仍然收到相同的错误消息。 “无法理解 SOAP 标头 To”
有什么想法吗? 波利。
【问题讨论】:
标签: soap