Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > HTTPWebRequest ?????

Reply
Thread Tools

HTTPWebRequest ?????

 
 
Francois
Guest
Posts: n/a
 
      01-16-2008
Hello,

I cannot understand how this works ...


I do :

XmlDocuement DocIn = new XmlDocument();

blah blah for DocIn.

try{
MyRequest =
(HttpWebRequest)HttpWebRequest.Create("http://myserver/myxmlweb/Default.aspx");
MyRequest.Method = "POST";
MyRequest.ContentType = "text/xml;";
DocIn.Save(MyRequest.GetRequestStream());
MyRequest.Timeout = 5000;
//Get Response
HttpWebResponse = (HttpWebResponse)MyRequest.GetResponse();
}
catch(E ...

And I am locked forever in GetResponse(). No exception, no timeout, just
plain dull lock.

What s wrong ?

mysever uses integrated IIS authentification. I do set any credential for
myRequest. So I am expecting at least a HTTP 401 response.

Thanks.


 
Reply With Quote
 
 
 
 
Francois
Guest
Posts: n/a
 
      01-16-2008
Adding a stream.closes() added a bit.

Is there a better coding way to send an XML file ?

Thanks.


"Francois" <francois@corebridgecom> a écrit dans le message de news:
%23ZXpn$(E-Mail Removed)...
> Hello,
>
> I cannot understand how this works ...
>
>
> I do :
>
> XmlDocuement DocIn = new XmlDocument();
>
> blah blah for DocIn.
>
> try{
> MyRequest =
> (HttpWebRequest)HttpWebRequest.Create("http://myserver/myxmlweb/Default.aspx");
> MyRequest.Method = "POST";
> MyRequest.ContentType = "text/xml;";
> DocIn.Save(MyRequest.GetRequestStream());
> MyRequest.Timeout = 5000;
> //Get Response
> HttpWebResponse = (HttpWebResponse)MyRequest.GetResponse();
> }
> catch(E ...
>
> And I am locked forever in GetResponse(). No exception, no timeout, just
> plain dull lock.
>
> What s wrong ?
>
> mysever uses integrated IIS authentification. I do set any credential for
> myRequest. So I am expecting at least a HTTP 401 response.
>
> Thanks.
>
>



 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      01-16-2008
it all depends on the server you are posting to, and how the file is handled.
its common for the server to not send the response until the he request has
been completely received.

with webrequest and a post, until you close the stream, there is no way to
know when you are done send data to the server.

now with the right server you could could keep the sockets open and have
both streams going.

-- bruce (sqlwork.com)


"Francois" wrote:

> Adding a stream.closes() added a bit.
>
> Is there a better coding way to send an XML file ?
>
> Thanks.
>
>
> "Francois" <francois@corebridgecom> a écrit dans le message de news:
> %23ZXpn$(E-Mail Removed)...
> > Hello,
> >
> > I cannot understand how this works ...
> >
> >
> > I do :
> >
> > XmlDocuement DocIn = new XmlDocument();
> >
> > blah blah for DocIn.
> >
> > try{
> > MyRequest =
> > (HttpWebRequest)HttpWebRequest.Create("http://myserver/myxmlweb/Default.aspx");
> > MyRequest.Method = "POST";
> > MyRequest.ContentType = "text/xml;";
> > DocIn.Save(MyRequest.GetRequestStream());
> > MyRequest.Timeout = 5000;
> > //Get Response
> > HttpWebResponse = (HttpWebResponse)MyRequest.GetResponse();
> > }
> > catch(E ...
> >
> > And I am locked forever in GetResponse(). No exception, no timeout, just
> > plain dull lock.
> >
> > What s wrong ?
> >
> > mysever uses integrated IIS authentification. I do set any credential for
> > myRequest. So I am expecting at least a HTTP 401 response.
> >
> > Thanks.
> >
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue with System.Net.HttpWebRequest Greg Reevosh via .NET 247 ASP .Net 1 11-19-2004 11:26 PM
HttpWebRequest problem: Please help Sojwal ASP .Net 1 11-10-2004 09:00 PM
Issue with System.Net.HttpWebRequest Greg Reevosh via .NET 247 ASP .Net 0 10-31-2004 11:48 AM
Issue with System.Net.HttpWebRequest Greg Reevosh via .NET 247 ASP .Net 1 10-22-2004 06:21 PM
HttpWebResponse/HttpWebRequest problem... Satinderpal Singh ASP .Net 2 06-04-2004 04:40 AM



Advertisments