简体   繁体   中英

SOAP - Google Maps and Javascript - Connecting to a webservice

I need to connect to an asmx webservice using javascript. the webservice accepts and returns a soap response. im looking for an example bit of code of how i can connect to the webservice using javascript. it returns lat and long details which i'll then use to plot markers on a google map. i also have the issue of cross domain scripting...

should i provide and example of the soap response?

thanks.

There are some JavaScript SOAP client libraries out there:

Those libraries will allow you to easily make a SOAP Request and handle the results.

I strongly suggest that you implement the SOAP client on your web domain. Let the JS call your server, which in turn calls the ASMX. The response of the web service should then be converted to a suitable JSON on your server before sending it down to the client.

This way, you get rid of your cross-domain problems, you don't load a SOAP client in the browser, you transmit less wordy data to the client, and you have the option of caching web service calls at your server to speed things up if you want to.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM