Server Object Extension (SOE) - XmlClassRegistry Files Not Used?

2356
10
01-11-2011 06:15 AM
ErinBrimhall
Occasional Contributor II
I have followed the basic example for creating a SOAP Server Object Extension (SOE) using the walkthrough provided by ESRI, but have encountered a problem:



[INDENT]It appears that ArcGIS Server is not looking in the "XmlClassRegistry" folder/sub-folders for files defining mappings between custom XML and COM-visible types.

The effect is that any attempt to deserialize an XML type as its corresponding COM class fails with "Exception from HRESULT: 0x80043068" (XML_SERIALIZE_E_CANT_MAP_XMLTYPE_TO_CLASS).

If the custom XML/COM type mapping definitions are moved to the "XmlSupport.dat" that ArcGIS Server uses to map ESRI types, then the custom types can be correctly deserialized.
[/INDENT]



Is there a defect in ArcGIS Server related to custom type deserialization, or is the SOAP SOE walkthrough incomplete in this regard?

Any help would be greatly appreciated!

Thanks
10 Replies
JerryGarcia
Occasional Contributor II
I am having this same problem.  Can someone at ESRI comment?  Who created this sample?

I have followed the basic example for creating a SOAP Server Object Extension (SOE) using the walkthrough provided by ESRI, but have encountered a problem:



[INDENT]It appears that ArcGIS Server is not looking in the "XmlClassRegistry" folder/sub-folders for files defining mappings between custom XML and COM-visible types.

The effect is that any attempt to deserialize an XML type as its corresponding COM class fails with "Exception from HRESULT: 0x80043068" (XML_SERIALIZE_E_CANT_MAP_XMLTYPE_TO_CLASS).

If the custom XML/COM type mapping definitions are moved to the "XmlSupport.dat" that ArcGIS Server uses to map ESRI types, then the custom types can be correctly deserialized.
[/INDENT]



Is there a defect in ArcGIS Server related to custom type deserialization, or is the SOAP SOE walkthrough incomplete in this regard?

Any help would be greatly appreciated!

Thanks
0 Kudos
Kevin_FernandoEscalera_Robles
New Contributor III
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?

I am having this same problem.  Can someone at ESRI comment?  Who created this sample?
0 Kudos
RichardWatson
Frequent Contributor
If the ESRI sample does not work out of the box then my suggestion is to file an incident with ESRI support.

It should be really easy for them to reproduce, right?
0 Kudos
MiroslavVladár
New Contributor
Still no answer? I have same problem. Can anyone help? Thanks
0 Kudos
siyufan
New Contributor
Does anyone have any solutions for this problem on ArcGIS Server 10.2?

I began pulling my hair out and trying every possible thing. Nothing was working....

THanks!!!
0 Kudos
ErinBrimhall
Occasional Contributor II
Lots of info in this thread.

When I originally had this problem (at Arc 10.0), I believe it was attributed to my XML type-mapping file being in the wrong folder.  The correct folder would be something like:


[INDENT]C:\Program Files\Common Files\ArcGIS\Server10.2\XmlClassRegistry\YourOrganizationName\[/INDENT]


The second time I had this problem (at Arc 10.1), it was related to the registering of my custom types.  See NIM083300.
0 Kudos
siyufan
New Contributor
Lots of info in this thread.

When I originally had this problem (at Arc 10.0), I believe it was attributed to my XML type-mapping file being in the wrong folder.  The correct folder would be something like:


[INDENT]C:\Program Files\Common Files\ArcGIS\Server10.2\XmlClassRegistry\YourOrganizationName\[/INDENT]


The second time I had this problem (at Arc 10.1), it was related to the registering of my custom types.  See NIM083300.




Thanks for your reply ,ebrimhall.
I tried register the dll file with the command "C:\Windows\Microsoft.NET\Framework64\v2.0.50727\regasm.exe /codebase " with 64bit regasm, and it showed "Type registered successfully"
But when I try to deserialize the params, the same error shows up.
And the XML type-mapping file is also in XmlClassRegistry folder....
BTW, I am using ArcGIS 10.2
0 Kudos
siyufan
New Contributor
Just in case someone else will have the same prblm.
I am still have this issue to deserialize the custom type by IXMLdeserialize function.

Then I use the following function to get the passing in xml. and create an xml parse function by myself.

public static string Read(this IMessage message)
{
  string xml;
  XMLStreamClass xmlStream = new XMLStreamClass();
  message.WriteXML(xmlStream);
  xml = xmlStream.SaveToString();

  return xml;
}

Thanks for the help, ebrimhall!
0 Kudos
ErinBrimhall
Occasional Contributor II
Hi fans,

That's unfortunate you're having to manually read and deserialize the XML.  At least you know that will work.

I have not gotten so far as to verify that this XML object deserialization works at 10.2, but I can share the results soon.  In general, I've seen problems with this functionality stem from the following areas:


  1. XML type mapping file is missing or in the wrong location.

  2. XML type mapping file is malformed or has some other error.

  3. Custom type class has a problem in its Deserialize method.

  4. Custom type defined in SOE WSDL has an error or in some way does not align with the corresponding class.


It's challenging to pinpoint which of the above, if any, could be causing a problem.  I typically start with the simplest implementation (e.g. a custom type with a single string attribute) and ramp things up from there.

Like I said, I will be making the jump to 10.2 soon and update this thread with my progress.
0 Kudos