none
Need a help on Debuging WCF Service RRS feed

  • Question

  • Team ,

    When I try to run a WCF service which has following configuration details I'm getting following error.

    Appriciate if you can help me to slove this.

    <?xml version="1.0"?>
    <configuration>
    
      <configSections>
        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
          <section name="SfdcIntegration.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
        </sectionGroup>
      </configSections>
    
      <connectionStrings>
        <add name="SFDC_DATA_CRP3ConnectionString" connectionString="Data Source=xxxxxxxx;Initial Catalog=xxxxxxxx;Persist Security Info=True;User ID= ;Password= " providerName="System.Data.SqlClient" />
        <add name="SFDC_WEBConnectionString" connectionString="Data Source=xxxxxxxx;Initial Catalog=xxxxxxxx;Persist Security Info=True;User ID= ;Password= " providerName="System.Data.SqlClient" />
      </connectionStrings>
    
      <location path="xxx.com">
        <system.webServer>
          <security>
            <authentication>
              <anonymousAuthentication enabled="false" />
              <basicAuthentication enabled="true" defaultLogonDomain="xxx.com" />
              <windowsAuthentication enabled="true" />
            </authentication>
          </security>
        </system.webServer>
      </location>
    
      <system.web>
        <compilation debug="true" targetFramework="4.0" />
      </system.web>
    
      <system.serviceModel>
    
        <client>
          <endpoint address="http://xxxxx.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IRFSWcfService"
            contract="ServiceRef.IRFSWcfService" name="BasicHttpBinding_IRFSWcfService" />
        </client>
    
        <bindings>
          <basicHttpBinding>
            <binding>
              <security mode="TransportCredentialOnly">
                <transport clientCredentialType="Windows" />
              </security>
            </binding>
            <binding name="BasicHttpBinding_IRFSWcfService" closeTimeout="23:01:00"
              openTimeout="23:01:00" receiveTimeout="23:10:00" sendTimeout="23:01:00"
              allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
              maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
              messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
              useDefaultWebProxy="true">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              <security mode="TransportCredentialOnly">
                <transport clientCredentialType="Windows" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
            </binding>
          </basicHttpBinding>
        </bindings>
    
        <behaviors>
          <serviceBehaviors>
            <behavior>
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="true"/>
              <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
    
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
    
      </system.serviceModel>
    
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
      </system.webServer>
    
      <system.web>
        <webServices>
          <protocols>
            <add name="HttpGet"/>
            <add name="HttpPost"/>
          </protocols>
        </webServices>
      </system.web>
    
      <appSettings>
    
        <add key="username" value="xxxxxxx"/>
        <add key="password" value="xxxxxxxx"/>
        <add key="token" value="xxxxxx"/>
    
        <add key="isOracleSync" value="true"/>
        <add key="isRfsServiceActive" value="false"/>
        <add key="isManualSyncEnabled" value="true"/>
        <add key="syncTableArray" value="Account,Opportunity,User,PracticeSplit__c,RevenueSplit__c"/>
    
        <add key="isFeedSync" value="false"/>
        <add key="feedTables" value="AccountFeed,UserFeed,OpportunityFeed"/>
    
        <add key="IsFieldSkipped" value="false"/>
        <add key="OpportunitySkipFields" value="none"/>
        <add key="AccountSkipFields" value="none"/>
        <add key="UserSkipFields" value="none"/>
    
        <add key="BulkDataTable" value="Opportunity"/>
        <add key="isEnableRfsServiceLogs" value="true"/>
    
        <add key="ChorousAccountView" value="xxxxx"/>  <!--production value = xxerp.xxvirtu_accounts_v-->
        <add key="ChorousEmployeeView" value="xxxxx"/>
        <add key="SFDCProjectStagingTable" value="xxxxx"/>
        <add key="SFDCAccountStagingTable" value="xxxxxx"/>
    
    
        <!--Sql Connection Strings-->
        <add key="WebDBConnection" value="Data Source=xxxxxxxx;Initial Catalog=xxxxxxxx;Persist Security Info=True;User ID=xx;Password=xxxxx" />
        <add key="CommonDBConnection" value="Data Source=xxxxxxxx;Initial Catalog=SFDC_RFSSANDBOX_QA;Persist Security Info=True;User ID=xx;Password=xxxxx" />
        <add key="BulkDBConnection" value="Data Source=xxxxxxxx;Initial Catalog=xxxxxxxx;Persist Security Info=True;User ID=xx;Password=xxxxx" />
        <add key="RfsDBConnection" value="Data Source=xxxxxxxx;Initial Catalog=RFS_QA_1940;Persist Security Info=True;User ID=xx;Password=xxxxx" />
    
        <!--Oracle Connection Strings-->
        <add key="OracleDBConnection" value="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xxxxxxxxxxxxx)(PORT=1537)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=L2CSUP)));User Id=xxxx;Password=xxx;" />
        <add key="OracleDBConnection_External" value="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xxxxxxxxxxxxx)(PORT=1537)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=L2CSUP)));User Id=xxxx;Password=xxxx;" />
    
    
        <!--Notification Manager Configurations-->
        <add key="Integration.NotificationManager.emailResourceFolder" value="C:\xxxxx\SFDCxxxxANDBOX_19.0_1070\" />
        <add key="Integration.NotificationManager.emailHostName" value="mtmisteam.xxxxx.com"/>
        <add key="Integration.NotificationManager.emailPortNumber" value="25"/>
        <add key="Integration.NotificationManager.senderEmail" value="xxxxx@xxxx.com" />
        <add key="Integration.NotificationManager.subjectLabel" value="(xxxxxx)"/>
        <add key="Integration.NotificationManager.exceptionReciverEmails" value="xxxxx;xxxx;"/>
        <add key="Integration.NotificationManager.notificationReciverEmails" value="xxxxx;xxxxxx;"/>
        <add key="Integration.NotificationManager.enableExceptionStackTrace" value="true"/>
        <add key="EnableNotification" value="true"/>
      </appSettings>
    
      <applicationSettings>
        <SfdcIntegration.Properties.Settings>
          <setting name="SfdcIntegration_sforce_SforceService" serializeAs="String">
            <value>xxxxxxxxx</value>
          </setting>
        </SfdcIntegration.Properties.Settings>
      </applicationSettings>
    </configuration>

    Error

    Error: Cannot obtain Metadata from http://localhost:17989/SFDCExternalServices.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.  For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error    URI: http://localhost:17989/SFDCExternalServices.svc    Metadata contains a reference that cannot be resolved: 'http://localhost:17989/SFDCExternalServices.svc'.    The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.HTTP GET Error    URI: http://localhost:17989/SFDCExternalServices.svc    There was an error downloading 'http://localhost:17989/SFDCExternalServices.svc'.    The request failed with the error message:--<html>    <head>        <title>Security settings for this service require Windows Authentication but it is not enabled for the IIS application that hosts this service

    Monday, April 8, 2013 6:10 AM

