<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SOAP Server Object Extension (SOE) - how to deserialize custom types? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370014#M9731</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;**UPDATE**&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After much experimenting, the problem seems to stem from the call to GetObject being limited to whatever XML / COM-visible type mappings are defined in the ESRI-specific XmlSupport.dat file located in the "bin" folder of the ArcGIS Server install folder.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In other words, my custom XML / COM-visible type mapping file in the XmlClassRegistry folder never seems to be used.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was able to verify this by copying my type-mapping snippet into XmlSupport.dat, after which the call to GetObject on the SOAP request worked successfully for my custom "Query" type.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Per the ESRI &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/SOAP_Web_services/000100000mpw000000/"&gt;SOAP SOE walkthrough&lt;/A&gt;&lt;SPAN&gt; I created the appropriate folders and dropped the specially named mapping file in them. The full path of the custom XML support file is:&amp;nbsp; C:\Program Files (x86)\ArcGIS\Server10.0\XmlClassRegistry\MyCompany\XmlSupportMyProject.dat&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the next question is, why isn't ArcGIS Server looking to my custom type mapping file during calls to GetObject?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Jan 2011 21:41:17 GMT</pubDate>
    <dc:creator>ErinBrimhall</dc:creator>
    <dc:date>2011-01-04T21:41:17Z</dc:date>
    <item>
      <title>SOAP Server Object Extension (SOE) - how to deserialize custom types?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370013#M9730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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.).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, inside the HandleSoapMessage method of my SOE class implementation, I try the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;public void HandleSoapMessage(IMessage request, IMessage response)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; int parameterIndex = Utility.FindFieldIndex("inputQuery", request.Parameters, true);

&amp;nbsp;&amp;nbsp;&amp;nbsp; parameterIndex = Utility.FindFieldIndex("inputQuery", request.Parameters, true);
&amp;nbsp;&amp;nbsp;&amp;nbsp; Query query = (Query)request.Parameters.GetObject(parameterIndex, "http://www.mynamespace.com", "Query");

