I am trying to call a web service that returns a custom object in the response. For e.g.
A webservice method GetPersonInfo returns a Person object.
public Person GetPersonInfo(string personId)
Person class is defined in the following manner and can return an array of address object (home address, work address etc)
public class Person
{
public string firstName;
public string lastName;
public Address[] address
}
The Address array may contain derived class of Address such as HomeAddress, WorkAddress etc.
Apparently, when I call such a web service ( I do not have access to
web service code) from biztalk, soap adapter gives the following error:
The adapter failed to transmit message going to send port
[SoapSendPort] with URL [Webservice URL]. It will be retransmitted
after the retry interval specified for this Send Port.
Details:”InvalidOperationException: There was an error generating the
XML document.
InvalidOperationException: The type HomeAddress was not expected. Use
the XmlInclude or SoapInclude attribute to specify types that are not
known statically.
I can call the same web service successfully using .net code outside of
biztalk environment. However, biztalk is unable to process the response
message from the web service.