473,321 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Strange behaving XMLHTTP

Hi everyone

I am trying to get the content of any webpage (URL) using XMLHTTP, and it
is working fine for me, but suddenly I have got

a URL "http://www.bizrate.com/" which is causing a system error and the
error is

System.Runtime.InteropServices.COMException(0xC00C E56E): System error:-
1072896658

here is the code, which I am using to get the content

''''''''''''''''''''''''''''''''''''''''''''''
Dim a As Object
a = CreateObject("Microsoft.XMLHTTP")
a.open("GET","http://www.bizrate.com/",False)
a.Send("")
TextBox1.Text = a.ResponseText
''''''''''''''''''''''''''''''''''''''''''''''

Can anybody help me to solve this problem, I have tried it using VB6 also,
and VB6 is also showing the same error.

One more thing I want to say about this, is that, I have got the content of
the URL "http://www.bizrate.com/" by typing the

address into the addressbar of the browser (IE), and got the HTML from
view->source, and then saved the HTML into my

localhost and changed the URL by "http://localhost/testpage.html and the
application worked for me, but it is not working

when the URL is used with XMLHTTP

Kajol
Jul 21 '05 #1
3 1962
Here is a snippet in C# that I extracted from a project on GotDotNet,
showing you how to do this using a .NET object, instead of a COM component.

This was extracted from
http://www.gotdotnet.com/Community/U...5-ED43CC83A68C
SiteMap 1.1 HTML Page Scraper (PageScanner.cs)

Hope this helps,
--- Nick

HttpWebRequest request;
HttpWebResponse response;
request = (HttpWebRequest)WebRequest.Create( url );
// *** BLOCK THREAD ***
response = (HttpWebResponse)request.GetResponse();

