Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XML
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 22nd, 2004, 12:50 PM
Registered User
 
Join Date: Dec 2004
Location: Kingston, RI, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Request and Response from server in XML

Hi,
I am working on a project that requires me to send a request to a server in form of an XML file and recieve response in XML. Can someone tell me how this can be done

Thanks,
Smitha

Reply With Quote
  #2 (permalink)  
Old December 23rd, 2004, 04:22 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

See this link and search for msxml2.domdocument in google.groups, hundreds of examples. Make sure you use the modern classes, msxml2.domdocument, NOT microsoft.xmldom.
http://msdn.microsoft.com/library/de...asp?frame=true



--

Joe (Microsoft MVP - XML)
Reply With Quote
  #3 (permalink)  
Old December 23rd, 2004, 10:48 AM
Registered User
 
Join Date: Dec 2004
Location: Kingston, RI, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dim HttpReq As New MSXML2.XMLHTTP30
HttpReq.open "GET", "http://localhost/books.xml", False
xmltext ="XML Here"
Dim xmldom As New MSXML2.DOMDocument
xmldom.loadXML xmltext
HttpReq.send(xmldom)
MsgBox HttpReq.responseXML

Is this correct?

Thanks
Smitha

Reply With Quote
  #4 (permalink)  
Old December 24th, 2004, 07:20 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Almost, your xml is not xml (this might be the bulletin board though, and you use post if you are sending data on the send data:
Code:
 Dim HttpReq As New MSXML2.XMLHTTP30
HttpReq.open "POST", "http://localhost/books.xml", False
xmltext ="<root>XML Here</root>"
Dim xmldom As New MSXML2.DOMDocument
xmldom.loadXML xmltext
HttpReq.send(xmldom)
MsgBox HttpReq.responseXML
Your url won't be "http://localhost/books.xml" though, this will just return the contents of the xml file and will ignore your sent data. If you want to modify the response according to the data sent you need to use some sort of server side processing, ASP for example.
Code:
Set oDom = CreateObject("msxml2.domdocument.4.0")
oDom.async = False
oDom.load Request
'Examine oDom and then send back xml:
Response.contentType = "text/xml"
'...

--

Joe (Microsoft MVP - XML)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XML request and get response praveenkumar .NET Web Services 0 May 23rd, 2007 04:13 AM
send XML Request and get XML Response prashant_dnmmkpk VB.NET 2 February 25th, 2005 03:34 PM
Request-response in Tomcat sherbir Servlets 0 September 4th, 2004 04:26 AM
Help sending XML file to server, reading response bradartigue XML 1 September 5th, 2003 07:42 AM



All times are GMT -4. The time now is 03:13 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.