Sunday, November 2, 2008

ArcGIS Server: Expose a custom server object extension via SOAP

Extending ArcGIS Server using ArcObjects can take two forms: a utility COM object or a server object extension. A utility COM object is simply a COM component created and managed explicitly in server context. A server object extension (SOE) is coupled with a server object and thus can share initialization, resource utilization, and disposal. Use of a COM utility has been possible since the first version of ArcGIS Server (9.0). Custom SOEs were introduced for ArcGIS Server .NET at version 9.2. ArcGIS Server Java does not offer an SOE solution at the moment, but it is likely forthcoming. The reasons for extending ArcGIS Server and differences between both techniques are available elsewhere so I'll skip that discussion here. I want to discuss exposing ArcObjects logic in a custom server object extension via a prepackaged ArcGIS Server Web service handler. Two major protocols are supported, SOAP and REST. Let's dive in...

The ArcGIS Server SOAP API is implemented at the server object level. This means that SOAP messages are processed directly by a server object or extension (SOE). The ArcGIS Server SOAP Web service handler directs SOAP messages to a server object for you. The ArcGIS Server REST API is not implemented at the server object level. The ArcGIS Server REST Web service handler processes restful requests and (in general) uses the ArcGIS Server SOAP API to communicate with ArcGIS Server. How does this relate to exposing a custom SOE as a Web service? The SOAP Web service handler contains logic to discover custom SOEs with a SOAP interface (see sample and discussion below). The REST Web service handler does not contain the logic to discover custom SOEs at this time. Consequently, to expose a custom SOE as a REST service you’ll need to create your own Web service to handle restful requests and work with the SOE. Unfortunately this means you'll need to work with ArcObjects remotely in the Web service logic, which will require an ArcGIS Server license in the app-tier... a less than optimal solution. The folks at ESRI who work on the REST handler may resolve this in the future.

I've included a sample that illustrates how to expose a custom SOE via the ArcGIS Server SOAP Web service handler. It builds on the current
Server SDK sample which shows how to create a simple SOE.

I’ve modified this sample to illustrate how to support exposing a custom SOE using an ArcGIS Server Web service endpoint. The sample is merely instructive, so it just provides the basics of custom SOE development. To expose a WSDL for the custom SOE and make it available via an ArcGIS Server Web service endpoint, create a WSDL and put it in the \XmlSchema folder on the machine where the SOM is running. The name of the registered server object extension and the name of the *.wsdl file must be the same. To process SOAP requests, implement the IRequestHandler and IRequestHandler2 interfaces in the custom SOE class. In this example, the implementation code parses the incoming SOAP request and generates a raw SOAP response string. The response should match the WSDL definition.

Download the sample here.

Everything is pretty raw and simple at the moment, but it works. I’m sure there’s a better way to create the WSDL and generate SOAP responses, but that’ll take some additional research. Once the custom SOE is deployed and enabled on a map service, you can use the following url to get the WSDL: http://localhost/arcgis/services/<service name>/MapServer/SimpleSOE_CSharp?wsdl

49 comments:

Unknown said...

Hi, is there another way than parse XML request to process complex SOAP data types (e.g. MapDescription) sent to HandleStringRequest method of SOE?
When do you expect the possibility of accessing SOE thru REST as you mentioned in your post?
Thanks,
Matej

Ing. Domenico Ciavarella said...

Matej, Have you used linq to xml so it's very easy...

ShailGIS said...

Nice work ... This actually gave me some hopes over SOE to SOAP and ways to handle the internet resources.


When i typed the URL in the browser to see the SOAP, i get the following error.
http://localhost/arcgis/services/my servicename/MapServer/SimpleSOE_CSharp?wsdl



Server Error in '/ArcGIS/services' Application.
Error HRESULT E_FAIL has been returned from a call to a COM component.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Error HRESULT E_FAIL has been returned from a call to a COM component.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.]

rex hansen said...

Matej,

As far as parsing XML is concerned, LINQ (as NicoGis mentioned) and the standard .NET XmlTextReader will work. From ESRI's perspective, a new Message class was provided with 9.3 to assist with parsing. It's not documented very well, so I've included a sample code snippet below. I construct a SOAP message for the sake of the example.

