I had a ASMX service which i migrated to wcf(using basicHttpBinding), now I am using the old client ( whcih uses wsdl.exe to generate the proxy ) to hit the service. I can see that the call reaches the service and the service returns a non null object, however the return value received by the asmx client is null.
Any clues why this might be happening and how to debug this further?
// 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]));
}
Figured it out, basically the soap response was incorrectly generating
instead of
Notice the difference is an extra GetViewSummaryForCurrentUserResult element instead of Views
in order to fix it I had to add the attribute
…. trivial solution really, dont know why i missed i