We have created a class to wrap the payload of web service response with common information as follows.
public class ItemResponse<T> : Response
{
/// <summary>
/// constructor to set private properties Item and Status
/// </summary>
/// <param name="item"></param>
/// <param name="status"></param>
public ItemResponse(T item, ResponseStatusEnum status) : base(status)
{
_item = item;
}
public ItemResponse()
{
}
public ItemResponse(ResponseStatusEnum status, System.Collections.Generic.List<ResponseError> errors) : base(status, errors)
{
}
private T _item;
public T Item
{
get
{
return _item;
}
}
}
The base class "Response" just holds error information and status of the the response. The wsdl clearly shows the definition of this response to be ItemResponseOfType[TypeName] but the item type information is missing from the definition.
We tried adding
[XmlInclude(typeof(TypeName))]
but to no avail. Any ideas what we can do to let the SOAP serializer know we want the "Item" type serializing?