On the SOE-REST front, ESRI may provide a means for accessing a custom SOE via the ArcGIS Server REST services in 9.4. In the meantime, you can create your own REST service implementation (e.g. asmx, wcf, httphandler, etc.) that wraps working with your SOE. Granted it will be not be discoverable using ArcGIS Services Directory and not accessible via the well-known ArcGIS Server REST endpoint... but it is technically possible, and legal. You would need to license the machine(s) to use ArcObjects remotely. The Web ADF runtime gives you what you need in the smallest install package available.


StringBuilder sb = new StringBuilder();

sb.Append("<?xml version='1.0' encoding='utf-8'?>");
sb.Append("<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'>");
sb.Append("<soap:Body>");
sb.Append("<MySOEAction>");
sb.Append("<SomeName>Search Extent</SomeName>");
sb.Append("<FilterGeometry xmlns:q1='http://www.esri.com/schemas/ArcGIS/9.3' xsi:type='q1:EnvelopeN' xmlns=''><XMin>0</XMin><YMin>0</YMin><XMax>180</XMax><YMax>90</YMax></FilterGeometry>");
sb.Append("</MySOEAction>");
sb.Append("</soap:Body>");
sb.Append("</soap:Envelope>");

ESRI.ArcGIS.esriSystem.IXMLStream requestXmlStream =
new ESRI.ArcGIS.esriSystem.XMLStreamClass();
requestXmlStream.LoadFromString(sb.ToString());

ESRI.ArcGIS.esriSystem.IMessage requestMessage =
new ESRI.ArcGIS.esriSystem.MessageClass();
requestMessage.ReadXML(requestXmlStream as ESRI.ArcGIS.esriSystem.IStream);

switch (requestMessage.Name)
{
case "MySOEAction":
ESRI.ArcGIS.esriSystem.IXMLSerializeData requestParameters = requestMessage.Parameters;
int someNameIndex = requestParameters.Find("SomeName");
string someName = requestParameters.GetString(someNameIndex);

int geometryIndex = requestParameters.Find("FilterGeometry");
ESRI.ArcGIS.Geometry.IEnvelope soapGeometry =
(ESRI.ArcGIS.Geometry.IEnvelope)requestParameters.GetObject(
geometryIndex, "http://www.esri.com/schemas/ArcGIS/9.3", "Envelope");
break;
}

rex hansen said...

ShailGIS,

In general the error you specify occurs when the SOE is found, but the wsdl is not. Where did you place the SimpleSOE_CSharp.wsdl? Do you have a distributed install (SOM on one machine, multiple SOCs different machines)?

ShailGIS said...

Rex,

I have got through this situation, where i saw those errors. That was because they were not placed under the right directory C:\Program Files\ArcGIS\XmlSchema.

I was able to get your solution working.

But i was also wondering, if anyone has implemented the ESRI Layout SOE (Print Map SOE) sample working through IRequestHandler.

Thanks,

Shail ...

Unknown said...

Hi Sir,
Sorry for putting it here. but i have no other way to contact u..

I am a beginner level GIS Application Programmar. I had gone through http://proceedings.esri.com/library/userconf/devsummit07/papers/developing_custom_web_tasks_using_the_net_web_adf-deep_dive.pdf
writeen by you.
very good and useful.
And now i'm trying to do the Manager Integration part with the custom tasks based on that.And I am struck with web configurator part.Not able to dynamically populate values in the task configuration in manager.
Looking for your help
Thanks in advance!
Anoop.

Unknown said...

Hi,

Is there a way to generate the wsdl from the SOE code automatically?

Thanks
Michal

Anonymous said...

Many institutions limit access to their online information. Making this information available will be an asset to all.
Custom Paper Writing

Unknown said...

I know this has been some time ago already, but seems like I'm bit struggling with this one.
I was able to register the extension and also the 'call SOE via SOAP' button works (so it gets the time via soe through soap), but the returnCircle method is throwing me an error, and I've noticed that after this line of code the soext object says :
m_SOH System.Runtime.Remoting.RemotingException: Remoting cannot find field 'm_SOH' on type 'SimpleSOE_CSharp.UtilSOE_CSharp'.

debugging seems to be a bit of a pain with SOE, will try out suggestions from other guys on their blogs (mapbutcher e.g.)...

any ideas what I might be doing wrong?

cheers

Sumant said...
This comment has been removed by the author.
Sumant said...

ArcGIS Server makes it easy for organizations to share mapping services and applications across the Web.

With ArcGIS Server, you can

