none
WCF contract change issue RRS feed

  • Question

  • Dear all,

    I get earlier a WCF service which get different type of contract and all my WCF services are hosted under IIS and accessible locally through TCP chanel.

    All was working fine untile the point I decide to add a property to an existing contract. Then by recompiling it and publish it again under IIS gets trouble to be accessible from client application

    What is happenning is that the client application is refering the contract, the methode name that it calls does not change, only different is that contract type as a new property.

    Then if I try to get back to original state it fails also.

    I have no idea so far if the service at IIS is really hit or if it fails just before.

    I have setup diagnostics and tracing in my web.config of my wcf application as follow :

    <!--SERVICES LOGGING DEFINITION-->
        <diagnostics performanceCounters="All">
          <messageLogging 
            logEntireMessage="true"
    			logMalformedMessages="true"
    			logMessagesAtServiceLevel="true"
    			logMessagesAtTransportLevel="true"
    			maxMessagesToLog="300"
            maxSizeOfMessageToLog="2000" />
        </diagnostics>
      </system.serviceModel>
      <system.diagnostics>
        <sources>
          <source name="System.ServiceModel" switchValue="Verbose" >
            <listeners>
              <add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="d:\logs\ServiceModel.svclog" />
            </listeners>
          </source>
          <source name="System.IO.Log" switchValue="Verbose" >
            <listeners>
              <add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="d:\logs\IO.svclog" />
            </listeners>
          </source>
          <source name="System.Runtime.Serialization" switchValue="Verbose" >
            <listeners>
              <add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="d:\logs\Serialization.svclog" />
            </listeners>
          </source>
        </sources>
      </system.diagnostics>

    With the setting above, I have no log file created. Note that my service are hosted in IIS in my local machine

    Any reason why those log file do not get created ?

    If I need to log potential exception in a file from my service code in iis, what is the simplest way ?

    regards


    Your knowledge is enhanced by that of others.

    Friday, May 29, 2015 6:13 AM

Answers

  • Hi Serge Calderara,

    >>What is happenning is that the client application is refering the contract, the methode name that it calls does not change, only different is that contract type as a new property.

    Since you have republished your WCF Service on the IIS, then have you updated your services reference in your client side? You can use the Visual Studio Intellisense or "Go To Definition" to help you check if the new contract has been reflected in the client side. Besides, what error do you meet in your client side?

    >>Any reason why those log file do not get created ?

    The trace log files will only be created if the directory specified in the configuration previously exists. Besides, we also need to check the permissions and ensure the user IIS runs under has write permissions to the log file path. For more information, please try to check this MSDN article:
    https://msdn.microsoft.com/en-us/library/ms751526(v=vs.110).aspx .
    For how to enable the WCF tracing, please try to check the following article:
    #Simple Steps to Enable Tracing in WCF:
    http://www.codeproject.com/Articles/420538/Simple-Steps-to-Enable-Tracing-in-WCF .

    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.

    Monday, June 1, 2015 2:59 AM
    Moderator