0
我有一個ASMX服務,我遷移到wcf(使用basicHttpBinding),現在我使用的是舊客戶端(使用wsdl.exe生成代理)來打這個服務。我可以看到調用到達服務,服務返回一個非null對象,但是asmx客戶端收到的返回值爲null。從asmx客戶端獲取空值,其目標是從遷移(從asmx到wcf)服務
任何線索爲什麼會發生這種情況,以及如何進一步調試?
// 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]));
}