Return custom object in Server Object Extension (SOE)

2018
3
02-03-2014 05:35 AM
CarlTremblay
New Contributor
Hello all,
           Can someone show me the way to expose a custom object (for example a list of enterprise) in a Server Object Extension please.

Thank you very much.
0 Kudos
3 Replies
siyufan
New Contributor
Here is the way in SOAP SOE:

1. Create a custom class, need to inherit from IXMLSerialize

using System.Runtime.Serialization;
public class CustomOutputInfo : IXMLSerialize

eg:http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Sample_Find_near_featur...

2. Add the custom type in to the WSDL.


<xs:complexType name="CustomLayerInfo">
  <xs:sequence>
    <xs:element name="Name" type="xs:string" />
    <xs:element name="ID" type="xs:int" />
    <xs:element name="Extent" type="Envelope" />
  </xs:sequence>
</xs:complexType>

....

3. Then you can return object using this type.
respMsg.Parameters.AddObject("ReturnResult", customOutputInfo);
0 Kudos
RichardWatson
Frequent Contributor
ESRI has a number of samples for this with come with the SDK:

C:\Program Files (x86)\ArcGIS\DeveloperKit10.2\Samples\ArcObjectsNet\*SOE
0 Kudos
CarlTremblay
New Contributor
Thank you very much guys ...
0 Kudos