try {

// Read the response into a Stream object.
Stream responseStream = response.GetResponseStream();
if( responseStream == null ) {
throw new ApplicationException( "Server sent empty response stream
for "+url );
}
StreamReader reader=null;
try{
reader = new StreamReader( responseStream,
System.Text.Encoding.Default );

// *** BLOCK THREAD *** - until whole stream is read.
htmlText = reader.ReadToEnd(); // read in the web page

} catch( System.ArgumentOutOfRangeException ex) {
// this resolves back to the StreamReader having a byteCount of <
0 for its input buffer
// is caused by the connection failing with this exception in the
response
//IOException: Unable to read data from the transport connection
// Maybe the TcpConnect in just failed?
// anyway retry

throw ex;
} catch(Exception ex ) {
throw ex;
} finally{
if( reader != null ) reader.Close(); // manual clean up required or
will run out of WebHttp resources
}
} catch(Exception ex ) {
throw ex;
} finally{
response.Close(); // Release the HttpWebResponse resource. if we fail
to do this we may run out of connections
}
"kajol" <ka***@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
Hi everyone

I am trying to get the content of any webpage (URL) using XMLHTTP, and it is working fine for me, but suddenly I have got

a URL "http://www.bizrate.com/" which is causing a system error and the
error is

System.Runtime.InteropServices.COMException(0xC00C E56E): System error:-
1072896658

here is the code, which I am using to get the content

''''''''''''''''''''''''''''''''''''''''''''''
Dim a As Object
a = CreateObject("Microsoft.XMLHTTP")
a.open("GET","http://www.bizrate.com/",False)
a.Send("")
TextBox1.Text = a.ResponseText
''''''''''''''''''''''''''''''''''''''''''''''

Can anybody help me to solve this problem, I have tried it using VB6 also,
and VB6 is also showing the same error.

One more thing I want to say about this, is that, I have got the content of the URL "http://www.bizrate.com/" by typing the

address into the addressbar of the browser (IE), and got the HTML from
view->source, and then saved the HTML into my

localhost and changed the URL by "http://localhost/testpage.html and the
application worked for me, but it is not working

when the URL is used with XMLHTTP

Kajol

Jul 21 '05 #2
Thanks for the reply
I have tested with this .NET object and it is working fine
for the URL I have spacified, but can u do the same thing
for me using XMLHTTP, because I have developed a lot of my
project by XMLHTTP and at this point I do not want to
change from XMLHTTP to webreq/res

Kajol
-----Original Message-----
Here is a snippet in C# that I extracted from a project on GotDotNet,showing you how to do this using a .NET object, instead of a COM component.
This was extracted from
http://www.gotdotnet.com/Community/U...es/Details.asp x?SampleGuid=DB30109D-5161-4713-B6A5-ED43CC83A68CSiteMap 1.1 HTML Page Scraper (PageScanner.cs)

Hope this helps,
--- Nick

HttpWebRequest request;
HttpWebResponse response;
request = (HttpWebRequest)WebRequest.Create( url );
// *** BLOCK THREAD ***
response = (HttpWebResponse)request.GetResponse();

try {

// Read the response into a Stream object.
Stream responseStream = response.GetResponseStream();
if( responseStream == null ) {
throw new ApplicationException( "Server sent empty response streamfor "+url );
}
StreamReader reader=null;
try{
reader = new StreamReader( responseStream,
System.Text.Encoding.Default );

// *** BLOCK THREAD *** - until whole stream is read. htmlText = reader.ReadToEnd(); // read in the web page
} catch( System.ArgumentOutOfRangeException ex) {
// this resolves back to the StreamReader having a byteCount of <0 for its input buffer
// is caused by the connection failing with this exception in theresponse
//IOException: Unable to read data from the transport connection // Maybe the TcpConnect in just failed?
// anyway retry

throw ex;
} catch(Exception ex ) {
throw ex;
} finally{
if( reader != null ) reader.Close(); // manual clean up required orwill run out of WebHttp resources
}
} catch(Exception ex ) {
throw ex;
} finally{
response.Close(); // Release the HttpWebResponse resource. if we failto do this we may run out of connections
}
"kajol" <ka***@discussions.microsoft.com> wrote in message
news:69**********************************@microso ft.com...
Hi everyone

I am trying to get the content of any webpage (URL) using XMLHTTP, and
it
is working fine for me, but suddenly I have got

a URL "http://www.bizrate.com/" which is causing a
system error and the error is

System.Runtime.InteropServices.COMException (0xC00CE56E): System error:- 1072896658

here is the code, which I am using to get the content

''''''''''''''''''''''''''''''''''''''''''''''
Dim a As Object
a = CreateObject("Microsoft.XMLHTTP")
a.open("GET","http://www.bizrate.com/",False)
a.Send("")
TextBox1.Text = a.ResponseText
''''''''''''''''''''''''''''''''''''''''''''''

Can anybody help me to solve this problem, I have tried it using VB6 also, and VB6 is also showing the same error.

One more thing I want to say about this, is that, I have got the contentof
the URL "http://www.bizrate.com/" by typing the

address into the addressbar of the browser (IE), and

got the HTML from view->source, and then saved the HTML into my

localhost and changed the URL by "http://localhost/testpage.html and the application worked for me, but it is not working

when the URL is used with XMLHTTP

Kajol

.

Jul 21 '05 #3
IMHO, It would be easier to use a Facade pattern.

Create an internal object, of your own, that behaves just like XMLHTTP.
Give it the same properties and methods as XMLHTTP (but only the ones that
you actually use... don't bother with the rest). Within your own object,
call the .NET object to do the actual work.

Then, go through your code. In every place where you are creating an
XMLHTTP, create one of your internal objects instead. Change only the
declaration and the "create object" call. Leave the rest. When you
recompile your app, you will be free of XMLHTTP.

Sorry, I can't provide code to make XMLHTTP work. I haven't used that
object in about three years, and even then, only lightly. I'm no expert in
solving problems with it. If you are determined to stick with it, I can
provide only encouragement. Perhaps another responder on the NG can provide
some more detail.

--- Nick

<an*******@discussions.microsoft.com> wrote in message
news:29****************************@phx.gbl...
Thanks for the reply
I have tested with this .NET object and it is working fine
for the URL I have spacified, but can u do the same thing
for me using XMLHTTP, because I have developed a lot of my
project by XMLHTTP and at this point I do not want to
change from XMLHTTP to webreq/res

Kajol
-----Original Message-----
Here is a snippet in C# that I extracted from a project

on GotDotNet,
showing you how to do this using a .NET object, instead

of a COM component.

This was extracted from
http://www.gotdotnet.com/Community/U...es/Details.asp

x?SampleGuid=DB30109D-5161-4713-B6A5-ED43CC83A68C
SiteMap 1.1 HTML Page Scraper (PageScanner.cs)

Hope this helps,
--- Nick

HttpWebRequest request;
HttpWebResponse response;
request = (HttpWebRequest)WebRequest.Create( url );
// *** BLOCK THREAD ***
response = (HttpWebResponse)request.GetResponse();

try {

// Read the response into a Stream object.
Stream responseStream = response.GetResponseStream();
if( responseStream == null ) {
throw new ApplicationException( "Server sent

empty response stream
for "+url );
}
StreamReader reader=null;
try{
reader = new StreamReader( responseStream,
System.Text.Encoding.Default );

// *** BLOCK THREAD *** - until whole stream is

read.
htmlText = reader.ReadToEnd(); // read in the

web page

} catch( System.ArgumentOutOfRangeException ex) {
// this resolves back to the StreamReader

having a byteCount of <
0 for its input buffer
// is caused by the connection failing with this

exception in the
response
//IOException: Unable to read data from the

transport connection
// Maybe the TcpConnect in just failed?
// anyway retry

throw ex;
} catch(Exception ex ) {
throw ex;
} finally{
if( reader != null ) reader.Close(); // manual

clean up required or
will run out of WebHttp resources
}
} catch(Exception ex ) {
throw ex;
} finally{
response.Close(); // Release the HttpWebResponse

resource. if we fail
to do this we may run out of connections
}
"kajol" <ka***@discussions.microsoft.com> wrote in message
news:69**********************************@microso ft.com...
Hi everyone

I am trying to get the content of any webpage (URL) using XMLHTTP, and
it
is working fine for me, but suddenly I have got

a URL "http://www.bizrate.com/" which is causing a

system error and the error is

System.Runtime.InteropServices.COMException (0xC00CE56E): System error:- 1072896658

here is the code, which I am using to get the content

''''''''''''''''''''''''''''''''''''''''''''''
Dim a As Object
a = CreateObject("Microsoft.XMLHTTP")
a.open("GET","http://www.bizrate.com/",False)
a.Send("")
TextBox1.Text = a.ResponseText
''''''''''''''''''''''''''''''''''''''''''''''

Can anybody help me to solve this problem, I have tried it using VB6 also, and VB6 is also showing the same error.

One more thing I want to say about this, is that, I have got the content
of
the URL "http://www.bizrate.com/" by typing the

address into the addressbar of the browser (IE), and

got the HTML from view->source, and then saved the HTML into my

localhost and changed the URL by "http://localhost/testpage.html and the application worked for me, but it is not working

when the URL is used with XMLHTTP

Kajol

.

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: frustratedcoder | last post by:
When I call the transformnode on my xml object like this: response.write xmlobj.transformnode(xsl) I get the actual xsl sent to the browser. Here is my code: <%@LANGUAGE="VBSCRIPT"%> <%...
9
by: fochie | last post by:
Greetings, I'm having a problem when I try to GET a file from my server via xmlhttp when using Mozilla. With IE I can get any type of file fine, get/display headers fine, etc. With Mozilla,...
0
by: elime | last post by:
Hi all I have a strange behaving on some PC with my DataGrid. It only occurs on some PC, on others it works perfectly fine. ->(same ..net version installed) it's very confusing. starting...
2
by: Daniel | last post by:
Hello Everyone, I am using VS 2002 (VB.NET) and have a MDI application in which the user will open several child windows at the same time. I have included a menu Window, which MDIList property...
3
by: kajol | last post by:
Hi everyone I am trying to get the content of any webpage (URL) using XMLHTTP, and it is working fine for me, but suddenly I have got a URL "http://www.bizrate.com/" which is causing a system...
9
by: balakrishnan.dinesh | last post by:
hi friends, Exactly what i want to know is, In my product we are using xmlhttp request to retrive some data from the server, And Im using IE browser, its working fine in IE. Now i want to work...
8
by: Dox33 | last post by:
I ran into a very strange behaviour of raw_input(). I hope somebody can tell me how to fix this. (Or is this a problem in the python source?) I will explain the problem by using 3 examples....
4
by: Carlo Chiari | last post by:
Hi devs, in my application I need to update a simple text file every time the user checks an item of a radio group. I use AJAX method to do this stuff. In the start page I have this code for...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.