So far I've had success writing a handful of SOE methods that take parameters that are simple types (string and string array) and return my own custom, multi-level types (e.g. Customer, with an array of Address objects, etc.).Now, what I would like to do is write an SOE method that accepts my own complex type(s) as its parameters, e.g. something like CustomerSearch, that accepts a custom Query object that defines the criteria to filter results by.Everything seems to be fine up until the point where I attempt to deserialize the incoming request parameter as an instance of the Query class. For example, inside the HandleSoapMessage method of my SOE class implementation, I try the following:public void HandleSoapMessage(IMessage request, IMessage response)
{
int parameterIndex = Utility.FindFieldIndex("inputQuery", request.Parameters, true);
parameterIndex = Utility.FindFieldIndex("inputQuery", request.Parameters, true);
Query query = (Query)request.Parameters.GetObject(parameterIndex, "http://www.mynamespace.com", "Query");
.
.
.
}
parameterIndex correctly points to the first index in the set of request parameters where the "inputQuery" definition resides, but the following exception is thrown during the call to GetObject:"Exception from HRESULT: 0x80043068"A little searching reveals that the 0x80043068 code corresponds to the more usable message, "XML_SERIALIZE_E_CANT_MAP_XMLTYPE_TO_CLASS"So, there was a problem mapping between the "Query" type defined in my WSDL and my concrete "Query" class. I decided to start small by defining only a single string attribute off the Query object, but I still receive the same error.I replaced my usage of "Query" throughout with an ESRI type, "PointN", and I was able to deserialize the incoming data as IPoint using the same GetObject method. I also inspected the actual SOAP requests, comparing between the request that used "Query" and the request where I experimented with "PointN", and did not notice any obvious problem. See request comparisons below (note that the sole string property on "Query" is called "Test":<?xml version="1.0" encoding="utf-8" ?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.mynamespace.com" xmlns:esri="http://www.esri.com/schemas/ArcGIS/10.0"><soap:Body><tns:CustomerSearch><ns1:inputQuery xmlns:ns1=""><ns1:Test>Test Text</ns1:Test></ns1:inputQuery></tns:CustomerSearch></soap:Body></soap:Envelope>
<?xml version="1.0" encoding="utf-8" ?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.mynamespace.com" xmlns:esri="http://www.esri.com/schemas/ArcGIS/10.0"><soap:Body><tns:CustomerSearch><ns1:inputPoint xmlns:ns1=""><ns1:X>0</ns1:X><ns1:Y>0</ns1:Y></ns1:inputPoint></tns:CustomerSearch></soap:Body></soap:Envelope>
This post is getting long, so I will finish by saying that the "Query" definition in my SOE WSDL correctly matches the COM-visible "Query" class that implements the IXMLSerialize interface, with both the Deserialize and Serialize methods accounting for the dummy "Test" string attribute. I've also made doubly sure that my XmlSupport mapping file in the ArcGIS Server "XmlClassRegistry" folder (and sub-folder) correctly maps the "Query" XML type with the CSLID of the Query class.I hope there is an SOE guru out there that can see where I am going wrong, or let me at least know if custom types as SOAP SOE input parameters is even supported.Any help would be hugely appreciated!