&amp;nbsp;&amp;nbsp;&amp;nbsp; .
&amp;nbsp;&amp;nbsp;&amp;nbsp; .
&amp;nbsp;&amp;nbsp;&amp;nbsp; .
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"Exception from HRESULT: 0x80043068"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A little searching reveals that the 0x80043068 code corresponds to the more usable message, "XML_SERIALIZE_E_CANT_MAP_XMLTYPE_TO_CLASS"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, there was a problem mapping between the "Query" type defined in my WSDL and my concrete "Query" class.&amp;nbsp; I decided to start small by defining only a single string attribute off the Query object, but I still receive the same error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&amp;nbsp; 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.&amp;nbsp; See request comparisons below (note that the sole string property on "Query" is called "Test":&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&amp;lt;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"&amp;gt;&amp;lt;soap:Body&amp;gt;&amp;lt;tns:CustomerSearch&amp;gt;&amp;lt;ns1:inputQuery xmlns:ns1=""&amp;gt;&amp;lt;ns1:Test&amp;gt;Test Text&amp;lt;/ns1:Test&amp;gt;&amp;lt;/ns1:inputQuery&amp;gt;&amp;lt;/tns:CustomerSearch&amp;gt;&amp;lt;/soap:Body&amp;gt;&amp;lt;/soap:Envelope&amp;gt;


&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&amp;lt;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"&amp;gt;&amp;lt;soap:Body&amp;gt;&amp;lt;tns:CustomerSearch&amp;gt;&amp;lt;ns1:inputPoint xmlns:ns1=""&amp;gt;&amp;lt;ns1:X&amp;gt;0&amp;lt;/ns1:X&amp;gt;&amp;lt;ns1:Y&amp;gt;0&amp;lt;/ns1:Y&amp;gt;&amp;lt;/ns1:inputPoint&amp;gt;&amp;lt;/tns:CustomerSearch&amp;gt;&amp;lt;/soap:Body&amp;gt;&amp;lt;/soap:Envelope&amp;gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be hugely appreciated!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 18:23:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370013#M9730</guid>
      <dc:creator>ErinBrimhall</dc:creator>
      <dc:date>2011-01-04T18:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: SOAP Server Object Extension (SOE) - how to deserialize custom types?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370014#M9731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;**UPDATE**&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After much experimenting, the problem seems to stem from the call to GetObject being limited to whatever XML / COM-visible type mappings are defined in the ESRI-specific XmlSupport.dat file located in the "bin" folder of the ArcGIS Server install folder.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In other words, my custom XML / COM-visible type mapping file in the XmlClassRegistry folder never seems to be used.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was able to verify this by copying my type-mapping snippet into XmlSupport.dat, after which the call to GetObject on the SOAP request worked successfully for my custom "Query" type.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Per the ESRI &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/SOAP_Web_services/000100000mpw000000/"&gt;SOAP SOE walkthrough&lt;/A&gt;&lt;SPAN&gt; I created the appropriate folders and dropped the specially named mapping file in them. The full path of the custom XML support file is:&amp;nbsp; C:\Program Files (x86)\ArcGIS\Server10.0\XmlClassRegistry\MyCompany\XmlSupportMyProject.dat&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the next question is, why isn't ArcGIS Server looking to my custom type mapping file during calls to GetObject?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 21:41:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370014#M9731</guid>
      <dc:creator>ErinBrimhall</dc:creator>
      <dc:date>2011-01-04T21:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: SOAP Server Object Extension (SOE) - how to deserialize custom types?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370015#M9732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So, no answer about it??, I have the same problem, I can't use a custom type for a parameter, did any one find a solution for this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;**UPDATE**&lt;BR /&gt;&lt;BR /&gt;After much experimenting, the problem seems to stem from the call to GetObject being limited to whatever XML / COM-visible type mappings are defined in the ESRI-specific XmlSupport.dat file located in the "bin" folder of the ArcGIS Server install folder.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;In other words, my custom XML / COM-visible type mapping file in the XmlClassRegistry folder never seems to be used.&lt;BR /&gt;&lt;BR /&gt;I was able to verify this by copying my type-mapping snippet into XmlSupport.dat, after which the call to GetObject on the SOAP request worked successfully for my custom "Query" type.&lt;BR /&gt;&lt;BR /&gt;Per the ESRI &lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/SOAP_Web_services/000100000mpw000000/"&gt;SOAP SOE walkthrough&lt;/A&gt; I created the appropriate folders and dropped the specially named mapping file in them. The full path of the custom XML support file is:&amp;nbsp; C:\Program Files (x86)\ArcGIS\Server10.0\XmlClassRegistry\MyCompany\XmlSupportMyProject.dat&lt;BR /&gt;&lt;BR /&gt;So the next question is, why isn't ArcGIS Server looking to my custom type mapping file during calls to GetObject?&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 01:36:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370015#M9732</guid>
      <dc:creator>Kevin_FernandoEscalera_Robles</dc:creator>
      <dc:date>2012-03-26T01:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: SOAP Server Object Extension (SOE) - how to deserialize custom types?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370016#M9733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Kevin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's been a while, but I believe the problem turned out to be that my custom XML-type file was not in the correct folder.&amp;nbsp; It should be in:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Program Files (x86)\&lt;/SPAN&gt;&lt;STRONG style=": ; font-size: 2; text-decoration: underline;"&gt;Common Files&lt;/STRONG&gt;&lt;SPAN&gt;\ArcGIS\Server 10.0\XmlClassRegistery\SomeCompanyName&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I somehow missed the "Common Files" folder and was putting the file in the wrong location.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, be sure to recycle the ArcSOM/ArcSOC windows services after copying your XML-types file or making changes to it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 14:36:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370016#M9733</guid>
      <dc:creator>ErinBrimhall</dc:creator>
      <dc:date>2012-04-18T14:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: SOAP Server Object Extension (SOE) - how to deserialize custom types?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370017#M9734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have same problem, but with ArcGis Server 10.1, and i cant find XmlClassRegistry folder. Is somethink changed in Server 10.1 ? Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Aug 2012 08:58:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370017#M9734</guid>
      <dc:creator>MiroslavVladár</dc:creator>
      <dc:date>2012-08-12T08:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: SOAP Server Object Extension (SOE) - how to deserialize custom types?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370018#M9735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I have same problem, but with ArcGis Server 10.1, and i cant find XmlClassRegistry folder. Is somethink changed in Server 10.1 ? Thanks&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The XmlClassRegistry folder is not created automatically when ArcGIS Server is installed.&amp;nbsp; You will need to manually create any missing folders in the full path:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Program Files\Common Files\ArcGIS\Server10.1\XmlClassRegistry\YourOrganizationName\&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, be aware that there is a known bug with custom type deserialization in 10.1.&amp;nbsp; See NIM083300.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2012 00:03:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370018#M9735</guid>
      <dc:creator>ErinBrimhall</dc:creator>
      <dc:date>2012-09-27T00:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: SOAP Server Object Extension (SOE) - how to deserialize custom types?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370019#M9736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Erin, the originator of this thread, writes that a SOAP SOE was written that successfully sends an array of strings as input. I have a working SOAP SOE that takes a custom type but have had no luck with sending arrays (either with my custom type or even with simple types). Does any one know of samples out there that show the correct syntax for this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 18:06:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370019#M9736</guid>
      <dc:creator>TomTyndall</dc:creator>
      <dc:date>2012-11-21T18:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: SOAP Server Object Extension (SOE) - how to deserialize custom types?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370020#M9737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Erin, the originator of this thread, writes that a SOAP SOE was written that successfully sends an array of strings as input. I have a working SOAP SOE that takes a custom type but have had no luck with sending arrays (either with my custom type or even with simple types). Does any one know of samples out there that show the correct syntax for this?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tom,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While I do not know of any online samples, I can at least provide you a few code snippets to illustrate how to use arrays as SOE method inputs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The first snippet is from the hand-rolled WSDL for the SOE.&amp;nbsp; It demonstrates how to define a SOAP method with a string array input parameter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;xs:element name="GetStuffByStringArray"&amp;gt;
&amp;nbsp; &amp;lt;xs:complexType&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:sequence&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element name="aStringArray" type="ArrayOfString" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:sequence&amp;gt;
&amp;nbsp; &amp;lt;/xs:complexType&amp;gt;
&amp;lt;/xs:element&amp;gt;
&amp;lt;xs:element name="GetStuffByStringArrayResponse"&amp;gt;
&amp;nbsp; &amp;lt;xs:complexType&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:sequence&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element name="resultString" type="xs:string" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:sequence&amp;gt;
&amp;nbsp; &amp;lt;/xs:complexType&amp;gt;
&amp;lt;/xs:element&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note that &lt;/SPAN&gt;&lt;STRONG&gt;ArrayOfString&lt;/STRONG&gt;&lt;SPAN&gt; is an XML type defined in the Esri namespace.&amp;nbsp; On the ArcObjects side, this XML type can be translated as an &lt;/SPAN&gt;&lt;STRONG&gt;IStringArray&lt;/STRONG&gt;&lt;SPAN&gt; object as demonstrated in the code block below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
private void GetStuffByStringArray(IMessage request, IMessage response)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Begin by parsing the string array from the request parameter.
&amp;nbsp;&amp;nbsp;&amp;nbsp; IStringArray stringCollection;

&amp;nbsp;&amp;nbsp;&amp;nbsp; int fieldIndex = Utility.FindFieldIndex("aStringArray", request.Parameters, true);
&amp;nbsp;&amp;nbsp;&amp;nbsp; stringCollection = request.Parameters.GetObject(fieldIndex, Utility.EsriNamespace, "ArrayOfString") as IStringArray;

&amp;nbsp;&amp;nbsp;&amp;nbsp; // Do something with the string values...
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Creating an SOE method that takes an array of custom type objects involves a bit more work.&amp;nbsp; I'm happy to provide more detail but here are the essential concepts:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Create a new class (e.g. MyTypeCollection) that is derived from &lt;/SPAN&gt;&lt;STRONG&gt;SerializableList&amp;lt;T&amp;gt;&lt;/STRONG&gt;&lt;SPAN&gt; where T is your custom type that you want to pass a collection of.&amp;nbsp; This collection class will be the type that the SOAP parameter can be deserialized into.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Define a corresponding XML type for MyTypeCollection.&amp;nbsp; It will look something like the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;xs:complexType name="MyTypeCollection"&amp;gt;
&amp;nbsp; &amp;lt;xs:sequence&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element minOccurs="0"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxOccurs="unbounded"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="MyType"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type="tns:MyType"/&amp;gt;
&amp;nbsp; &amp;lt;/xs:sequence&amp;gt;
&amp;lt;/xs:complexType&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3) Then, in your SOE code itself, deserialize the input parameter using code similar to the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
MyTypeCollection collection = new MyTypeCollection();
int fieldIndex = Utility.FindFieldIndex("myTypeCollectionInput", request.Parameters, true);
collection = request.Parameters.GetObject(fieldIndex, Utility.CustomTypesNamespace, "MyTypeCollection ") as MyTypeCollection;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note that your custom types/classes will need to implement the Deserialize and Serialize methods of the IXMLSerialize interface, and each custom type will need an entry in your XML type mapping file.&amp;nbsp; Those topics are covered in detail in Esri's SOE samples.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:09:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370020#M9737</guid>
      <dc:creator>ErinBrimhall</dc:creator>
      <dc:date>2021-12-11T17:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: SOAP Server Object Extension (SOE) - how to deserialize custom types?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370021#M9738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Erin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your response and your carefully written questions and responses on this thread - they've helped me digest the many layers of abstraction that go along with SOAP SOE's (difficult, even with having experience writing REST SOE's).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I now have an SOE working that has methods for passing in string, string[] and a custom type and outputting string, string[] and arrays of custom types but still have been unsuccessful writing a method that takes an array of custom types as input. The critical parts of my code are listed below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;wsdl&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;xs:element name="TestArrayArguments"&amp;gt;
