Problem invoking web services
-
When I try to use a web service on a computer that connects to the Internet through a router, I get this exception: System.Net.WebException: The operation has timed-out. at System.Net.HttpWebRequest.GetRequestStream() at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at WebTest.com.dacris.www.DBAccess.Select(String query) at WebTest.Form1.button1_Click(Object sender, EventArgs e) Does anyone know why this might occur and how I could fix it? Thanks in advance. I have a symbiotic relationship with my computer.
-
When I try to use a web service on a computer that connects to the Internet through a router, I get this exception: System.Net.WebException: The operation has timed-out. at System.Net.HttpWebRequest.GetRequestStream() at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at WebTest.com.dacris.www.DBAccess.Select(String query) at WebTest.Form1.button1_Click(Object sender, EventArgs e) Does anyone know why this might occur and how I could fix it? Thanks in advance. I have a symbiotic relationship with my computer.
Well, my first guess would be that the web service method is timing out! ;P Also, everything connects to the Internet through a router. Is this web service behind a proxy, or is your client behind a proxy? In some cases, SOAP messages will not work through proxies if not configured right (the client request, that is). I see you're using a database from the calls you're making. It's possible that the query is accessing large amounts of data and is taking longer than the response timeout. In making the request (using the
HttpWebRequest
), you can increase the timeout by setting theTimeout
property to something higher than the default (which is, oddly enough, 100 seconds).-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
-
Well, my first guess would be that the web service method is timing out! ;P Also, everything connects to the Internet through a router. Is this web service behind a proxy, or is your client behind a proxy? In some cases, SOAP messages will not work through proxies if not configured right (the client request, that is). I see you're using a database from the calls you're making. It's possible that the query is accessing large amounts of data and is taking longer than the response timeout. In making the request (using the
HttpWebRequest
), you can increase the timeout by setting theTimeout
property to something higher than the default (which is, oddly enough, 100 seconds).-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
Heath Stewart wrote: Well, my first guess would be that the web service method is timing out! Well, I've tried calling other web services and methods. Some methods have nothing to do with data access. I've even tried Google's APIs. Heath Stewart wrote: Is this web service behind a proxy, or is your client behind a proxy? The client is where the problem occurs, but the client is not behind a proxy. The server doesn't matter. As I said, I tried Google's web service, and it too does not work. The error message is the same. Heath Stewart wrote: In some cases, SOAP messages will not work through proxies if not configured right (the client request, that is). How might they be configured incorrectly? Heath Stewart wrote: you can increase the timeout by setting the Timeout property to something higher than the default (which is, oddly enough, 100 seconds). I've tried this to no avail. I tried a timeout of 300 seconds and it still generated the same error message. I have a symbiotic relationship with my computer.
-
Heath Stewart wrote: Well, my first guess would be that the web service method is timing out! Well, I've tried calling other web services and methods. Some methods have nothing to do with data access. I've even tried Google's APIs. Heath Stewart wrote: Is this web service behind a proxy, or is your client behind a proxy? The client is where the problem occurs, but the client is not behind a proxy. The server doesn't matter. As I said, I tried Google's web service, and it too does not work. The error message is the same. Heath Stewart wrote: In some cases, SOAP messages will not work through proxies if not configured right (the client request, that is). How might they be configured incorrectly? Heath Stewart wrote: you can increase the timeout by setting the Timeout property to something higher than the default (which is, oddly enough, 100 seconds). I've tried this to no avail. I tried a timeout of 300 seconds and it still generated the same error message. I have a symbiotic relationship with my computer.
dacris wrote: How might they be configured incorrectly? If the
Proxy
property is not correctly set on theHttpWebRequest
, the request is most likely going to fail.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
-
dacris wrote: How might they be configured incorrectly? If the
Proxy
property is not correctly set on theHttpWebRequest
, the request is most likely going to fail.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
-
OK. So what do I set the Proxy property to if I'm not using a proxy server? Would it be the IP address of the router? And what about the login information? :confused: I have a symbiotic relationship with my computer.
That is to be set only if you're using a proxy, otherwise don't mess with it. You said you're not using a proxy, so other than checking the domain restrictions on the computers in your test lab, I really don't know what to tell you. Have you tried running the app as a privileged user in the test lab, like some domain admin or the local computer admin? Even with such elevated permissions, the local or domain security policy might be disallowing certain things that are necessary.
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----