Example of how to call a web service from VBA

TomCon

Active Member
Joined
Mar 31, 2011
Messages
385
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I wonder if anybody has a short, clear example of this available that you could post? Including all the frills like what references must be made in VBA project, etc. Would prefer not to have fancy toolkit with proxy classes, as i know the service URL and method signitures (no WSDL needed to generate it). Also i can easily generate the XML formatted request text myself, So, what i need to know is how to do the POST, and receive the XML answer back.

Thanks,
tom
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
This is absolutely great, thanks. I"ve played with it a bit, but don't seem to be able to get the packet to send quite right, so if somebody finds this easy to tell me, would appreciate it.

Rather than POST, wanted to use a GET. The web site for the web service (http://gisdata.usgs.net/XMLWebServices2/Elevation_Service.asmx?op=getElevation )provides this documentation, example of the GET:


GET /XMLWebServices2/Elevation_Service.asmx/getElevation?X_Value=string&Y_Value=string&Elevation_Units=string HTTP/1.1
Host: gisdata.usgs.net

So, i tried this:
XMLHttp.Open "GET", getText, False
XMLHttp.send

(Values used for "string", X=-114.335599, Y=48.493916 Unit=METERS)
But, i tired various content of getText, but cannot get one that works? Does anybody understand that documentation well enough to form the exact text string to send?

Thanks!












</PRE>














</PRE>
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top