Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: HttpWebRequest and Web Services


Message #1 by "J Donahue" <jdonahue@f...> on Tue, 13 Aug 2002 22:28:29
HttpWebRequest and Web Services  Posted on:  August 13 2002 14:15 GMT -
08:00  
   



I'm trying to access the NADA.Com web service.  They say it requires the 
use of HTTP1.1 Post and the following to start a session: 

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

Dim myReq As HttpWebRequest = CType(WebRequest.Create
("http://xml.nada.com/default.asp"), HttpWebRequest) 
Dim rsp As HttpWebResponse 
Dim mystring As String 

myReq.ProtocolVersion = HttpVersion.Version11 
myReq.Method = "POST" 
myReq.Headers.Add("uid", "MYUID") 
myReq.Headers.Add("pwd", "MYPWD") 
rsp = myReq.GetResponse() 
Dim reader As New StreamReader(rsp.GetResponseStream()) 
mystring = reader.ReadToEnd() 

My current error is "The underlying connection was closed: Unable to 
connect to the remote server. " 

Can anyone tell me what I'm missing?  And, do I need to specifiy the utf-
8 encoding somewhere??  This thing's been kicking me in the face all day. 

Thanks!!!!!!!!!!!!!!

  Return to Index