Signum Framework Logo
"Open framework that encourages convention over configuration, using C# code,
not XML files, to model at the right level of abstraction and achieve deadlines.
...but also has a full Linq provider, and syncs the schema for you!"
Login
RSS

Search





Main
Index
Map
Videos
Download
Tutorials
Forum
FAQ



Image



PoweredBy

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 //ILoginServer, IExcelReportServer
    {
      
    }
}

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"/> <!--Not Used!-->
            </service>
        </services>
        <behaviors>
            <serviceBehaviors>
                <behavior name="Bugs.Web.ServiceBehavior">
                    <!-- 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="true"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
    </system.serviceModel> 

Finally, in order to configure the client side go to: Setting up client communication
Creative Commons License Signum Framework Site by Signum Software is licensed under a Creative Commons Attribution 3.0 License.
Powered by ScrewTurn Wiki version 2.0.35.