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=, 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"?>
      <service behaviorConfiguration="$1" name="$namespace$.$class that implement the service$">
        <endpoint address="" binding="wsHttpBinding" contract="$namespace$.$Interface that define the service$">
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <endpoint address="REST" binding="webHttpBinding" contract="$namespace$.$Interface that define the service$" behaviorConfiguration="$2" />
            <add baseAddress="http://$adress of your SharePoint site $/_wcf/" />
        <behavior name="$1">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        <behavior name="$2">
          <webHttp />

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


No comments yet.