0

I've written a WCF Restful service and I have also written a test project to test the service. When my test project tries to make the a call to the wcf Method, it crashes with a 400 bad request error. I cannot see anything wrong with my code so on the WCF project I have enabled tracing via the app.config file, but when I look in the Microsoft Service Trace Viewer it is totally empty. Here's the section thatI have placed in the app.config.

<system.diagnostics>
<sources>
  <source propagateActivity="true" name="System.ServiceModel" switchValue="Critical,ActivityTracing">
    <listeners>
      <add type="System.Diagnostics.DefaultTraceListener" name="Default">
        <filter type="" />
      </add>
      <add name="xml">
        <filter type="" />
      </add>
    </listeners>
  </source>
  <source name="System.ServiceModel.MessageLogging">
    <listeners>
      <add type="System.Diagnostics.DefaultTraceListener" name="Default">
        <filter type="" />
      </add>
      <add name="xml">
        <filter type="" />
      </add>
    </listeners>
  </source>
  <source name="myUserTraceSource" switchValue="Information, ActivityTracing">
    <listeners>
      <add type="System.Diagnostics.DefaultTraceListener" name="Default">
        <filter type="" />
      </add>
      <add name="xml">
        <filter type="" />
      </add>
    </listeners>
  </source>
</sources>
<sharedListeners>
  <add initializeData="TraceLog.svclog" type="System.Diagnostics.XmlWriterTraceListener"
    name="xml" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp">
    <filter type="" />
  </add>
</sharedListeners>

bilpor
  • 3,467
  • 6
  • 32
  • 77
  • Not sure, but I wonder if the request is even hitting the service? Have you checked the event viewer on the server? You might also want to enable failed request tracing in IIS (I think that's what it's called). – Tim Nov 12 '15 at 18:52
  • @Tim. I dont think I'm going through IIS it's using Cassini and the mex address – bilpor Nov 13 '15 at 09:59
  • basically the uri that I am creating for the web request is : http://localhost/WcfService/mex/GetProducts. if I try to ctrl+click I receive not found. If I change the link to be http://localhost/WcfService and click I get the window displaying showing that the service is available – bilpor Nov 13 '15 at 10:15
  • Ok, I'm getting stuff in the trace viewer now, but it's not giving me anything meaningful. However, If I go to localhost/WcfService/mex I get webpage cant be found. if I go to localhost/WcFService/basicHttpBinding I get endpoint cannot be found. – bilpor Nov 13 '15 at 11:37
  • You just need to get your URL correct. Try localhost/WcfService and see if you get the WCFService start page that has the link to the WSDL page. Update your Test application with the correct URL – Rajesh Jun 10 '16 at 15:45

0 Answers0