Set Up and Consume a DataSet from a Remote Database

I'm looking for some directions on how to work with a dB on a remo

Page 1 of 1

2 Replies - 1099 Views - Last Post: 04 August 2009 - 07:25 AM

#1 rhett.moeller  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 13-May 06

Set Up and Consume a DataSet from a Remote Database

Post icon  Posted 24 July 2009 - 10:16 PM

Hello, Dreamers. I'm working on a project that (I believe) requires me to work with web services. Here are the guidelines/direction for the project:

1) I have a web page that contains an embedded Flash map. This map has hot spots that display funding information when a user moves the mouse over the spots. The current data source for funds on this map is a static XML file.

2) There is a database that contains the actual data I'm looking to use. I have all the information necessary to connect to the dB (and have done so successfully through Visual Web Developer Express 2008).

3) Now, from what I understand, I need to set up a web service that directs the specified data from the database into an XML file. From that point, my Flash image should be able to point to the generated file and change the data that displays in the image.

4) The hosting location for my site does not allow for dynamic pages to run (no .asp or .php), and moving locations is not an option.

With these things in mind, I'm looking for a way to dump the data I specify through an SQL query into a file that will then be available for my Flash image to point to. Are web services the way to go here, and if so, how do I set this up? There seem to be lots of articles about how *easy* this is, but not many (none that I've been able to find) that give a clear way of actually doing it.

This is all new to me, and I appreciate any help you can give!

Is This A Good Question/Topic? 0
  • +

Replies To: Set Up and Consume a DataSet from a Remote Database

#2 rhett.moeller  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 13-May 06

Re: Set Up and Consume a DataSet from a Remote Database

Posted 03 August 2009 - 09:23 AM

Okay, so we got the web service set up on the remote server, and it seems to be working just fine. Now I'm trying to figure out how to consume it from my website. I don't have (and can't install) Visual Studio.NET on my work computer, and I don't seem to have wsdl.exe, either (again, don't have the permissions to install). How can I point an ASP page to the web service in order to get to the exposed data?

According to the definitions page for the asmx, I have listings for SOAP 1.1, SOAP 1.2, HTTP GET and HTTP POST, but I don't know how to incorporate these calls with an ASP page so that I can talk with the service. Any ideas?

This post has been edited by rhett.moeller: 04 August 2009 - 07:25 AM

Was This Post Helpful? 0
  • +
  • -

#3 rhett.moeller  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 13-May 06

Re: Set Up and Consume a DataSet from a Remote Database

Posted 04 August 2009 - 07:25 AM

Okay, I've decided to go with the HTTP POST (or GET-- whichever) method of getting at the data in the remote database. I am displaying results now, which is great, but they're showing up as text instead of the XML that I need. Given the code below, does anyone know how to get the XML to appear instead?

<%
	Dim objWinHttp
	Dim strResponseStatus
	Dim strResponseText

	' Create an instance of our HTTP object
	Set objWinHttp = Server.CreateObject("WinHttp.WinHttpRequest.5.1")

	' Open a connection to the server
	objWinHttp.Open "POST", "http://myURL", False

	' Set the content type header of our request to indicate the body of our request will contain form data.
	objWinHttp.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"

	' Send the request to the server.
	objWinHttp.Send "parameter1=First¶meter2=Second"

	' Get the text of the response
	strResponseText = objWinHttp.ResponseText
	Response.Write(strResponseText)

	' Dispose of our object now that we're done with it
	Set objWinHttp = Nothing
%>



When run this way (using the actual URL and parameters) I get a valid response, but it's all in plain text. I'm looking for the same dataset to appear in the original XML instead. Any ideas?

This post has been edited by rhett.moeller: 04 August 2009 - 07:27 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1