Click here to Skip to main content
15,885,904 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have created wcf rest with SSL self hosted certificate. I have deployed my service in my local system (.i.e Intranet).

I have tested in my fiddler tool. But i want to check wheather my messages going securely or not. So that i have add tracing and logging in my config file as shown in below.

Problem is the requests and responces or anything is not writing into my logs.



C#
<system.web>
    <compilation debug="true" targetFramework="4.0"/>
</system.web>
<system.serviceModel>
    <services>
        <service name="PracticeWcfService1.Service1">

            <endpoint address="RestType" behaviorConfiguration="PracticeWcfService1.Service1ehaviour" binding="webHttpBinding"
                      contract="PracticeWcfService1.IService1" name="RestClient">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>

            <endpoint address="RestTypeWithSecure" behaviorConfiguration="PracticeWcfService1.Service1ehaviour" binding="webHttpBinding"
                      contract="PracticeWcfService1.IService1" name="RestClientWithSecure" bindingConfiguration="PracticeWcfService1.Services.ClientServicesEndpointBinding">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>

            <endpoint address="SoapType" binding="basicHttpBinding" contract="PracticeWcfService1.IService1" name="SoapClient">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>

            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"></endpoint>

            <host>
                <baseAddresses>
                    <add baseAddress="http://localhost:33333/Service1.svc" />
                </baseAddresses>
            </host>

        </service>
    </services>
    <bindings>
        <webHttpBinding>
            <binding name="PracticeWcfService1.Services.ClientServicesEndpointBinding">
                <security mode="Transport">
                </security>
            </binding>
        </webHttpBinding>
    </bindings>
    <behaviors>
        <endpointBehaviors>
            <behavior name="PracticeWcfService1.Service1ehaviour">
                <webHttp/>
            </behavior>
        </endpointBehaviors>
        <serviceBehaviors>
            <behavior>
                <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
                <serviceMetadata httpGetEnabled="true" httpsGetEnabled="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="true" />
                <serviceThrottling maxConcurrentCalls="500" maxConcurrentInstances="250"/>
            </behavior>

        </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    <diagnostics>
        <messageLogging logEntireMessage="true"
                        logMessagesAtServiceLevel="true"
                        logMessagesAtTransportLevel="true"
                        maxMessagesToLog="200000"
                        maxSizeOfMessageToLog="200000"/>
    </diagnostics>
</system.serviceModel>
<system.diagnostics>
    <sources>
        <source name="System.ServiceModel" switchValue="All"
          propagateActivity="true">
            <listeners>
                <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                    <filter type="" />
                </add>
                <add name="ServiceModelTraceListener">
                    <filter type="" />
                </add>
            </listeners>
        </source>
        <source name="System.ServiceModel.MessageLogging" switchValue="All">
            <listeners>
                <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                    <filter type="" />
                </add>
                <add name="ServiceModelMessageLoggingListener">
                    <filter type="" />
                </add>
            </listeners>
        </source>
    </sources>
    <sharedListeners>
        <add initializeData="C:\Users\sdanda\Downloads\PracticeWcfService1\PracticeWcfService1\Messages.svclog"
          type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
          name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
            <filter type="" />
        </add>
        <add initializeData="C:\Users\sdanda\Downloads\PracticeWcfService1\PracticeWcfService1\Tracelog.svclog"
          type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
          name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
            <filter type="" />
        </add>
    </sharedListeners>
    <trace autoflush="true" />
</system.diagnostics>
<system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
    <directoryBrowse enabled="true" />
</system.webServer>


I have tested by changing the mexHttpBinding to mexHttpsBinding and HttpsEnabled=true tags, but no use.
Please help me how can i see the weather my messages going securely or not?? otherwise is there any way to check the messages going with encrypted or not??

Thanks in Advance
Posted
Updated 11-Sep-13 1:29am
v2

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900