473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Consume Geodata web service

I'm trying to get geodata from Google or Yahoo's web service using an
Access (2000-2003) application. I have this working fine in vb.net but
have no idea how to do this in Access.

I'm looking for any example code from someone who has done this in
Access, or for any code examples of using HTTP POST from Access so I
can see how this is done.

These web services return straight XML and do not use SOAP and do not
use expose a WSDL.

Any help is appreciated.
lq
Jan 3 '08 #1
15 2677
rkc
Lauren Quantrell wrote:
There's an error in the posted code:
Corrected as follows:

Public Property Get PostalCode() As String
PostalCode = _
GetNodeText("//Placemark/AddressDetails/Country/AdministrativeArea/
SubAdministrativeArea//PostalCode/PostalCodeNumber")
End Property
The more you learn about XPath queries the shorter all those paths
could be made.
Jan 5 '08 #2
rkc
Lauren Quantrell wrote:
There's an error in the posted code:
Corrected as follows:

Public Property Get PostalCode() As String
PostalCode = _
GetNodeText("//Placemark/AddressDetails/Country/AdministrativeArea/
SubAdministrativeArea//PostalCode/PostalCodeNumber")
End Property
Something else you need to know if you're actually plugging that code
into an application.

First: You shouldn't. You asked for an example. It's just a lame example.

Second: More than one Placement node can be returned if there is more
than one hit for the address you make a request for.
If that ever happens you will get weird results using that code.

Go to Google's Map Api information pages and read. That is what I did.
Jan 5 '08 #3
On Jan 5, 11:02*am, rkc <r...@rkcny.yabba.dabba.do.comwrote:
Lauren Quantrell wrote:
There's an error in the posted code:
Corrected as follows:
Public Property Get PostalCode() As String
* * PostalCode = _
* * GetNodeText("//Placemark/AddressDetails/Country/AdministrativeArea/
rkc,
Freaky how I can pass the XML string to a sproc in vb.net but not from
Access. I must be missing something. Double double quotes, triple
double quates I've tried...
lq
SubAdministrativeArea//PostalCode/PostalCodeNumber")
End Property

Something else you need to know if you're actually plugging that code
into an application.

First: You shouldn't. You asked for an example. It's just a lame example.

Second: More than one Placement node can be returned if there is more
than one hit for the address you make a request for.
If that ever happens you will get weird results using that code.

Go to Google's Map Api information pages and read. That is what I did.
Jan 7 '08 #4
rkc
Lauren Quantrell wrote:
rkc,
Thanks. I appreciate that on the multiple placement nodes. I have
taken the code as a starting point and have it working well with a
number of web services.
I've hit a wall on passing the XML to a sproc though.

Using OPENXML with the returned XML string from the geonames web
service works fine when I copy and paste it into a declaration within
the sproc, but I can't get it to work when I try to pass the returned
XML string as a parameter from MS Access. I have tried removing the
Char(10) and massaging the double quotes. There must be something
simple I've overlooked?

Example that works:

ALTER PROCEDURE myXMLSprocName
Sorry. I can't even pretend to know anything about how SQL Server
handles XML.
Jan 7 '08 #5
On Jan 7, 5:35 pm, Lauren Quantrell <laurenquantr...@hotmail.com>
wrote:
Freaky how I can pass the XML string to a sproc in vb.net but not from
Access.
Could you explain how you are getting the XML string in Access? When
I sign up for a Google Map API key I am told:
This key is good for all URLs in this directory:
http://www.whatever.ca/
Were I to use rkc's code from an application based there, I expect it
would work. But, TTBOMK I can't run Access from http:/www.whatever.ca,
and when I try it from somewhere else, such as my workstation I get
{"name":"11 Place Antonin Poncet, Lyon, FR ","Status":{"code":
610,"request":"geocode"}}
returned.

BTW, although this string has many "'s, it's easily passed to a Stored
Procedure.
Jan 8 '08 #6
rkc
lyle wrote:
On Jan 7, 5:35 pm, Lauren Quantrell <laurenquantr...@hotmail.com>
wrote:
>Freaky how I can pass the XML string to a sproc in vb.net but not from
Access.

Could you explain how you are getting the XML string in Access? When
I sign up for a Google Map API key I am told:
This key is good for all URLs in this directory:
http://www.whatever.ca/
Were I to use rkc's code from an application based there, I expect it
would work. But, TTBOMK I can't run Access from http:/www.whatever.ca,
and when I try it from somewhere else, such as my workstation I get
{"name":"11 Place Antonin Poncet, Lyon, FR ","Status":{"code":
610,"request":"geocode"}}
The code I posted specifically asks for XML in return.
With this: &output=xml

What you posted is JSON.
Jan 8 '08 #7
rkc
lyle fairfield wrote:
rkc <rk*@rkcny.yabba.dabba.do.comwrote in
news:47**********************@roadrunner.com:
>lyle wrote:
>>On Jan 7, 5:35 pm, Lauren Quantrell <laurenquantr...@hotmail.com>
wrote:

Freaky how I can pass the XML string to a sproc in vb.net but not
from Access.
Could you explain how you are getting the XML string in Access? When
I sign up for a Google Map API key I am told:
This key is good for all URLs in this directory:
http://www.whatever.ca/
Were I to use rkc's code from an application based there, I expect it
would work. But, TTBOMK I can't run Access from
http:/www.whatever.ca, and when I try it from somewhere else, such as
my workstation I get
{"name":"11 Place Antonin Poncet, Lyon, FR ","Status":{"code":
610,"request":"geocode"}}
The code I posted specifically asks for XML in return.
With this: &output=xml

What you posted is JSON.

But is the code allowed to get the XML when run from anywhere but the
site (url) for which the key is enabled? Perhaps it can and I made a
syntax or other error?
I run it directly from a Module in Access and it works just fine.
The status code you posted 610 indicates:
The given Key is either invalid or does not match the domain for which
it was given.

I have never had that error returned. Apparently the code works for
Lauren also. I just used rkcny.com as the domain when I applied for
the key. I have not even tried using the service from a web page yet.

The Geonames.org service seems to be no strings attached so you might
want to just use that instead for testing with SQL Server.


Jan 8 '08 #8
On Jan 7, 9:15 pm, rkc <r...@rkcny.yabba.dabba.do.comwrote:
lyle fairfield wrote:
rkc <r...@rkcny.yabba.dabba.do.comwrote in
news:47**********************@roadrunner.com:
lyle wrote:
On Jan 7, 5:35 pm, Lauren Quantrell <laurenquantr...@hotmail.com>
wrote:
>>Freaky how I can pass the XML string to a sproc in vb.net but not
from Access.
Could you explain how you are getting the XML string in Access? When
I sign up for a Google Map API key I am told:
This key is good for all URLs in this directory:
http://www.whatever.ca/
Were I to use rkc's code from an application based there, I expect it
would work. But, TTBOMK I can't run Access from
http:/www.whatever.ca, and when I try it from somewhere else, such as
my workstation I get
{"name":"11 Place Antonin Poncet, Lyon, FR ","Status":{"code":
610,"request":"geocode"}}
The code I posted specifically asks for XML in return.
With this: &output=xml
What you posted is JSON.
But is the code allowed to get the XML when run from anywhere but the
site (url) for which the key is enabled? Perhaps it can and I made a
syntax or other error?

I run it directly from a Module in Access and it works just fine.
The status code you posted 610 indicates:
The given Key is either invalid or does not match the domain for which
it was given.

I have never had that error returned. Apparently the code works for
Lauren also. I just used rkcny.com as the domain when I applied for
the key. I have not even tried using the service from a web page yet.

The Geonames.org service seems to be no strings attached so you might
want to just use that instead for testing with SQL Server.
What is rkcny.com? Is it by-chance a url for your own computer?
Jan 8 '08 #9
rkc
lyle wrote:
What is rkcny.com? Is it by-chance a url for your own computer?
No. http://www.rkcny.com. Hosted by Brinkster.com
Jan 8 '08 #10
I applied for my own Google key, not using yours. The domain I'm
running it from is http://localhost/ which Google accepts.

On Jan 7, 9:15*pm, rkc <r...@rkcny.yabba.dabba.do.comwrote:
lyle fairfield wrote:
rkc <r...@rkcny.yabba.dabba.do.comwrote in
news:47**********************@roadrunner.com:
lyle wrote:
On Jan 7, 5:35 pm, Lauren Quantrell <laurenquantr...@hotmail.com>
wrote:
>>Freaky how I can pass the XML string to a sproc in vb.net but not
from Access.
Could you explain how you are getting the XML string in Access? *When
I sign up for a Google Map API key I am told:
This key is good for all URLs in this directory:
http://www.whatever.ca/
Were I to use rkc's code from an application based there, I expect it
would work. But, TTBOMK I can't run Access from
http:/www.whatever.ca, and when I try it from somewhere else, such as
my workstation I get
*{"name":"11 Place Antonin Poncet, Lyon, FR ","Status":{"code":
610,"request":"geocode"}}
The code I posted specifically asks for XML in return.
With this: &output=xml
What you posted is JSON.
But is the code allowed to get the XML when run from anywhere but the
site (url) for which the key is enabled? Perhaps it can and I made a
syntax or other error?

I run it directly from a Module in Access and it works just fine.
The status code you posted 610 indicates:
The given Key is either invalid or does not match the domain for which
it was given.

I have never had that error returned. Apparently the code works for
Lauren also. I just used rkcny.com as the domain when I applied for
the key. I have not even tried using the service from a web page yet.

The Geonames.org service seems to be no strings attached so you might
want to just use that instead for testing with SQL Server.- Hide quoted text -

- Show quoted text -
Jan 8 '08 #11
rkc
Lauren Quantrell wrote:
I applied for my own Google key, not using yours. The domain I'm
running it from is http://localhost/ which Google accepts.
Obviously. I didn't post my key.
It's interesting that Google accepts localhost. I Wouldn't
have thought to try that.
Jan 8 '08 #12
I have this working nicely with a number of web services now after the
hint on how to pass the string parameter properly to OPENXML in a
sproc. Much thanks!

Now comes the question of how to apply a timeout to this process from
within the aplication. I notice some of these web services are not
causing a time out when the servies are down so therefore the
applciation locks up and the only escape is CLT+ALT+DEL <yikes>!
On Jan 7, 10:09*pm, rkc <r...@rkcny.yabba.dabba.do.comwrote:
Lauren Quantrell wrote:
I applied for my own Google key, not using yours. The domain I'm
running it from ishttp://localhost/which Google accepts.

Obviously. I didn't post my key.
It's interesting that Google accepts localhost. I Wouldn't
have thought to try that.
Jan 9 '08 #13
rkc
Lauren Quantrell wrote:
I have this working nicely with a number of web services now after the
hint on how to pass the string parameter properly to OPENXML in a
sproc. Much thanks!

Now comes the question of how to apply a timeout to this process from
within the aplication. I notice some of these web services are not
causing a time out when the servies are down so therefore the
applciation locks up and the only escape is CLT+ALT+DEL <yikes>!
The XMLHTTP object has a readyState property that returns 4 when the
ResponseText property is available. What you need to do is set the
ASync property of the Open method to TRUE so that your application
does not sit and wait for a response. Then in a Form's Timer Event you
pole the readyState property until it returns 4. When it does you run
code to do whatever it is you are doing with the ResponseText now.
You can then add code that decides when you have waited long enough
without a response and call the Abort method.
Jan 10 '08 #14
rkc
rkc wrote:
Lauren Quantrell wrote:
>I have this working nicely with a number of web services now after the
hint on how to pass the string parameter properly to OPENXML in a
sproc. Much thanks!

Now comes the question of how to apply a timeout to this process from
within the aplication. I notice some of these web services are not
causing a time out when the servies are down so therefore the
applciation locks up and the only escape is CLT+ALT+DEL <yikes>!

The XMLHTTP object has a readyState property that returns 4 when the
ResponseText property is available. What you need to do is set the
ASync property of the Open method to TRUE so that your application
does not sit and wait for a response. Then in a Form's Timer Event you
pole the readyState property until it returns 4. When it does you run
code to do whatever it is you are doing with the ResponseText now.
You can then add code that decides when you have waited long enough
without a response and call the Abort method.
Correction: Async parameter of the Open method.
Jan 10 '08 #15
ah, perfect. Thanks again!
Jan 10 '08 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Michael Hatmaker | last post by:
I have begun experimenting with web services, and I created some simple web services in C# and was able to install them with IIS and create an equally simple C# client to consume them. My next...
0
by: pranoliver | last post by:
Hi, How can I consume a Web Service that returns a DATASET from classic ASP. I know how to consume the Web Service when it returns just a variable using SOAP Toolkit 3.0. Thanks In Advance.
2
by: Abeslom via .NET 247 | last post by:
Hi, I am trying to create a simple .NET http-Get client that willconsume a java webservice on a mainframe. If I type the URL forthe webservice in the Browser, the service works and I get theexpected...
4
by: John Bailo | last post by:
I wrote a .NET/c# webservice which I then needed to consume from java server pages. The simplest ( and best ) solution I found, was some code to open a socket, and send a SOAP message directly...
4
by: geilen | last post by:
I'm trying to use a dataset returned from a web service in an unmanaged C++ (MFC) client. The dataset is returned as a BSTR, and I'm having trouble reading the BSTR into an XML document for...
0
by: leslie_tighe | last post by:
Hello, I have a set of web services running on Java server that are exposed through axis 1.2.1. I can invoke these services in browser and through a java test client. However, when I try to...
5
by: David Lozzi | last post by:
Howdy, I wrote a web service in .Net for my customer. My customer has another vendor who now has to consume it but they are not using Visual Studio. Most of their pages are jsp, and they said...
3
by: frustratedcoder | last post by:
I need to consume a web service written in Perl but there is no wsdl file for this service. The perl soap client that can call and consume this web service looks like this (if it helps) #!perl...
2
by: hharry | last post by:
hello all, trying to consume a simple web service using httpwebrequest instead of generating a proxy class. code for simple web service: Imports System.Web.Services ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.