2

I build a very basic wcf service using visual studio development server just to see fiddler working:

c#

 public class Service1 : IService1
    {
        public string GetData(int value)
        {
            return string.Format("You entered: {0}", value);
        }

        public CompositeType GetDataUsingDataContract(CompositeType composite)
        {
            if (composite == null)
            {
                throw new ArgumentNullException("composite");
            }
            if (composite.BoolValue)
            {
                composite.StringValue += "Suffix";
            }
            return composite;
        }
    }

web.config

<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
</configuration>

when I run the wcftestclient it shows up the getdata() works but does not show up in fiddler? how can i amend this?

thanks P

user603007
  • 11,416
  • 39
  • 104
  • 168
  • 2
    See [this other SO question](http://stackoverflow.com/questions/4629800/how-to-use-fiddler-to-monitor-wcf-service) on how to set up WCF to go through your Fiddler proxy so that Fiddler can catch your requests. You'll have to define that proxy in your WCF Test Client, too, in order to give Fiddler a chance to see the requests – marc_s Jul 05 '12 at 05:34
  • it is not working for a setting with WSHttpBinding, with BAsicHttpbinding it is working – user603007 Jul 05 '12 at 06:20

1 Answers1

0

What is address of your service? If you use localhost or 127.0.0.1 these messages won't be captured. Use your machine name or network IP address. You can set it in Project properties or directly on the endpoint.

Milan Matějka
  • 2,654
  • 1
  • 21
  • 23