In order to expose the Server you have to configure WCF. Here is an example of how to do it, but as long as your server implements IBaseServer and you use SharedType communication (NetDataContract) you are free to play with WCF communication.
Edit Step 1: Create the Shared Contract
Since we are using SharedType (NetDataContract), we ignore any Wsdl. Instead we have to store our ServiceContract and our entities in a shared assembly know by client and server.
The fist step is to create this assembly (ClassLibrary) and create the contract:
namespace Bugs.Contract
{
[ServiceContract(SessionMode = SessionMode.Required)]
public interface IServerBugs : IBaseServer, IViewServer
{
}
}
You could implement more interfaces in your custom interface (Constract), or custom method (ServiceOperations) that makes sense in your business logic. Remember to add [OperationContract, NetDataContract] over any new method.
Edit Step 2: Create the Service Application
Create a new WCF Service Application (or a Web Site if you prefer this kind of project).
Rename your service until someone that makes sense. Be careful with the markup:
ServerBugs.svc
<%@ ServiceHost Language="C#" Debug="true" Service="Bugs.Web.ServerBugs" CodeBehind="ServerBugs.svc.cs" %>
In the partial class ServerBugs.svc.cs implement the service as the example in
ServerContracts example.
Edit Step 3: Configure the Service
We usually use a WCF configuration like this to expose the Service Endpoint:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="FriendBinding" maxReceivedMessageSize="10485760" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:20:00" sendTimeout="00:05:00">
<readerQuotas maxArrayLength="2147483647"/>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service name="Bugs.Web.ServerBugs" behaviorConfiguration="Bugs.Web.ServiceBehavior">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="FriendBinding" contract="Bugs.Contract.IServerBugs">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Bugs.Web.ServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
Finally, in order to configure the client side go to:
Setting up client communication