* Connect more people with the information they need to make better decisions.
* Publish fast, intuitive Web mapping applications and services tailored to your audience.
* Simplify access to your services, data, and imagery.

Recently I just came across a good article on " Windows Server"
Here is its link.

Neeshey said...

hi All
i m getting same problem when i put wms request in browser
plz any one can help whats the error is?
[HttpException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.]
and one thing more what is a complete url for connecting a wms layer to browser i used the following is it correct
http://myservername/ArcGIS/services/mymaps/abcprovince/MapServer/WMSServer

Anonymous said...

how i can delete our comments and profile from here

Sankar said...

Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from .Net Core Training in Chennai. or learn thru .Net Core Training in Chennai. Nowadays Dot Net has tons of job opportunities on various vertical industry.
or Es6 Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.

Aliya Manasa said...

Thanks for the informative article. This is one of the best resources I have found in quite some time. Nicely written and great info. I really cannot thank you enough for sharing.
python Training in Pune
python Training in Chennai
python Training in Bangalore

Unknown said...

Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
Best Devops Training in pune
Devops Training in Bangalore
Power bi training in Chennai

priya said...

Pleasant Tips..Thanks for Sharing….We keep up hands on approach at work and in the workplace, keeping our business pragmatic, which recommends we can help you with your tree clearing and pruning in an invaluable and fit way.
Data Science Training in Chennai
Data Science training in kalyan nagar
Data science training in Bangalore
Data Science training in marathahalli
Data Science interview questions and answers
Data science training in bangalore

offpageseo70 said...

Nice blog,I understood the topic very clearly,And want to study more like this.
Data Scientist Course

datasciencecourse said...

I have to search sites with relevant information on given topic and provide them to teacher our opinion and the article.

data science course

Anu said...

This is really a very good article.Thanks for taking the time to discuss with us , I feel happy about learning this topic. Keep sharing your information regularly for my future reference.
DevOps Training | Certification in Chennai | DevOps Training | Certification in anna nagar | DevOps Training | Certification in omr | DevOps Training | Certification in porur | DevOps Training | Certification in tambaram | DevOps Training | Certification in velachery



rocky said...

I like so much your topic content. I read understand with information. thanks.
Python Training in Chennai

Python Training in Bangalore

Python Training in Hyderabad

Python Training in Coimbatore

Python Training

python online training

python flask training

python flask online training


priyash said...

Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
Correlation vs Covariance
Simple linear regression
data science interview questions

deiva said...

Thanks for the informative article. This is one of the best resources I have found in quite some time. Nicely written and great info. I really cannot thank you enough for sharing.
web designing training in chennai

web designing training in omr

digital marketing training in chennai

digital marketing training in omr

rpa training in chennai

rpa training in omr

tally training in chennai

tally training in omr

Jayalakshmi said...

Thanks for sharing great information. I like your blog and highly recommend.
oracle training in chennai

oracle training in tambaram

oracle dba training in chennai

oracle dba training in tambaram

ccna training in chennai

ccna training in tambaram

seo training in chennai

seo training in tambaram

praveen said...

First i got a great blog .I will be interested in more similar topics. i see you got really very useful topics, i will be always checking your blog thanks
angular js training in chennai

angular js training in porur

full stack training in chennai

full stack training in porur

php training in chennai

php training in porur

photoshop training in chennai

photoshop training in porur

shiny said...

Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.


sap training in chennai

sap training in annanagar

azure training in chennai

azure training in annanagar

cyber security course in chennai

cyber security course in annanagar

ethical hacking course in chennai

ethical hacking course in annanagar

jeni said...

Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…
oracle training in chennai

oracle training in velachery

oracle dba training in chennai

oracle dba training in velachery

ccna training in chennai

ccna training in velachery

seo training in chennai

seo training in velachery


CloudLearn ERP said...

With so much overstated negative criticism of the corporate culture in the media, it is indeed bracing to have an upbeat, positive report on the good things that are happening. Wish to read some more from you!
Data Science training in Mumbai
Data Science course in Mumbai
SAP training in Mumbai

Mallela said...

Thanks for posting the best information and the blog is very helpful.Data science course in Faridabad

data science training institute in bangalore - 360DigiTMG said...

Impressive blog to be honest definitely this post will inspire many more upcoming aspirants. Eventually, this makes the participants to experience and innovate themselves through knowledge wise by visiting this kind of a blog. Once again excellent job keep inspiring with your cool stuff.

Data Science certification in Raipur

