HTTP 503 (Service Unavailable) error when calling a webservice inside the network

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default HTTP 503 (Service Unavailable) error when calling a webservice inside the network

    Hello

    This problem has been driving me mad for the past few days. I am
    basically writing a generic utility in .NET/C# that can read any WSDL
    file (over internet, intranet, localdir etc), generate dynamic proxy
    on the fly and allow the user to invoke the methods.

    It works perfectly *except* in these scenarios:

    1) If I try to call a webservice deployed on another machine _within_
    our network (LAN), WebResponse.GetResponse() fails with a Server
    Unavailable Error (503).
    2) To solve the above if I specify the correct proxy settings using
    WebProxy.Address property, the WSDL file is retrieved alright.
    2A) However if I assign WebRequest.Proxy with
    WebProxy.GetDefaultProxy() then the WSDL retrieval fails again. But
    lets for the moment ignore this and assume I am ok with step 2.
    3) After I successfully create the dynamic proxy (using CodeDOM et
    al), the MethodInfo.Invoke(objectinstance, argsforthemethod) blows up
    with a WebException. I am attaching the stack trace in the bottom of
    this mail.
    4) I tried setting the Proxy property of SoapHttpClientProtocol
    (objectinstance.GetProperty("Proxy") et al) but that has no effect.
    5) Everything works PERFECTLY WELL if I access a public domain WSDL on
    the internet (with or without the proxy settings -- it doesnt seem to
    matter).

    So bottom line is can somebody *please* tell me why this is not
    working in the LAN scenario? and that too only when I invoke the
    method and not when I retrieve the WSDL file?

    Stacktrace follows:
    ==================
    Exception has been thrown by the target of an invocation.
    System.Net.WebException: The request failed with HTTP status 503:
    Service Unavailable.
    at System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage
    message, WebResponse response, Stream responseStream)
    at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
    methodName, Object[] parameters)
    at WebServices.dynamicProxyGenerator.DynamicProxy.AMS WebService.echoHeartBeat(String
    bstrEchoData)

    Additional Info:
    ================
    WebException.Response ---> System.Net.HttpWebResponse
    WebException.Source ---> System.Web.Services
    WebException.Status ---> ProtocolError
    WebException.TargetSite.Name ---> ReadResponse

    I ran Simon Fell's ([url]www.pocketsoap.com[/url]) excellent tcpTrace utility.
    In the LAN case I am able to see a GET request for my WSDL file (GET
    /amswebservice/amswebservice.wsdl HTTP/1.1) and the subsequent
    response. But when a method is invoked it doesn't even seem to hit
    the webserver. Its intercepted somewhere in between and I can't
    figure out where.

    thanks a ton!
    --Dilip
    Dilip Guest

  2. Similar Questions and Discussions

    1. WebService Behavior problem (Service unavailable on localhost)
      I am running into a problem with trying to use web services in a web page. As an example I created a C# web service using the VS 2003 wizard, the...
    2. HTTP Status-Code=503 (Service Unavailable)
      Hello, I'm doing a performance test and my test graudually increases the connections to the webservice. Everything works well until my...
    3. Service unavailable on First call in synchronous mode only! question for webservice.htc gurus.
      Hi, This is a interesting problem. I got webservice.htc integrated pretty well with .net framework. I wrote a control that generates all the...
    4. No HTTP-GET method available for calling a WEB SERVICE
      I just made a web service with a very simple member function. When I browse to the asmx file to check it, there is not HTTP-GET available for...
    5. HTTP Status 401 -- WebServer calling WebService
      I am trying to 'flow' a Windows Identity from an IE Browser to a Web Server to an App Server (hosted by ASP.NET, exposing WebService interface)....
  3. #2

    Default Re: HTTP 503 (Service Unavailable) error when calling a webservice inside the network

    [email]rdilipk@lycos.com[/email] (Dilip) wrote in message news:<8bc3089c.0307161341.6b00a620@posting.google. com>...
    > Hello
    > [snipped...]
    >
    > So bottom line is can somebody *please* tell me why this is not
    > working in the LAN scenario? and that too only when I invoke the
    > method and not when I retrieve the WSDL file?
    I fixed this myself. Apparently I neglected to set the same proxy
    server configuration on SoapHttpClientProtocol.Proxy property.

    I still can't understand one point though. I basically copied the
    entire proxy server settings found on IE's Tools->Internet
    Options->Connection->LAN Settings page into
    SoapHttpClientProtocol.Proxy property. However the application fails
    if I simply call WebProxy.GetDefaultProxy(). what is the difference
    between these 2 ways of setting up proxies? Why does the former work
    while the latter fails?

    thanks
    --Dilip
    Dilip Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139