<?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 How to use NAServer inside SOE? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-use-naserver-inside-soe/m-p/749520#M19906</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear List,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have an application that is making bulk requests to NAServer enabled on the map service. To tune and optimize the performance, we plan to consolidate all requests in a single request that should be handled by an SOE&amp;nbsp;that&amp;nbsp;would internally use NAServer for all the requests. So far I have been unable to find the path to acquire INAServer(2)`s reference from ServerObjectHelper that is passed in the init() method of SOE. Has anybody tried this before, or does the SOE need to load NA capabilities by accessing the actual MXD?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN&gt;IMapServer3&amp;nbsp;&lt;/SPAN&gt;ms = (IMapServer3) this.soHelper.getServerObject();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IServerObjectExtensionManager soeManager = new IServerObjectExtensionManagerProxy(ms);&lt;BR /&gt; IServerObjectExtension soe = soeManager.findExtensionByTypeName("NAServer"); // this is null ....tried Network Analyst, NA, NA_Server, NA_Extension&lt;BR /&gt;&lt;SPAN&gt;INAServer2&amp;nbsp;&lt;/SPAN&gt;naServer = (INAServer2)&lt;SPAN&gt;soe &lt;/SPAN&gt;; // this is NULL&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Aug 2016 14:17:17 GMT</pubDate>
    <dc:creator>ImranRajjad</dc:creator>
    <dc:date>2016-08-16T14:17:17Z</dc:date>
    <item>
      <title>How to use NAServer inside SOE?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-use-naserver-inside-soe/m-p/749520#M19906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear List,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have an application that is making bulk requests to NAServer enabled on the map service. To tune and optimize the performance, we plan to consolidate all requests in a single request that should be handled by an SOE&amp;nbsp;that&amp;nbsp;would internally use NAServer for all the requests. So far I have been unable to find the path to acquire INAServer(2)`s reference from ServerObjectHelper that is passed in the init() method of SOE. Has anybody tried this before, or does the SOE need to load NA capabilities by accessing the actual MXD?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN&gt;IMapServer3&amp;nbsp;&lt;/SPAN&gt;ms = (IMapServer3) this.soHelper.getServerObject();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IServerObjectExtensionManager soeManager = new IServerObjectExtensionManagerProxy(ms);&lt;BR /&gt; IServerObjectExtension soe = soeManager.findExtensionByTypeName("NAServer"); // this is null ....tried Network Analyst, NA, NA_Server, NA_Extension&lt;BR /&gt;&lt;SPAN&gt;INAServer2&amp;nbsp;&lt;/SPAN&gt;naServer = (INAServer2)&lt;SPAN&gt;soe &lt;/SPAN&gt;; // this is NULL&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2016 14:17:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-use-naserver-inside-soe/m-p/749520#M19906</guid>
      <dc:creator>ImranRajjad</dc:creator>
      <dc:date>2016-08-16T14:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to use NAServer inside SOE?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-use-naserver-inside-soe/m-p/749521#M19907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It turns out that above code does not work inside init() method. Reference to NAserver can be obtained by same code when run after initialization of SOE is completed. So if you want to use NAserver in a REST/SOAP operation, below method can be used to get reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;private INAServer2 getNAServerRef(){&lt;BR /&gt;&lt;BR /&gt; if(this.naServer2 != null)&lt;BR /&gt; return this.naServer2;&lt;BR /&gt; try {&lt;BR /&gt; this.naServer2 = (INAServer2)((IServerObjectExtensionManager)this.soHelper.getServerObject()).findExtensionByTypeName("NAServer") ;&lt;BR /&gt; return naServer2;&lt;BR /&gt; } catch (AutomationException e) {&lt;/P&gt;&lt;P&gt;e.printStackTrace();&lt;BR /&gt; } catch (IOException e) {&lt;/P&gt;&lt;P&gt;e.printStackTrace();&lt;BR /&gt; }&lt;BR /&gt; return naServer2;&lt;BR /&gt; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2016 09:40:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-use-naserver-inside-soe/m-p/749521#M19907</guid>
      <dc:creator>ImranRajjad</dc:creator>
      <dc:date>2016-08-18T09:40:18Z</dc:date>
    </item>
  </channel>
</rss>

