473,405 Members | 2,310 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,405 software developers and data experts.

Problem with HttpWebResponse class

Hi

I have a method (very bottom of this post) which I am using for doing
XMLRPC calls.

This works fine locally in Cassini (debug mode in VS2005, WinXP SP2),
however when I run this on my production server (MS Win 2k) I am
getting the following socket error:

System.Net.Sockets.SocketException: No connection could be made because
the target machine actively refused it (Stack trace below).

I have checked firewall settings etc. and it is 99.9% definately not
that - does anyone have any ideas what it could be? I was thinking
maybe the MSXML version so I have installed v6 in addition to v3 but it
has made no difference.

Many thanks in advance (and fingers crossed)

Darren
// STACK TRACE
[SocketException (0x274d): No connection could be made because the
target machine actively refused it]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
SocketAddress socketAddress) +1002130
System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +33
System.Net.ServicePoint.ConnectSocketInternal(Bool ean
connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress&
address, ConnectSocketState state, IAsyncResult asyncResult, Int32
timeout, Exception& exception) +431

[WebException: Unable to connect to the remote server]
System.Net.HttpWebRequest.GetResponse() +1501995
System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials
credentials) +61
System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials
credentials) +1868384
System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role,
Type ofObjectToReturn) +51
System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings
settings, XmlParserContext inputContext) +110
System.Xml.Schema.XmlSchemaSet.Add(String targetNamespace, String
schemaUri) +174
uc_fab_components_SelectCAR.PopulateDepartureAirpo rts(String
sCountryCode, String sFABResortID) +173
uc_fab_components_SelectCAR.Page_Load(Object sender, EventArgs e)
+38
System.Web.Util.CalliHelper.EventArgFunctionCaller (IntPtr fp, Object
o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Cal lback(Object
sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+1061

//METHOD
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sURL);
req.ContentType = "text/xml";
req.Method = "POST";
req.Timeout = 60000;

XmlDocument doc = new XmlDocument();

try
{
doc.LoadXml(xdRequest.InnerXml);
using (Stream post = req.GetRequestStream())
{
doc.Save(post);
}
HttpWebResponse resp =
(HttpWebResponse)req.GetResponse();
using (Stream fetched = resp.GetResponseStream())
{
doc.Load(fetched);
}
}
catch
{
// We need to build some error handing in here
XmlNode xnError = doc.CreateElement("Error");
xnError.Value = "-2002";
doc.AppendChild(xnError);

}

Aug 9 '06 #1
1 4317
Thus wrote daz_oldham,
Hi

I have a method (very bottom of this post) which I am using for doing
XMLRPC calls.

This works fine locally in Cassini (debug mode in VS2005, WinXP SP2),
however when I run this on my production server (MS Win 2k) I am
getting the following socket error:

System.Net.Sockets.SocketException: No connection could be made
because the target machine actively refused it (Stack trace below).

I have checked firewall settings etc. and it is 99.9% definately not
that - does anyone have any ideas what it could be? I was thinking
maybe the MSXML version so I have installed v6 in addition to v3 but
it has made no difference.

Many thanks in advance (and fingers crossed)
The answer is pretty simple: There's nobody listening on your destination
socket at "sURL" or your blocked by a firewall. You can try to connect using
telnet to that socket. Shouldn't work either.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Aug 12 '06 #2

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

Similar topics

0
by: TJO | last post by:
Can someone at MS please reply to this. I am trying to post data so a web form via ssl with the following code. I keep getting this error: "The underlying connection was closed: Could not...
0
by: Michael Evanchik | last post by:
Hello all, since i wanted to use ssl and its seems easy to do so with this object. Im trying to login to a webserver (aol) for this example. But for some reason, im packet sniffing with ethreal...
13
by: Jason Manfield | last post by:
For some URLs (e.g.http://v3.espacenet.com/origdoc?DB=EPODOC&IDX=WO2005028634&F=0&QPN=WO2005028634), the content length for the HttpWebResponse I get with request.GetResponse in empty. The...
4
by: Dante | last post by:
Hello, When I try to decompress a response from a web service I'm getting the error: "hexadecimal value 0x1F, is an invalid character. Line 1, position 1." The web server is an apache server....
2
by: Nuno Magalhaes | last post by:
In pages that there is no content length, how does HttpWebResponse knows where the page ends? And what kind of objects/methods does it retrieve? Does it only retrieve the initial page without any...
6
by: Darren | last post by:
I created a class to submit an xml document to a webpage. When I use my class in a console application, everything submits correctly. However, when I attempt to use my class from an asp.net...
1
by: bliz_87 | last post by:
Hello all, I'm trying to create a simple application that does a HTTP request/response on a button click. Here's the entire code which I got from a reference book: using...
0
by: Alok yadav | last post by:
i am using the link of metacharge.com for payment gateway, when i post data throung IE it give the correct response, but when i use the .net code to post data the response is not correct.message is...
4
by: PiotrKolodziej | last post by:
hi I have a thread that downloades a file. Problem is : Not all files are beeing downloaded. I observed that only the small files are beeing downloaded correctly. I also cant download two files...
5
by: Dhananjay | last post by:
hello everyone I have a problem with xml and sql server 2k. first thing i have a website named this-> http://en.infosites.org/info/keyword. when i am entering a value for keyword like this ->...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.