I need to use XmlInclude to generate a description in the wsdl for a subtype for a given web method. I alos need to include the SoapRpcMethod directive and the use=literal attribute in order to conform to WS-I 1.1 for interop. When I do not include the [SoapRpcMethod... directive the XmlInclude works fine a generates the subclass definition in the WSDL, but when I add the SoapRpcMethod it seems to simply ignore it. Here are the code snippets:
This works fine:
[WebMethod(MessageName = "GetPerson")]
[XmlInclude(typeof(Employee))]
public Person GetPerson(int ID) {
Manager manager = new Manager();
return manager.GetPerson(ID);
}
But when I add the SoapRpcMethod, it does not generate the "Employee" class and the client fails because it cannot desserialize Employee.
[WebMethod(MessageName = "GetPerson")]
[SoapRpcMethod(
Action = "http://localhost/GetPerson",
RequestNamespace = "http://localhost/Request",
RequestElementName = "GetPerson",
ResponseNamespace = "http://localhost/Response",
ResponseElementName = "GetPersonResponse",
Use = System.Web.Services.Description.SoapBindingUse.Lit eral)]
[XmlInclude(typeof(Employee))]
public Person GetPerson(int ID) {
Manager manager = new Manager();
return manager.GetPerson(ID);
}
Any ideas would be appreciated...thanks!