&amp;nbsp; &amp;lt;xs:complexType&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:sequence&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element name="aCustomTypeCollection" type="tns:MyCustomTypeCollection" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:sequence&amp;gt;
&amp;nbsp; &amp;lt;/xs:complexType&amp;gt;
&amp;lt;/xs:element&amp;gt;
&amp;nbsp; 
&amp;lt;xs:complexType name="MyCustomTypeCollection"&amp;gt;
&amp;nbsp; &amp;lt;xs:sequence&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element minOccurs="0" maxOccurs="unbounded" name="MyCustomType" type="tns:MyCustomType"/&amp;gt;
&amp;nbsp; &amp;lt;/xs:sequence&amp;gt;
&amp;lt;/xs:complexType&amp;gt;

&amp;lt;xs:complexType name="MyCustomType"&amp;gt;
&amp;nbsp; &amp;lt;xs:sequence&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element name="ID" type="xs:string"/&amp;gt;
&amp;nbsp; &amp;lt;/xs:sequence&amp;gt;
&amp;lt;/xs:complexType&amp;gt;

&amp;lt;xs:element name="TestArrayArgumentsResponse"&amp;gt;
&amp;nbsp; &amp;lt;xs:complexType&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:sequence&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element name="Result" type="xs:string" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:sequence&amp;gt;
&amp;nbsp; &amp;lt;/xs:complexType&amp;gt;
&amp;lt;/xs:element&amp;gt;

