Hi. I've a web services, that provide Lat & Long for each object, from my previous Flex Application. Is there any method to load this data into Javascript API or Arcgis Webapp Builder?
Mind if you can share the references. Thank You.
I imagine it would be a lot of work to do that.
But if you just have a simple server that's serving up a bunch of features in XML, not necessarily an Esri service, then this should be straightforward.
It also doesn't seem like it would too hard to query a SOAP based feature service and parse the features into something usable. Getting that service to work seamlessly with with the JS API would be a long slog though, and I think you're right that the best move would be republishing that service so that it supports REST if that's your goal.
I would love to see a working example of a SOAP based web service that takes input parameters working using esriRequest.
You can use esri/Request to make a request to your web service. Then you can take the resulting XML and transform it into something JavaScript-friendly. I've never had to do this before but it shouldn't be too hard.
This would look something like this:
<SPAN class="token function">esriRequest</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="operator token"><</SPAN>url to your webservice<SPAN class="operator token">></SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">{</SPAN> responseType<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"xml"</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">then</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">function</SPAN><SPAN class="punctuation token">(</SPAN>response<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> <SPAN class="comment token">// response.data is an XMLDocument</SPAN> <SPAN class="comment token">// let's say your features are described by <feature></feature> objects</SPAN> <SPAN class="comment token">// with longitude and latitude attributes</SPAN> <SPAN class="keyword token">let</SPAN> nodes <SPAN class="operator token">=</SPAN> response<SPAN class="punctuation token">.</SPAN>data<SPAN class="punctuation token">.</SPAN><SPAN class="token function">getElementsByTagName</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"feature"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">let</SPAN> featureArray <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">for</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">let</SPAN> i <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">;</SPAN> i <SPAN class="operator token"><</SPAN> nodes<SPAN class="punctuation token">.</SPAN>length<SPAN class="punctuation token">;</SPAN> i<SPAN class="operator token">++</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> featuresArray<SPAN class="punctuation token">.</SPAN><SPAN class="token function">push</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN> longitude<SPAN class="punctuation token">:</SPAN> nodes<SPAN class="punctuation token">[</SPAN>i<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">getAttribute</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"longitude"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> latitude<SPAN class="punctuation token">:</SPAN> nodes<SPAN class="punctuation token">[</SPAN>i<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">getAttribute</SPAN><SPAN class="punctuation token">(</SPAN>"latitude<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">return</SPAN> featureArray<SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Encik,
I have never gotten the JS API to work with SOAP based web services. You will need to re-create your web service to be a RESTfull web service.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.