ArcGIS Enterprise SDK
How to migrate a .NET SOE to ArcGIS Enterprise SDK (ArcGIS Enterprise SDK)
ArcGIS Enterprise SDK Developer Help > Developing Extensions with ArcGIS Enterprise SDK > Developing with .NET > Migrating Extensions > How to migrate a .NET SOE to ArcGIS Enterprise SDK (ArcGIS Enterprise SDK)

Walkthrough : Migrate a ArcObjects .NET SOE to an ArcGIS Enterprise SDK .NET SOE


Summary
This topic walks you through the exact steps needed to migrate SOE from ArcObject .NET SDK to the ArcGIS Enterprise SDK.

In this topic


Migrate an ArcObjects .NET SOE to an ArcGIS Enterprise SDK .NET SOE

Migrating an SOE that was created using the ArcObjects SDK for .NET requires that you copy most of your SOE code into the latest Visual Studio templates for Representational State Transfer (REST) or Simple Object Access Protocol (SOAP) SOEs. This is because the new templates contain different packaging logic to make an .soe file. The .soe file is created when you build the project.
Another advantage of the new template is that the references are already pointing at primary interop assemblies (PIAs) shipped with the SDK. If your project requires any references other than those included in the template, you need to manually add those references.
The steps for migrating an SOE created using the ArcObjects SDK for .NET are as follows:
  1. Open Visual Studio 2015/2017 and click File > New > Project.
  2. In the Installed Templates tree, expand Visual C# > ArcGIS > Server Object Extensions.
  3. At the top of the New Project dialog box, choose .NET Framework 4.5 or above from the drop-down list.
  4. Choose between the REST or SOAP templates, type a name and location for your SOE, then click OK.
  5. Add any references and directives your project requires that are not already included in the template.
  6. In the template, modify the .NET attribute ServerObjectExtension to contain the capabilities (allowed operations), description, display name, properties, and supported Web service architectures for your SOE. A C# SOE might look like the following code example:
[C#]
[ServerObjectExtension("MapServer", AllCapabilities = "GetCommonInfo;GetSecretInfo",
    DefaultCapabilities = "GetCommonInfo", Description = 
    "An example SOE for the help system", DisplayName = "My Sample SOE", Properties 
    = "PropertyA=500;PropertyB=Cities", SupportsREST = true, SupportsSOAP = false)]
  1. Copy the entire class code (but not the class declaration) from your ArcObjects .NET SOE and replace the corresponding code in the template. The boilerplate class code in the template is identical to the boilerplate class code in the template available with the ArcObjects SDK for .NET. You should remove these items if you do a complete copy and paste. You can use the most recent template and samples as a guide.
The following code example shows what you should remove and replace with your ArcObjects for .NET SOE code when migrating to an ArcGIS Enterprise SDK C# REST SOE:
[C#]
public class MySampleSOE: IServerObjectExtension, IObjectConstruct,
    IRESTRequestHandler
{
    // Delete template code and paste your 
    //   corresponding existing SOE code here.
}
If your migrated SOE has a different name than your ArcObjects .NET SOE, update the SOE name in the constructor. See the following code example:
[C#]
public MySampleSOE()
{
    soe_name = this.GetType().Name;
    logger = new ServerLogger();
    reqHandler = new SoeRestImpl(soe_name, CreateRestSchema())as IRESTRequestHandler;
}
  1. Save your solution and build your project.
  2. After you build you solution, you may receive an error such as "The type or namespace name could not be found. (Are you missing a using directive or an assembly reference?)". To resolve such errors, refer to Migration Strategies and ArcGIS Enterpsie SDK .NET Namespaces sections of this help guide.

    For example, if you receive an error stating "The type or namespace name 'IMapServer3' could not be found. (Are you missing a using directive or an assembly reference?)", change the interface name from "IMapServer3" to "IMapServer".
  3. Fix your build errors. You can refer to Migration Strategies and ArcGIS Enterpsie SDK .NET Namespaces sections of this help guide.
  4. Once all build errors are fixed, rebuild the solution. This creates an .soe file under your project's build output directory.
  5. Deploy your SOE to ArcGIS Server using the instructions in How to deploy a server object extension to ArcGIS Server.