Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Problem invoking web services

Problem invoking web services

Scheduled Pinned Locked Moved C#
helpcsharpdatabasewcfcom
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dacris
    wrote on last edited by
    #1

    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.

    H 1 Reply Last reply
    0
    • D dacris

      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.

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      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 the Timeout 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-----

      D 1 Reply Last reply
      0
      • H Heath Stewart

        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 the Timeout 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-----

        D Offline
        D Offline
        dacris
        wrote on last edited by
        #3

        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.

        H 1 Reply Last reply
        0
        • D dacris

          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.

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          dacris wrote: How might they be configured incorrectly? If the Proxy property is not correctly set on the HttpWebRequest, 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-----

          D 1 Reply Last reply
          0
          • H Heath Stewart

            dacris wrote: How might they be configured incorrectly? If the Proxy property is not correctly set on the HttpWebRequest, 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-----

            D Offline
            D Offline
            dacris
            wrote on last edited by
            #5

            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.

            H 1 Reply Last reply
            0
            • D dacris

              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.

              H Offline
              H Offline
              Heath Stewart
              wrote on last edited by
              #6

              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-----

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups