Need help for dotNet

  • Thread starter Thread starter Guest
  • Start date Start date
The Service and the app are on my machine.
Even in the browser when I debug the Web Service I can't get it working


Brad Roberts said:
Can you access the same url from a browser at work?

Binh said:
Hi,
I write a C# to get information from a XML site, when I run my program at
home, there's no problem.
But when in office (no proxy, no firewall, port 80 is open), I've got
this
error:

---------------
Unhandled Exception: System.Net.WebException: The underlying connection
was
closed: An unexpected error occurred on a receive.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at ReadXMLfromURL.Class1.CaptureInfo(Object state) in c:\Documents and
Settings\Binh.EEE\Local

settings\Temp\SnippetCompilerTemp\c60a33a1-29ba-4601-9d92-3bae54b7720f\0:line
32
--------------



This is the code
--------------------

using System;

using System.Xml;

using System.IO;



namespace ReadXMLfromURL

{

class Class1

{

static void Main(string[] args)

{

String URLString =
"http://www.worldpress.org/feeds/wprw.xml";

String[] Str = new String[3];

int count = 0;



XmlTextReader reader = new
XmlTextReader
(URLString);



while (reader.Read() & (count<3))

{

switch (reader.NodeType)

{

case
XmlNodeType.Element: // The node is an element.


if
(reader.Name == "title")

{


reader.Read();


Str[count] = reader.Value;


count++;

}


Console.WriteLine("<"
+ reader.Name);


break;

}



}

for (count=0;count<3;count++)


Console.WriteLine(Str[count]);

}



}



}

-------------------------------



Appreciate if you can help.

Thanks.
 
Opps I thought I was clicked on my post,
Sorry!

Brad Roberts said:
Can you access the same url from a browser at work?

Binh said:
Hi,
I write a C# to get information from a XML site, when I run my program at
home, there's no problem.
But when in office (no proxy, no firewall, port 80 is open), I've got
this
error:

---------------
Unhandled Exception: System.Net.WebException: The underlying connection
was
closed: An unexpected error occurred on a receive.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at ReadXMLfromURL.Class1.CaptureInfo(Object state) in c:\Documents and
Settings\Binh.EEE\Local

settings\Temp\SnippetCompilerTemp\c60a33a1-29ba-4601-9d92-3bae54b7720f\0:line
32
--------------



This is the code
--------------------

using System;

using System.Xml;

using System.IO;



namespace ReadXMLfromURL

{

class Class1

{

static void Main(string[] args)

{

String URLString =
"http://www.worldpress.org/feeds/wprw.xml";

String[] Str = new String[3];

int count = 0;



XmlTextReader reader = new
XmlTextReader
(URLString);



while (reader.Read() & (count<3))

{

switch (reader.NodeType)

{

case
XmlNodeType.Element: // The node is an element.


if
(reader.Name == "title")

{


reader.Read();


Str[count] = reader.Value;


count++;

}


Console.WriteLine("<"
+ reader.Name);


break;

}



}

for (count=0;count<3;count++)


Console.WriteLine(Str[count]);

}



}



}

-------------------------------



Appreciate if you can help.

Thanks.
 
Hi,
I write a C# to get information from a XML site, when I run my program at
home, there's no problem.
But when in office (no proxy, no firewall, port 80 is open), I've got this
error:

---------------
Unhandled Exception: System.Net.WebException: The underlying connection was
closed: An unexpected error occurred on a receive.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at ReadXMLfromURL.Class1.CaptureInfo(Object state) in c:\Documents and
Settings\Binh.EEE\Local

settings\Temp\SnippetCompilerTemp\c60a33a1-29ba-4601-9d92-3bae54b7720f\0:line
32
--------------



This is the code
--------------------

using System;

using System.Xml;

using System.IO;



namespace ReadXMLfromURL

{

class Class1

{

static void Main(string[] args)

{

String URLString =
"http://www.worldpress.org/feeds/wprw.xml";

String[] Str = new String[3];

int count = 0;



XmlTextReader reader = new XmlTextReader
(URLString);



while (reader.Read() & (count<3))

{

switch (reader.NodeType)

{

case
XmlNodeType.Element: // The node is an element.

if
(reader.Name == "title")

{


reader.Read();


Str[count] = reader.Value;


count++;

}

Console.WriteLine("<"
+ reader.Name);

break;

}



}

for (count=0;count<3;count++)

Console.WriteLine(Str[count]);

}



}



}

-------------------------------



Appreciate if you can help.

Thanks.
 
Yes, I can

Brad Roberts said:
Can you access the same url from a browser at work?

Binh said:
Hi,
I write a C# to get information from a XML site, when I run my program at
home, there's no problem.
But when in office (no proxy, no firewall, port 80 is open), I've got
this
error:

---------------
Unhandled Exception: System.Net.WebException: The underlying connection
was
closed: An unexpected error occurred on a receive.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at ReadXMLfromURL.Class1.CaptureInfo(Object state) in c:\Documents and
Settings\Binh.EEE\Local

settings\Temp\SnippetCompilerTemp\c60a33a1-29ba-4601-9d92-3bae54b7720f\0:line
32
--------------



This is the code
--------------------

using System;

using System.Xml;

using System.IO;



namespace ReadXMLfromURL

{

class Class1

{

static void Main(string[] args)

{

String URLString =
"http://www.worldpress.org/feeds/wprw.xml";

String[] Str = new String[3];

int count = 0;



XmlTextReader reader = new
XmlTextReader
(URLString);



while (reader.Read() & (count<3))

{

switch (reader.NodeType)

{

case
XmlNodeType.Element: // The node is an element.


if
(reader.Name == "title")

{


reader.Read();


Str[count] = reader.Value;


count++;

}


Console.WriteLine("<"
+ reader.Name);


break;

}



}

for (count=0;count<3;count++)


Console.WriteLine(Str[count]);

}



}



}

-------------------------------



Appreciate if you can help.

Thanks.
 
Back
Top