&amp;lt;message name="TestArrayArgumentsIn"&amp;gt;
&amp;nbsp; &amp;lt;part name="parameters" element="e:TestArrayArguments" /&amp;gt;
&amp;lt;/message&amp;gt;
&amp;lt;message name="TestArrayArgumentsOut"&amp;gt;
&amp;nbsp; &amp;lt;part name="parameters" element="e:TestArrayArgumentsResponse" /&amp;gt;
&amp;lt;/message&amp;gt;
&amp;nbsp; 
&amp;lt;operation name="TestArrayArguments"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input message="e:TestArrayArgumentsIn" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;output message="e:TestArrayArgumentsOut" /&amp;gt;
&amp;nbsp; &amp;lt;/operation&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;server side SOE code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
private void TestArrayArguments(IMessage reqMsg, IMessage respMsg)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; IXMLSerializeData reqParams = reqMsg.Parameters;
&amp;nbsp;&amp;nbsp;&amp;nbsp; string retString = "";

&amp;nbsp;&amp;nbsp;&amp;nbsp; int idx = reqParams.Find("aCustomTypeCollection");
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (idx == -1)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new ArgumentNullException("PROBLEM MAPPING FIELD TO INDEX");


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retString += "field index is " + idx;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyCustomTypeCollection myTypeColl = (MyCustomTypeCollection)reqParams.GetObject(idx, c_ns_soe, "MyCustomTypeCollection");


