Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: HTTP Post and XML (and swimming with sharks)


Message #1 by "J Donahue" <jdonahue@f...> on Tue, 13 Aug 2002 21:01:40
Sheesh, I feel like I'm swimming with sharks.  I need to get some 
information from a web service.  The specs say that it has to be 
submitted via HTTP1.1 Post.  Then they say that the ONLY way to start a 
session is as follows:

<?xml version="1.0" encoding="utf-8"?>
<Protocol version="1.0">
<Header>
<SessionStart uid="myid" pwd="mypwd" />
</Header>
</Protocol>

So, I decided to try connecting in my VB.NET code-behind as:


Dim mytext As String
mytext = "<?xml version=1.0 encoding=utf-8?>" _
 & "<Protocol version=1.0>" _
 & "<Header>" _
 & "<SessionStart uid=myid pwd=mypwd />" _
 & "</Header>" _
 & "</Protocol>"

Dim getPage
' Create an xmlhttp object:
Dim objProxy
objProxy = Server.CreateObject("MSXML2.ServerXMLHTTP")

' Opens the connection to the remote server.
Dim objXMLDoc As New XmlDocument()
objProxy.open("POST", "http://xml.nada.com/default.asp")
objProxy.send(mytext)
objXMLDoc.LoadXml(objProxy.responseText)

And I replaced the send with objProxy.send("uid=myid&pwd=mypwd")

Nothing seems to work and I get a "Connection with the server could not 
be established" error?

Anyone have any shark repellant to help me out of this mess?

Thanks!!!!!!!!

  Return to Index