Re: Internet/Web classes in .NET/VC++...



"Peter Hayes" <phayes02@xxxxxxxxxxxx> wrote in message
news:63fUf.5252$Mj.8@xxxxxxxxxxxxxxxxxxxxxxx
Hi All,

I have done some C, C++, C# development over the years, but wouldn't call
myself an 'expert' at any of them (this has always been a part-time, write
what is needed endeavor with whatever language was available or
necessary). My networking experience (in programming anyway) is even more
limited, although I have a basic understanding of networks, TCP/IP,
ethernet, etc.

I have a project that involves sending a query to a database with a
web-based interface. The response is a window that contains a javascript
function/method and some parameters (as well as a session cookie) that
open a child window and request the result of the query from another page
(with the cookie and some of the parameters specifying the specific result
requested).

If I use the C++ WebClient class, I can successfully get the end results.
I send the query parameters as name-value pairs, parse the returned HTML
and javascript to obtain the parameters necessary, redirect the same
WebClient object to the new page for the results, and obtain the results.

The problem I have is that, in order to implement all the possible
queries, I cannot use the name-value form for sending data. The Web
interface to the database is not .NET, SOAP, or any 'standard' interface,
and uses formatting that the WebClient class doesn't like - it reformats
the queries so that the database end chokes on the more complicated
queries.

So, I tried the HTTPWebRequest class (inherited from WebRequest, specific
to HTTP). I can send all queries necessary and receive and parse the
initial response (the javascript and scripted redirect). However, there
seems to be no way to 'redirect' the HTTPWebRequest object to a new page
to retrieve the results.

Creating a new object using HTTPWebRequest has not, so far, worked (even
if I save and assign it the cookiecollection from the first request and
send the same sessionID cookie). Using an Ethernet sniffer I have
inspected the packets of the operating-but-limited WebCLient and the
non-operating-but-unlimited HTTPWebRequest and found a header entry of
"Path=/" as the only significant (that I can see) difference between the
one that works (and retrieves my results) and the one that does not (and
places me on a login page on the remote server - with no means of logging
in without starting over with a new sessionID). I have not found any means
of 'placing' the "Path=/" into the header - everything results in an error
because of the format.

Anyone have any ideas? I'm at a loss...

Thanks a lot for any suggestion! I'm wringing my hair on this one...



Pete

Have you tried to add a header to the HttpWebRequest::Headers collection of
your request?

Marcus


.



Relevant Pages

  • Internet/Web classes in .NET/VC++...
    ... The response is a window that contains a javascript function/method and some parameters (as well as a session cookie) that open a child window and request the result of the query from another page. ... The Web interface to the database is not .NET, SOAP, or any 'standard' interface, and uses formatting that the WebClient class doesn't like - it reformats the queries so that the database end chokes on the more complicated queries. ... there seems to be no way to 'redirect' the HTTPWebRequest object to a new page to retrieve the results. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Internet/Web classes in .NET/VC++...
    ... The Web interface to the database is not .NET, SOAP, or any 'standard' interface, and uses formatting that the WebClient class doesn't like - it reformats the queries so that the database end chokes on the more complicated queries. ... there seems to be no way to 'redirect' the HTTPWebRequest object to a new page to retrieve the results. ... Using an Ethernet sniffer I have inspected the packets of the operating-but-limited WebCLient and the non-operating-but-unlimited HTTPWebRequest and found a header entry of "Path=/" as the only significant difference between the one that works and the one that does not. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Internet/Web classes in .NET/VC++...
    ... The path is part of the cookie. ... If I use the C++ WebClient class, I can successfully get the end results. ... The Web interface to the database is not .NET, SOAP, or any 'standard' interface, and uses formatting that the WebClient class doesn't like - it reformats the queries so that the database end chokes on the more complicated queries. ... So, I tried the HTTPWebRequest class. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: forms auth, authenticate against already encrypted password?
    ... i actually tried using a WebClient implementation first, sending a POST request to login.aspx which handled Request.Formetc in the Page_Load event. ... i have tried it again using the HttpWebRequest class and now i can share the CookieContainers, ... programamtically send request to forms authentication protected webpage. ... you can consider share a cookie container ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • True asynchronous HttpWebRequest implementation with abort and timeout
    ... I'm tired of seeing all these asynchronous HttpWebRequest ... How do I implement an cancel method that aborts the request? ... private static void RespCallback(IAsyncResult asynchronousResult) ... // Read the response into a Stream object. ...
    (microsoft.public.dotnet.framework)

Loading