&amp;nbsp;&amp;nbsp;&amp;nbsp; respMsg.Name = "TestArrayArgumentsResponse";
&amp;nbsp;&amp;nbsp;&amp;nbsp; respMsg.NamespaceURI = c_ns_soe;
&amp;nbsp;&amp;nbsp;&amp;nbsp; respMsg.Parameters.AddString("Result", retString);
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My custom types:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
using System;
using System.Runtime.InteropServices;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.SOESupport;


namespace SoapSOE1
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; [ComVisible(true)]
&amp;nbsp;&amp;nbsp;&amp;nbsp; [Guid("FCA9A8B6-4B78-45CB-B240-AEA7A6E2F489")]
&amp;nbsp;&amp;nbsp;&amp;nbsp; [ClassInterface(ClassInterfaceType.None)]
&amp;nbsp;&amp;nbsp;&amp;nbsp; public class MyCustomType : IXMLSerialize
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string ID { get; set; }


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void Serialize(IXMLSerializeData data)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data.TypeName = this.GetType().Name;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data.TypeNamespaceURI = SoapSOE1.c_ns_soe;


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data.AddString("ID", ID);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void Deserialize(IXMLSerializeData data)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int idx = FindMandatoryParam("ID", data);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.ID = data.GetString(idx);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private int FindMandatoryParam(string fieldName, IXMLSerializeData data)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int idx = data.Find(fieldName);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (idx == -1)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new MissingMandatoryFieldException(fieldName);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return idx;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal class MissingMandatoryFieldException : Exception
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal MissingMandatoryFieldException(string fieldName) : base("Missing mandatory field: " + fieldName) { }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }




