读书人

关于Webservice的一个有关问题

发布时间: 2012-12-25 16:18:28 作者: rapoo

关于Webservice的一个问题
public class ContactSyncService : System.Web.Services.WebService
{
[WebMethod]
[SoapHeaderAttribute("SecurityHeaderValue")]
[SoapDocumentMethodAttribute("", Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Bare)]
[return: System.Xml.Serialization.XmlElementAttribute("MapChangesResponse", Namespace = "http://msg.pim.vnet.cn")]
public webservice.MapChangesResponse MapChanges(webservice.SecurityHeader SecurityHeader, webservice.MapChangesRequest MapChangesRequest)
{
object[] results = new object[] {
SecurityHeader,
MapChangesRequest};
return ((webservice.MapChangesResponse)(results[0]));
}


[WebMethod]
[SoapHeaderAttribute("SecurityHeaderValue")]
[SoapDocumentMethodAttribute("", Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Bare)]
[return: System.Xml.Serialization.XmlElementAttribute("SyncChangesResponse", Namespace = "http://msg.pim.vnet.cn")]
public webservice.SyncChangesResponse SyncChanges(webservice.SecurityHeader SecurityHeader, webservice.SyncChangesRequest SyncChangesRequest)
{
object[] results = new object[] {
SecurityHeader,
SyncChangesRequest};
return ((webservice.SyncChangesResponse)(results[0]));
}

[WebMethod]
[SoapHeaderAttribute("SecurityHeaderValue")]
[SoapDocumentMethodAttribute("", Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Bare)]
[return: System.Xml.Serialization.XmlElementAttribute("NotificationResponse", Namespace = "http://msg.pim.vnet.cn")]
public webservice.NotificationResponse Notification(webservice.SecurityHeader SecurityHeader, webservice.Param[] NotificationRequest)
{
object[] results = new object[] {
SecurityHeader,


NotificationRequest};
return ((webservice.NotificationResponse)(results[0]));
}

}
到运行页面的时候就出现System.Exception: 头属性/字段 ContactSyncService.SecurityHeaderValue 缺失或者不是公共的。这个错误,请问是什么原因??

[解决办法]
ding
[解决办法]
你是怎么解决的啊?

读书人网 >Web Service

热点推荐