I decided to write a blog about the Proxy-pass through because I know that it can be a little difficult to understand the first time you look at it. I think the most important thing to know is that it really isn't too complicated. Based on Dr. Drakes PowerPoint I will explain some steps to follow.
To get started create a basic html web page like this. Remember to include the script type in the head. This is shown in slide 5 in Dr. Drakes PowerPoint. Just remember that for iteration 2 we will need to have an event handler like a button onClick and a div for display.
Next create a JavaScript file and name it ajax and save it as a js file. All you have to do is copy slides 6,7, and 8 in Dr. Drakes PowerPoint like below. Note that for iteration 2 we won't use the window.onload because we will have an event handler. You will have to change the function displayDetails beacuse we can't use an alert box. Also, in the function getDetails is where we call the proxy file.
Then all you need to do is create one more file and name it proxy and save it as a php document. Just copy slides 9-13 in Dr. Drakes PowerPoint. In the highlighted area is where we will define a hostname. For iteration 2 we will need to insert our own hostname from a web service we have chosen. Some API's will require a KEY and some parameters along with the hostname.
This is only a way to call on a web service using Proxy-pass through and to return the information as xml. This is the requirement for iteration 2. As we continue in the semester we will take this xml and parse the information to display only the tags we need. I hope this will be helpful and make iteration 2 a little easier to complete.
Feb 18, 2010
Subscribe to:
Post Comments (Atom)
A proxy server is simply another computer that accepts connections from the outside world and allows information to pass through it to you.
ReplyDeletePHP Developer India
Thanks for your post. This really helped break it down for me so I can better understand it. This really helped clear it up!
ReplyDeleteThanks Helen, this really help me to better understand what is expected of us for iteration 2 of the individual project
ReplyDeleteThanks, this helped out a lot. I had an idea of what we needed to do, I just wasn't completely sure how to do it. FYI, the screen shots made a huge difference.
ReplyDelete