Answers

  • Hi,

    From the config you posted above, I noticed that you set the endpoints at <client> tag for your web.config(or app.config) of the service, the endpoints should be located at <service> tag. E.g

    <system.serviceModel>
    <services>
    <service name="testservice">
          <endpoint address="http://xxxxx.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IRFSWcfService"
            contract="ServiceRef.IRFSWcfService" name="BasicHttpBinding_IRFSWcfService" />
    </service>
        </services>
    ...
    </system.serviceModel>

    You can refer some documents.

    #How to: Host a WCF Service in IIS

    http://msdn.microsoft.com/en-us/library/ms733766.aspx

    #How to: Publish Metadata for a Service Using a Configuration File

    http://msdn.microsoft.com/en-us/library/ms734765.aspx

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 9, 2013 6:59 AM
    Moderator
  • Hi,

    From the config you posted above, I noticed that you set the endpoints at <client> tag for your web.config(or app.config) of the service, the endpoints should be located at <service> tag. E.g

    <system.serviceModel>
    <services>
    <service name="testservice">
          <endpoint address="http://xxxxx.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IRFSWcfService"
            contract="ServiceRef.IRFSWcfService" name="BasicHttpBinding_IRFSWcfService" />
    </service>
        </services>
    ...
    </system.serviceModel>

    You can refer some documents.

    #How to: Host a WCF Service in IIS

    http://msdn.microsoft.com/en-us/library/ms733766.aspx

    #How to: Publish Metadata for a Service Using a Configuration File

    http://msdn.microsoft.com/en-us/library/ms734765.aspx

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

      True.

    And other issue was that I have already defined the endpoints of the client.

    What I was done is I commented the client specific endpoints and ran the client.

    Another approch would be adding the WCF client end point details to Config.

    • Marked as answer by viduz Tuesday, May 28, 2013 3:00 PM
    Tuesday, May 28, 2013 3:00 PM

All replies

  • you need meta-data exchange end point as well on the server side.

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


    ViBi

    Monday, April 8, 2013 8:28 AM
  • which location do I need to add that code ?
    Monday, April 8, 2013 5:31 PM
  • When you expose a WCF service, you expose endpoints which are basically combination of address, binding and contract. I think you are using a basichttpbinding, along with that endpoint add this mex endpoint as well


    ViBi

    Tuesday, April 9, 2013 5:19 AM
  • Hi,

    From the config you posted above, I noticed that you set the endpoints at <client> tag for your web.config(or app.config) of the service, the endpoints should be located at <service> tag. E.g

    <system.serviceModel>
    <services>
    <service name="testservice">
          <endpoint address="http://xxxxx.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IRFSWcfService"
            contract="ServiceRef.IRFSWcfService" name="BasicHttpBinding_IRFSWcfService" />
    </service>
        </services>
    ...
    </system.serviceModel>

    You can refer some documents.

    #How to: Host a WCF Service in IIS

    http://msdn.microsoft.com/en-us/library/ms733766.aspx

    #How to: Publish Metadata for a Service Using a Configuration File

    http://msdn.microsoft.com/en-us/library/ms734765.aspx

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 9, 2013 6:59 AM
    Moderator
  • Hi,

    From the config you posted above, I noticed that you set the endpoints at <client> tag for your web.config(or app.config) of the service, the endpoints should be located at <service> tag. E.g

    <system.serviceModel>
    <services>
    <service name="testservice">
          <endpoint address="http://xxxxx.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IRFSWcfService"
            contract="ServiceRef.IRFSWcfService" name="BasicHttpBinding_IRFSWcfService" />
    </service>
        </services>
    ...
    </system.serviceModel>

    You can refer some documents.

    #How to: Host a WCF Service in IIS

    http://msdn.microsoft.com/en-us/library/ms733766.aspx

    #How to: Publish Metadata for a Service Using a Configuration File

    http://msdn.microsoft.com/en-us/library/ms734765.aspx

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

      True.

    And other issue was that I have already defined the endpoints of the client.

    What I was done is I commented the client specific endpoints and ran the client.

    Another approch would be adding the WCF client end point details to Config.

    • Marked as answer by viduz Tuesday, May 28, 2013 3:00 PM
    Tuesday, May 28, 2013 3:00 PM