Link to home
Create AccountLog in
Avatar of solution1368
solution1368

asked on

wcf issue

I have very simple wcf services with the following app.config built in vs 2008
View the attached error message.

When I built the .cs project, no error alerts. when I F5 /debug, I see the attached error message.

Need some experts to help me resolve this... Thanks

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.web>
    <compilation debug="true" />
    <customErrors mode="Off"></customErrors>

  </system.web>
  <!-- When deploying the service library project, the content of the config file must be added to the host's
  app.config file. System.Configuration does not support config files for libraries. -->
  <system.serviceModel>

    <bindings>
      <wsHttpBinding>
        <binding name="TheBindingConfig">
          <security mode="None">
            <message clientCredentialType="None"/>
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>


    <serviceHostingEnvironment      >
      <baseAddressPrefixFilters>
        <add prefix="http://www.domain.com/HostedInsuranceServices/InsuranceServiceLibrary.Service.svc"/>
      </baseAddressPrefixFilters>

    </serviceHostingEnvironment>
    <services>
      <service
        name="InsuranceServiceLibrary.Service"
          >
        <endpoint address="http://www.domain.com/HostedInsuranceServices/InsuranceServiceLibrary.Service.svc" binding="wsHttpBinding" contract="InsuranceServiceLibrary.IService"
                  bindingConfiguration="TheBindingConfig"
                  >
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint   address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://www.domain.com/HostedInsuranceServices/InsuranceServiceLibrary/Service/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <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>


  </system.serviceModel>

</configuration>
wcfIssue.png
Avatar of Mihai Stancescu
Mihai Stancescu
Flag of Romania image

Hi,

You must add a metadata behavior for the service, do the modifications below:


<service
        name="InsuranceServiceLibrary.Service" behaviorConfiguration="DefaultBehavior"
          >
        {...}
      </service>

       <behavior name="DefaultBehavior">
        {...}
        </behavior>



Regards,
Mishu
Avatar of solution1368
solution1368

ASKER

no error in visual studio express 2008 after adding the items you mentioned.
but it does not generate any svc file
ASKER CERTIFIED SOLUTION
Avatar of Mihai Stancescu
Mihai Stancescu
Flag of Romania image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer