Connecting Tech Pros Worldwide Help | Site Map
Reply
 
LinkBack Thread Tools Search this Thread
  #1  
Old September 16th, 2008, 08:20 PM
Newbie
 
Join Date: Sep 2008
Posts: 1
Default how to retrieve xml data from a remote server

I have a simple form that i need to post some data to...

A customer will enter an upgrade id into a form on my server (SERVER-A) and I need to post that form to SERVER-B

Here is my url that I need to hit
https://SERVER-B.COM/webservice/upgrade/v1/registration.php?region=WSTSWPU8&upgid=F0A0B0L250V T&upgpkgid=A2T0DGYTERD0&mode=0

If I load the SERVER-B url into a browser on it's own it will return this...

<response>
<code>609</code>
</response>

I need to grab/manipulate the <code> tag.

I am savy with asp but have not used xml all that much. As I understand it now I cannot use xmlhttp request to get data from an outside server or a server other than my own.

I'm stuck with something that must have been dealt to by someone smarter than I.
Thanks
Reply
  #2  
Old September 18th, 2008, 03:41 PM
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Age: 32
Posts: 2,407
Default

try this:
Expand|Select|Wrap|Line Numbers
  1. <%
  2. set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
  3. objHTTP.Open "GET", "http://www.mysite.com", false
  4. objHTTP.Send
  5. Response.Write objHTTP.ResponseText
  6. %>
let me know if this helps.

Jared
Reply
  #3  
Old September 23rd, 2008, 08:11 AM
Newbie
 
Join Date: Sep 2008
Location: Denmark
Age: 23
Posts: 5
Default

You can also use the WinHttpRequest object to retrieve the data from SERVER-B but then I guess you will be stuck with the same problem that I currently have (see http://bytes.com/forum/thread836732.html).

The WinHttpRequest object works a bit like the msxml2 object:

Expand|Select|Wrap|Line Numbers
  1. <%set objWinHttp = Server.createObject("WinHttp.WinHttpRequest.5.1")
  2. objWinHttp.open "POST", SERVER-B-URL
  3. content = FORM-DATA
  4. call objWinHttp.setRequestHeader("Content-type", "Content-type: application/x-www-form-urlencoded")
  5. call objWinHttp.setRequestHeader("Content-length", len(content))
  6. objWinHttp.send(content)
  7. %>
  8.  
Then you can get the response from the property objWinHttp.responseText

From there on I'm stuck with the xml/html-DOM manipulation server-side, therefore I will keep an eye on this thread :)

/KalleMOD
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 204,894 network members.