已答复 WCF Service Hosted in Windows Service Throwing a 503

  • 2012年3月16日 15:16
     
     

    I can't seem to get around the 503 error.  Can't anyone please assist or give some feedback.  I have attached my web.config.  Thanks in advance.


    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <configSections>
      </configSections>
      <connectionStrings>
       
      </connectionStrings>
      <system.serviceModel>
        <diagnostics>
          <messageLogging logMalformedMessages="true" logMessagesAtTransportLevel="true" />
        </diagnostics>
        <bindings>
          <basicHttpBinding>
            <binding name="RackleyServiceBinding" maxBufferSize="2147483647"
            maxReceivedMessageSize="2147483647" />
          </basicHttpBinding>
        </bindings>
        <client />
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true">


        </serviceHostingEnvironment>
        <behaviors>
          <serviceBehaviors>
            <behavior name="RackleyServiceBehavior">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            </behavior>
          </serviceBehaviors>
          <endpointBehaviors>
            <behavior name="CrossDomainBehavior">
              <webHttp />
            </behavior>
          </endpointBehaviors>
        </behaviors>
        <services>
          <service behaviorConfiguration="RackleyServiceBehavior" name="RackleyService.DataConnection.AcordConnection">
            <endpoint address="Design_Time_Addresses/RackleyService.DataConnection/AcordConnection/"
              binding="basicHttpBinding" bindingConfiguration="RackleyServiceBinding"
     name="AcordConnection" contract="RackleyService.DataConnection.IAcordConnection">
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" name="AcordMex"
              contract="IMetadataExchange" />
            <endpoint address="" behaviorConfiguration="CrossDomainBehavior"
              binding="webHttpBinding" name="CrossDomain" contract="RackleyService.DataConnection.ICrossDomainService">
            </endpoint>
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:8731/"/>
              </baseAddresses>
            </host>
          </service>
        </services>
      </system.serviceModel>
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
      </startup>
      <system.net>
        <defaultProxy>
          <proxy bypassonlocal="False" usesystemdefault="True" />
        </defaultProxy>
      </system.net>
    </configuration>
    • 已编辑 sjscga 2012年3月16日 15:21
    • 已编辑 sjscga 2012年3月16日 15:21
    •  

全部回复

  • 2012年3月16日 17:19
     
     
     

    Are you sure, you are referring to a correct configuration file? Windows Service always refers to an app.config rather than web.config.

    503 seem to be “System.ServiceModel.EndpointNotFoundException with No connection could be made because the target machine actively refused it stuff”.

    From your configuration my suspect is below configuration should consists of a valid Address. (Just to verify these relative address is fine)

    <endpoint address="Design_Time_Addresses/RackleyService.DataConnection/AcordConnection/">

    <endpoint address="" behaviorConfiguration="CrossDomainBehavior"

    Can you share the detailed exceptions and when you get this exception?


    Lingaraj Mishra

  • 2012年3月16日 20:43
     
     

    I'm sorry.  I meant my app.config file.  The problem is when I try to access

    http://localhost:8731/Design_Time_Addresses/RackleyService.DataConnection/AcordConnection.  I get a

    Service Unavailable


    HTTP Error 503. The service is unavailable.

    System.ServiceModel.CommunicationException was unhandled by user code
      Message=The remote server returned an error: NotFound.
      StackTrace:
           at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
           at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
           at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)
           at Vin_Verification.RackleyService.AcordConnectionClient.AcordConnectionClientChannel.EndGetClientFromInsuredId(IAsyncResult result)
           at Vin_Verification.RackleyService.AcordConnectionClient.Vin_Verification.RackleyService.IAcordConnection.EndGetClientFromInsuredId(IAsyncResult result)
           at Vin_Verification.RackleyService.AcordConnectionClient.OnEndGetClientFromInsuredId(IAsyncResult result)
           at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
      InnerException: System.Net.WebException
           Message=The remote server returned an error: NotFound.
           StackTrace:
                at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
                at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
                at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
           InnerException: System.Net.WebException
                Message=The remote server returned an error: NotFound.
                StackTrace:
                     at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
                     at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClassa.<EndGetResponse>b__9(Object sendState)
                     at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__1(Object sendState)
                InnerException:


    • 已编辑 sjscga 2012年3月16日 20:45
    •  
  • 2012年3月16日 20:58
     
     已答复

    Anything 5XX range is server side generated which probably means when you deployed the server something was hosed in the configuration.  If it worked ok on your dev machine, then pay close attention to anything that sets up what IP Address or other communcations ports etc. will be used. 

    http://www.checkupdown.com/status/E503.html


    JP Cowboy Coders Unite!