data analytics courses in bangalore with placement - 360DigiTMG said...

Terrific post thoroughly enjoyed reading the blog and more over found to be the tremendous one. In fact, educating the participants with it's amazing content. Hope you share the similar content consecutively.

Data Analytics training in Raipur

Data Science Course in Bhilai - 360DigiTMG said...

Highly appreciable regarding the uniqueness of the content. This perhaps makes the readers feels excited to get stick to the subject. Certainly, the learners would thank the blogger to come up with the innovative content which keeps the readers to be up to date to stand by the competition. Once again nice blog keep it up and keep sharing the content as always.

Data Science Course in Bhilai

Data Science Course in Bhilai - 360DigiTMG said...

Honestly speaking this blog is absolutely amazing in learning the subject that is building up the knowledge of every individual and enlarging to develop the skills which can be applied in to practical one. Finally, thanking the blogger to launch more further too.

Data Analytics online course

Mallela said...

Thanks for posting the best information and the blog is very helpful.python course in Bangalore

Mallela said...

Thanks for posting the best information and the blog is very helpful.data science interview questions and answers

data science said...

I was basically inspecting through the web filtering for certain data and ran over your blog. I am flabbergasted by the data that you have on this blog. It shows how well you welcome this subject. Bookmarked this page, will return for extra. data science course in jaipur

Data Science Course in Bhilai - 360DigiTMG said...

Impressive blog to be honest definitely this post will inspire many more upcoming aspirants. Eventually, this makes the participants to experience and innovate themselves through knowledge wise by visiting this kind of a blog. Once again excellent job keep inspiring with your cool stuff.

Data Science Training in Bhilai

Data Science Course in Bhilai - 360DigiTMG said...

Wonderful blog found to be very impressive to come across such an awesome blog. I should really appreciate the blogger for the efforts they have put in to develop such an amazing content for all the curious readers who are very keen of being updated across every corner. Ultimately, this is an awesome experience for the readers. Anyways, thanks a lot and keep sharing the content in future too.

Data Science Course in Bhilai

Data Science Course in Bhilai - 360DigiTMG said...

Stupendous blog huge applause to the blogger and hoping you to come up with such an extraordinary content in future. Surely, this post will inspire many aspirants who are very keen in gaining the knowledge. Expecting many more contents with lot more curiosity further.

Data Science Certification in Bhilai

Data Science Course in Bhilai - 360DigiTMG said...

Extraordinary blog went amazed with the content that they have developed in a very descriptive manner. This type of content surely ensures the participants to explore themselves. Hope you deliver the same near the future as well. Gratitude to the blogger for the efforts.

Data Science Training

cloud computing course in bangalore said...

Extremely overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one. Continue posting. A debt of gratitude is in order for sharing. python course in delhi

Reshma said...

Thanks for sharing such a worthy information. Keep update like this.....
IELTS Coaching in Hyderabad
IELTS Coaching in Bangalore

prathyusha said...

Incredibly overall exceptionally fascinating post. I was searching for such a data and completely appreciated analyzing this one. Continue to post. A commitment of appreciation is all together for sharing.data analytics course delhi

Asha Kaashiv said...

Hi, this is really amazing article, thanks for posting and sharing this article. we are supporting training for all. click here for further details please
full stack developer course near me , online internships for ece students , online internship for electrical engineering students , online internship for ece students , online internship for cse students , online internship for b.com students , internship for eee students , internship for cse 3rd year students , ethical hacking internship , cse mini projects

Data Science Course in Bhilai - 360DigiTMG said...

Wonderful blog found to be very impressive to come across such an awesome blog. I should really appreciate the blogger for the efforts they have put in to develop such an amazing content for all the curious readers who are very keen of being updated across every corner. Ultimately, this is an awesome experience for the readers. Anyways, thanks a lot and keep sharing the content in future too.

Data Science Course in Bhilai

Data Science Course in Bhilai - 360DigiTMG said...

Impressive blog to be honest definitely this post will inspire many more upcoming aspirants. Eventually, this makes the participants to experience and innovate themselves through knowledge wise by visiting this kind of a blog. Once again excellent job keep inspiring with your cool stuff.

Data Science Training in Bhilai

prathyusha said...

Extremely overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one. Continue posting. A debt of gratitude is in order for sharing.data science course in bhubaneswar

manasha said...

Great post. keep sharing such a worthy information.
Manual Testing Online Course