Hello,
I have a method with these attributes:
[WebMethod(MessageName="GetCards",
EnableSession=true)]
[SoapHeader("mbiSessionHeader",
Direction=SoapHeaderDirection.In)]
[SoapHeaderAttribute("MessageIdHeader",
Direction=SoapHeaderDirection.Out)]
[SoapHeader("unknownHeaders")]
[SoapDocumentMethod(RequestNamespace=CardRequestNam espace.June2004,
RequestElementName=GetCardsRequest.REQUEST_ELEMENT _NAME,
ResponseNamespace=CardResponseNamespace.June2004,
ResponseElementName=GetCardsResponse.RESPONSE_ELEM ENT_NAME)]
public GetCardsResponse[] GetCards(GetCardsRequest getCardsRequest)
{
}
This works fine with a WebSphere client. Now, I've added another field
to the GetCardsResponse class and this breaks the client as their
existing client can't deserialize this new element without regenerating
their proxies.
We decided to create a derived class (GetCardsResponseV2) and return
the base or the derived class based on the request.
To this end, I added this attribute:
[System.Xml.Serialization.XmlInclude(typeof(GetCard sResponseV2))]
I preferred this over SoapInclude as I've read in other postings that
it doesn't work (contrary to Microsoft's advice to use either of
these).
But I was not able to see the derived class in the WSDL. A few trials
later, I realized that commenting out the ResponseNamespace element in
the SoapDocumentMethod attribute makes this work. Now, I can see the
base and derived classes in the WSDL, but I've lost the namespace and
this is essential to the existing clients.
The base and derived classes do not have any attributes on them, but
their fields have the XmlElement attributes on them.
Am I missing something something here? Is there another attribute that
I can place so that XmlInclude and ResponseNamespace can coexist?
Any insight you may have qould be useful. Thanks.
BG.