我有一个迁移到 wcf 的 ASMX 服务(使用 basicHttpBinding),现在我使用旧客户端(其中使用 wsdl.exe 生成代理)来访问该服务。我可以看到调用到达服务并且服务返回一个非空对象,但是 asmx 客户端收到的返回值为空。
任何线索为什么会发生这种情况以及如何进一步调试?
// This is my webservice
[ServiceContract(Namespace = "http://tempuri.org/ManagementWebService")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
public class ManagementService
{
[OperationContractAttribute(Action = "http://tempuri.org/ManagementWebService/GetViewSummaryForCurrentUser", ReplyAction = "*")]
[OperationBehavior(Impersonation = ImpersonationOption.Allowed)]
[XmlSerializerFormatAttribute()]
[CLSCompliant(false)]
[WebMethod]
public virtual ViewSummaryList GetViewSummaryForCurrentUser()
{
return new ViewSummaryList();
}
}
// This is the client side code which receives a null value.
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ManagementWebService/GetVi" +
"ewSummaryForCurrentUser", RequestNamespace="http://tempuri.org/ManagementWebService", ResponseNamespace="http://tempuri.org/ManagementWebService", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlElementAttribute("Views")]
public ViewSummaryList GetViewSummaryForCurrentUser() {
object[] results = this.Invoke("GetViewSummaryForCurrentUser", new object[0]);
return ((ViewSummaryList)(results[0]));
}