NetTalk Central

Author Topic: using Fetch from a web server  (Read 2497 times)

lanmicro

  • Full Member
  • ***
  • Posts: 112
    • View Profile
    • Email
using Fetch from a web server
« on: June 04, 2011, 10:38:38 AM »
How can I use Fetch on a button to get some XML that I want to display in a browse?

My intention is to have the user enter some information that I will use as parameters on the url and the url will return the XML to server.

In the PageReceived I want to extract the information from the XML and place it into a memory table and display the information.

Can it be done?
Gregory C. Bailey

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11204
    • View Profile
Re: using Fetch from a web server
« Reply #1 on: June 06, 2011, 06:47:12 AM »
Hi Greg,

I've read this like 10 times, and I'm still unclear as to what you're looking for.
Can you maybe expand on the explanation a bit.

I _think_ what you're saying is something like this;

NetWebForm
User enters a bunch of fields and presses a button.
The _server_ then acts as a _client_ to some other server
passing those fields
gets the reply (as xml?)
parses the xml into a memory table
displays the result as a NetWebBrowse

yes?

lanmicro

  • Full Member
  • ***
  • Posts: 112
    • View Profile
    • Email
Re: using Fetch from a web server
« Reply #2 on: June 06, 2011, 07:15:46 AM »
Yes,

I take back the slacker comment<G>
Gregory C. Bailey

lanmicro

  • Full Member
  • ***
  • Posts: 112
    • View Profile
    • Email
Re: using Fetch from a web server
« Reply #3 on: June 08, 2011, 12:57:14 PM »
Any hints?
Gregory C. Bailey

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11204
    • View Profile
Re: using Fetch from a web server
« Reply #4 on: June 09, 2011, 12:24:08 AM »
sorry - been some busy days this week.

So yeah, the easiest way to do this is to start by creating a simple "getwebpage" procedure. Nothing complicated, just a simple window with a NetWebClient - takes in some parameters, like the URL, and returns the result probably as a string.

So now you have a syncronous "fetch" you can call that anywhere you like.

The netWebForm "presses the button" - that goes to some URL - ie in this case the "browse".
In the browse, you can do the fetch, parse the xml and so on.  You might need to think about which embed point to use quite carefully - or check perhaps for some value in the value queue to determine if you need to do the Fetch, but it's all fairly mechanical at that point.

cheers
Bruce