This project is read-only.

Create the svc file

  • In the directory that hosts the WCF service (in the example " C: \inetpub\ wwroot\wss\VirtualDirectories\80\_wcf ")
create a file with the (. svc) extension and another Web.config file.
  • Edit the file as following (replace words between two $ by appropriate values):

<%@ Assembly Name="$Name of your assembly$, Version=1.0.0.0, Culture=neutral, PublicKeyToken=$PKT de votre assembly$"%> 
<% @ServiceHost Service="$namespace$.$class that implement the service$" %>
  • Edit the web.config file as well (replace words between two $ by appropriate values, the parameters $ 1, $ 2, $ 3, $ 4 ... are free but must match):

<?xml version="1.0" encoding="utf-8"?>
<configuration>
 
  <system.serviceModel>
    <services>
      <service behaviorConfiguration="$1" name="$namespace$.$class that implement the service$">
        <endpoint address="" binding="wsHttpBinding" contract="$namespace$.$Interface that define the service$">
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <endpoint address="REST" binding="webHttpBinding" contract="$namespace$.$Interface that define the service$" behaviorConfiguration="$2" />
        <host>
          <baseAddresses>
            <add baseAddress="http://$adress of your SharePoint site $/_wcf/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="$1">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="$2">
          <webHttp />
        </behavior>
      </endpointBehaviors>
    </behaviors>
</configuration>

Last edited Apr 1, 2010 at 3:15 PM by IPTechLabs, version 3

Comments

No comments yet.