473,397 Members | 1,961 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,397 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 1966
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.