locked
Bad request (400) when running locally and not connected to the internet RRS feed

  • Question

  • Sometimes I work at the local coffee shop or library, where internet connections are sketchy.  Why is it when I have no internet connection I'll get an http 400 request message when doing something like this in my app?

    http://localhost:52937/ApplicationData.svc/People?$filter=Id%20eq%2023

    That's a localhost query from the browser's network tab.

    The web server is up and running and my app runs, but when I try to connect to pull some data from my local SQL instance (as above), unless I'm connected to the internet I'll get a 400 error.  Any ideas what might be going on?

    Sunday, September 7, 2014 1:37 AM

Answers

  • Hi jim,

    It seems that you are using the WCF Service, then please try to enable the WCF Tracing which will help us to find the root cause.

    The following configuration taken from MSDN can be applied to enable tracing on your WCF service.

    <configuration>
      <system.diagnostics>
        <sources>
          <source name="System.ServiceModel"
                  switchValue="Information, ActivityTracing"
                  propagateActivity="true" >
            <listeners>
                 <add name="xml"/>
            </listeners>
          </source>
          <source name="System.ServiceModel.MessageLogging">
            <listeners>
                <add name="xml"/>
            </listeners>
          </source>
          <source name="myUserTraceSource"
                  switchValue="Information, ActivityTracing">
            <listeners>
                <add name="xml"/>
            </listeners>
          </source>
        </sources>
        <sharedListeners>
            <add name="xml"
                 type="System.Diagnostics.XmlWriterTraceListener"
                 initializeData="Error.svclog" />
        </sharedListeners>
      </system.diagnostics>
    </configuration>
    
    

    Best Regards,
    Amy Peng

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Angie Xu Thursday, September 18, 2014 5:25 AM
    Wednesday, September 10, 2014 7:56 AM
    Moderator