&amp;nbsp;&amp;nbsp;&amp;nbsp; [ComVisible(true)]
&amp;nbsp;&amp;nbsp;&amp;nbsp; [Guid("D2BC82CA-F8C5-46AD-BFD6-0B80760A351E")]
&amp;nbsp;&amp;nbsp;&amp;nbsp; [ClassInterface(ClassInterfaceType.None)]
&amp;nbsp;&amp;nbsp;&amp;nbsp; public class MyCustomTypeCollection : SerializableList&amp;lt;MyCustomType&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public MyCustomTypeCollection(string namespaceURI) : base(namespaceURI) { }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've carefully constructed my XmlSupportAdot.dat file (everything works if I just send an instance of my custom type and not an array so I know this file is getting seen).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've registered my dll on the server as described in NIM083300.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm getting the same "Exception from HRESULT: 0x80043068" you describe when executing the GetObject call. If I comment out that line I get no error and can see that the field is correctly mapped to index zero. At this point I'm not trying to access the contents of the input array, I'm just trying to instantiate MyCustomTypeCollection using the GetObject call.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attached is a snapshot of the HTTP calls taking place when I try to invoke the SOE method from a client.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]19719[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd greatly appreciate any suggestions you may have. Have you been successful in doing this before?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your time,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AZ Dept of Transportation&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:09:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370021#M9738</guid>
      <dc:creator>TomTyndall</dc:creator>
      <dc:date>2021-12-11T17:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: SOAP Server Object Extension (SOE) - how to deserialize custom types?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370022#M9739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;I've carefully constructed my XmlSupportAdot.dat file (everything works if I just send an instance of my custom type and not an array so I know this file is getting seen).&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there an entry in your &lt;/SPAN&gt;&lt;STRONG&gt;XmlSupportAdot.dat&lt;/STRONG&gt;&lt;SPAN&gt; file for the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;&lt;STRONG&gt;MyCustomTypeCollection&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt; class?&amp;nbsp; Sounds like there most likely is but I wanted to confirm.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Beyond that, all the code examples you shared look correct to me.&amp;nbsp; There are a few minor differences between your prototype and the code I've developed:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;P align="right"&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;I only have a parameterless constructor for my Collection class (and pass a static namespace value to the base constructor).&lt;/LI&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;LI&gt;&amp;nbsp; The Collection object that is passed to my SOE methods is actually an attribute of a different custom class; I don't pass the Collection object by itself.&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With that said, I don't believe either of these differences would cause the classic deserialization error you're seeing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll take another look at your post and let you know if I can come up with any other ideas.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 19:10:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370022#M9739</guid>
      <dc:creator>ErinBrimhall</dc:creator>
      <dc:date>2012-12-05T19:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: SOAP Server Object Extension (SOE) - how to deserialize custom types?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370023#M9740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I do have an entry in XmlSupportAdot.dat for MyCustomTypeCollection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I modified the constructor on my collection class to also use a static string and I do have a change of behaviour - I'm now getting invalid cast exception. I'll have to play around with this more to see what is happening.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]19734[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since I have been able to get a working method that I can pass a custom object to, I also considered passing the collection as an attribute on a custom object but got bogged down in the wsdl syntax and the serialize/deserialize code for that scenario. Do you have any examples of what that looks like?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 21:01:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370023#M9740</guid>
      <dc:creator>TomTyndall</dc:creator>
      <dc:date>2012-12-05T21:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: SOAP Server Object Extension (SOE) - how to deserialize custom types?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370024#M9741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you able to actively debug your SOE as it runs?&amp;nbsp; My guess is that the cast-exception is stemming from this line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;MyCustomTypeCollection myTypeColl = (MyCustomTypeCollection)reqParams.GetObject(idx, c_ns_soe, "MyCustomTypeCollection");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;should &lt;/SPAN&gt;&lt;SPAN&gt;be equivalent to what you already have, but you can also try using type attributes instead of hard-coding the "MyCustomTypeCollection" string.&amp;nbsp; E.g.:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;typeof(MyCustomTypeCollection).Name&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I bring this up since it was another difference I noticed after examining my code.&amp;nbsp; I'll post tomorrow an example of a custom type w/ a custom type collection attribute.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 21:59:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370024#M9741</guid>
      <dc:creator>ErinBrimhall</dc:creator>
      <dc:date>2012-12-05T21:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: SOAP Server Object Extension (SOE) - how to deserialize custom types?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370025#M9742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No, I don't have a working debugger; ArcGIS Server is on a different machine than my development workstation. I have been logging for debugging.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using the runtime type name without any other casting still doesn't work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
logger.LogMessage(ServerLogger.msgType.warning, "segment extraction", -1, typeof(MyCustomTypeCollection).Name);
object myTypeColl = reqParams.GetObject(idx, c_ns_soe, typeof(MyCustomTypeCollection).Name);
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Logger output:&amp;nbsp; [ATTACH=CONFIG]19783[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Comment out that GetObject call and it runs without problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My xml/soap comfort level is not that high and I get tangled up in namespace issues but I was thinking more about the change in behavior (throwing a invalid cast instead of the HRESULT: 0x80043068 error)when going from a passed in namespace&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
public MyCustomTypeCollection(string namespaceURI) : base(namespaceURI) { }
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to a hardcoded one&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
public MyCustomTypeCollection() : base("http://www.myOrg.com/schemas/1.0") { }
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the "passed in" case ArcGIS Server is supplying the namespace when instantiating MyCustomTypeCollection. How is the namespace being set when it instantiates the MyCustomType's contained in that collection?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I order to get something up and running now I rewrote the service to take a string and I have the client build a delimited string of the MyCustomType payload data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for the help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:09:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370025#M9742</guid>
      <dc:creator>TomTyndall</dc:creator>
      <dc:date>2021-12-11T17:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: SOAP Server Object Extension (SOE) - how to deserialize custom types?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370026#M9743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I wanted to see what ArcGIS Server was actually passing into the MyCustomTypeCollection constructor and I believe the answer is nothing. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
public MyCustomTypeCollection(string namespaceURI) : base(namespaceURI)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SoapSOE1.logger.LogMessage(ServerLogger.msgType.warning, "collection constructor", -1, namespaceURI);
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The construction fails (see image of log) and I'm assuming that is because Server is trying to invoke a no parameter constructor and not finding one; hence the behavior change outlined in the previous post when changing to a hard coded namespace. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]19787[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I got that pattern from the CustomLayerInfos constructor in ESRI's FindNearFeaturesSoapSOE sample. That CustomLayerInfos object is a Server output though, not an input so apparently that idiom only applies to outputs of a soap service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;TT&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:09:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370026#M9743</guid>
      <dc:creator>TomTyndall</dc:creator>
      <dc:date>2021-12-11T17:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: SOAP Server Object Extension (SOE) - how to deserialize custom types?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370027#M9744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Tom,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
public MyCustomTypeCollection(string namespaceURI) : base(namespaceURI) { }
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;In the "passed in" case ArcGIS Server is supplying the namespace when instantiating MyCustomTypeCollection. How is the namespace being set when it instantiates the MyCustomType's contained in that collection?&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I haven't verified this but I always assumed the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;typeNamespace&lt;/SPAN&gt;&lt;SPAN&gt; parameter of the GetObject method was ultimately passed all the way through to the collection type's constructor.&amp;nbsp; Regardless, I can definitely confirm that the parameterless-constructor w/ a static/hard-coded namespace value passed to the base constructor works fine in both AGS 10.0 and 10.1.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;No, I don't have a working debugger; ArcGIS Server is on a different machine than my development workstation. I have been logging for debugging.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This makes troubleshooting more challenging.&amp;nbsp; Even with the ability to develop and debug locally on the server, it still took me several days to work through all the deserialization issues in 10.1 and correctly implement the workaround (as described in &lt;/SPAN&gt;&lt;A href="http://support.esri.com/en/bugs/nimbus/TklNMDgzMzAw" rel="nofollow noopener noreferrer" target="_blank"&gt;NIM-083300&lt;/A&gt;&lt;SPAN&gt;).&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you performing the 64-bit regasm.exe assembly registration each time you rebuild and redeploy your SOE code?&amp;nbsp; I would also highly recommend developing on the server if that option is available to you.&amp;nbsp; The reasons for some of the tougher issues I ran into were not apparent until I was able to actively debug the SOE.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One last quick set of thoughts and things to try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt; The fact that you can pass a single custom type object as an input parameter to an SOE method tells me that your namespaces, XML type-mapping file, and SOE assembly registration (i.e. w/ the 64-bit version of regasm.exe) are correct.&lt;/LI&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;LI&gt; You are inspecting the SOAP message you send, but it might also be a good idea to inspect that message once it reaches the SOE.&amp;nbsp; The code snippet below will help support that:&lt;/LI&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
public static string Read(this IMessage message)
{
&amp;nbsp; string xml;
&amp;nbsp; XMLStreamClass xmlStream = new XMLStreamClass();
&amp;nbsp; message.WriteXML(xmlStream);
&amp;nbsp; xml = xmlStream.SaveToString();

&amp;nbsp; return xml;
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;LI&gt; You may want to try just working with your collection type directly in the SOE, e.g. explicitly instantiate a collection object, add items to it, cast it, etc., just to make sure it is a valid class at runtime.&amp;nbsp; I ran into a situation where multiple versions of my assemblies were somehow being registered, which was causing type conflict errors that were being swallowed unless I was actively debugging the code.&amp;nbsp; &lt;/LI&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;LI&gt; Add some logging inside the Deserialize method of the "MyCustomType" class.&amp;nbsp; This method will be called for each object that was passed in the collection, so writing to the log from here will give you an idea if the code is even making it this far or if the "invalid cast exception" is being thrown earlier.&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:09:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370027#M9744</guid>
      <dc:creator>ErinBrimhall</dc:creator>
      <dc:date>2021-12-11T17:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: SOAP Server Object Extension (SOE) - how to deserialize custom types?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370028#M9745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having same issue in 10.3, I tried the steps above and they do not fix the problem, does anyone have a fix for this in 10.3?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 16:28:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/soap-server-object-extension-soe-how-to/m-p/370028#M9745</guid>
      <dc:creator>DanaFernandez</dc:creator>
      <dc:date>2015-03-30T16:28:08Z</dc:date>
    </item>
  </channel>
</rss>

