integrate webservice - how to?

5 views
Skip to first unread message

Latitude64

unread,
Mar 16, 2006, 1:53:05 PM3/16/06
to KML Discussions
I would like to dynamically pull data from a webservice, and I would like to do that in a "self contained" KML file, meaning without to load in an external php or whatnot file.

Unfortunatly I have very limited knowledge on just how to accomplish this. I did spend some time googling for it, but didn't turn up anything that lead me to a solution.


What I would like to accomplish is have a KML file in which when the end-user clicks on a location marker the description window comes up and within that window the request to the webservice is made, the XML data is returned and styled for output within that same window.

I can use SOAP, HTTP GET, and HTTP POST to request data from the web service.

Any suggestions will be highly appreciated.

Thanks in advance.

barryhunter

unread,
Mar 16, 2006, 3:58:58 PM3/16/06
to KML Discussions
I don't think Google Earth has any capability to do what you suggest, in fact I think the HTML content of the balloon has to be contained in the KML file, so you couldn't even do the transformation with a php script.

What you can do however is have a script create the KML in the first place with the contents of the web-service already coded.

Or you could the description balloons contain img tags that point to a script that will generate the return form the web service as a image. This could work from a static KML and still have the contents of the balloon dynamically update.

Alternatively you could use a (view-based refresh) network-link that, takes the current view and forwards it to an online script, works out what locations are visible and returns appropriate KML to the client. I suspect this is basically what you are after as want to be able to have the information fetched in nearer real-time than having statically generated KML files.

So the basic answer is you can't do what you ask without the intervention of a little script somewhere on the internet (unless of course the web service can return a image in the first place )

Latitude64

unread,
Mar 16, 2006, 6:47:22 PM3/16/06
to KML Discussions
Thanks for your reply Barry.
I was afraid that this would be the answer I would get. That's pretty much what I had previously read, but I had hoped that there may be a trick to get around the whole thing.

The webservice I am requesting data from is set to return an XML file. I would then style that data as needed to present it in a tabular form. It's actual text data, not imagery.

I basically want to be able to display information that is relevant to the location within the description ballon of that location while retrieving that info from a webservice that produces XML output.

I think that your suggestion will be the only feasible solution at this point; create the KML using the webservice data, and then let the user look at it, rather than fetching the data in near-real time from the webservice.

I do not have a real need for this data to be in real-time. Data for each location may change on a weekly or so basis, befinitely not much more often than that. Seems like the thing to do would be to run a server-side process that creates a weekly KML file that has static content for each location.

daboochmeister

unread,
Mar 31, 2006, 8:46:58 AM3/31/06
to KML Discussions
Integration of a fully capable HTML-renderer into the balloons is one of the things we've been most asking our rep for -- I mean, AJAX level of freedom in balloons would rock!

No word on progress, but if we hear anything, I'll duck back and post here.
Reply all
Reply to author
Forward
0 new messages