It is too difficult to start a new WCF service

I am starting to get really frustrated.

I have been using the an old CTP of .net 3.0 and been developing fine. It is nice and quick and simple
1. file->new web site
2. choose C# WCF website
3. hit compile. and all the WSDL etc. is auto generated
4. tell my client to add a new service reference


Now that i've installed on the latest September CTP there are a thousand steps
1. file->new web site
2. choose C# WCF website
3. hit compile. and nothing is setup.
4. read a few websites about how to enable WSDL.
5. Realise that you then have to setup some endpoints
6. realise that none of it works
7. post on MSDN

Any help would be great. I was half way through a project but can't continue any further until i can actually create a new service again


Answer this question

It is too difficult to start a new WCF service

  • dct-val

    Hi,

    Take a look to the Service Factory project in GotDotNet (Microsoft Practices & Practices), http://practices.gotdotnet.com/svcfactory

    In a nutshell, this project provides a set of tools and wizard (assets) to build service oriented applications using WCF or WSE.

    Regards,

    Pablo.



  • Umeshgopal

     

    if you just add following line to VS.NET generated configuration,you can browse WSDL

    <serviceMetadata httpGetEnabled="true" />

    By default,we want to secure Metadata endpoint also,so we are not adding above line to VS.NET generated config code,i think you can customize VS.NET templates(Incase if you always want to add above behavior to your project)

    VS.NET GENERATED FOLLOWING CONFIG FILE:

    < xml version="1.0" >

    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

    <system.serviceModel>

    <services>

    <!-- Before deployment, you should remove the returnFaults behavior configuration to avoid disclosing information in exception messages -->

    <service name="MyService" behaviorConfiguration="returnFaults">

    <endpoint contract="IMyService" binding="wsHttpBinding"/>

    </service>

    </services>

    <behaviors>

    <serviceBehaviors>

    <behavior name="returnFaults">

    <serviceDebug includeExceptionDetailInFaults="true" />

    <serviceMetadata httpGetEnabled="true" />

    </behavior>

    </serviceBehaviors>

    </behaviors>

    </system.serviceModel>

    <system.web>

    <compilation debug="true"/>

    </system.web>

    </configuration>

     

    MORE INFO:

    if you browse .SVC without metadata behavior,we are giving very verbose description to enable metadata behavior also

    Example:

    This is a Windowsc Communication Foundation service.

    Metadata publishing for this service is currently disabled.

    If you have access to the service, you can enable metadata publishing by completing the following steps to modify your web or application configuration file:

    1. Create the following service behavior configuration, or add the <serviceMetadata> element to an existing service behavior configuration:

    <behaviors>
      <serviceBehaviors>
        <behavior name="MyServiceTypeBehaviors" >
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    

    2. Add the behavior configuration to the service:

    <service name="MyNamespace.MyServiceType" behaviorConfiguration="MyServiceTypeBehaviors" >
    

    Note: the service name must match the configuration name for the service implementation.

    3. Add the following endpoint to your service configuration:

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

    Note: your service must have an http base address to add this endpoint.

    The following is an example service configuration file with metadata publishing enabled:

    <configuration>
      <system.serviceModel>
     
        <services>
          <!-- Note: the service name must match the configuration name for the service implementation. -->
          <service name="MyNamespace.MyServiceType" behaviorConfiguration="MyServiceTypeBehaviors" >
            <!-- Add the following endpoint.  -->
            <!-- Note: your service must have an http base address to add this endpoint. -->
            <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
          </service>
        </services>
     
        <behaviors>
          <serviceBehaviors>
            <behavior name="MyServiceTypeBehaviors" >
              <!-- Add the following element to your service behavior configuration. -->
              <serviceMetadata httpGetEnabled="true" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
     
      </system.serviceModel>
    </configuration>
    


  • connect2sandeep

    I'd tried to use this before I posted, but the guidance isn't much help as it doesn't give an overview of what the step will do.

    I really hope they bring back how simple it was to create a service in the final release.....

  • Dirk Haest

    Thankyou, that one line is all I was after.

    I tried following the default error message that comes up, but i couldn't get it to work. I kept following what it said and ADDING a whole new <serviceBehavior> node which looks like was the main problem.

  • It is too difficult to start a new WCF service