Giter Club home page Giter Club logo

xpo_how-to-implement-a-distributed-object-layer-service-working-via-wcf-e5072's Introduction

Files to look at:

How to implement a distributed object layer service working via WCF

Scenario

In this example we will implement a distributed object layer service (IObjectLayer/ISerializableObjectLayer) working via WCF. A distributed services layer relies on lower layers, but hides the details of these layers from upper layers that contain the application and business logic layers. This arrangement allows the application developer to work at a higher level of abstraction layers.

Steps to implement:

1. Create a new Class Library project and add a Customer class via the DevExpress v1X.X ORM Persistent Object item template. You can see the source code of this class in the Customer.xx file.

2. Create a new WCF Service Application project and remove files with auto-generated interfaces for the service.

3. Add reference to the newly created class library.

4. Modify the Service class as shown in the Service.xx file to create a data provider and data layer.

5. Modify binding properties as shown in the example's web.config file. At this stage, the service part is ready to work and we need to implement a client to consume data from our data store service (for demonstration purposes, we will create a Console Application).

6. Add a Console Application into solution and add reference to the newly created class library.

7. Modify the Main method in the same manner as the Program.xx file to connect to our service using the web.config configuration.

8. The final step is to add the App.config file to our client application and modify it as shown in the example's App.config file.

If you run the client application, you will see the following output:

Important notes:
Please note that the port number in the connection string may be different. You can check it in the properties of the service project in the Solution Explorer:

 

Troubleshooting
1. If WCF throws the "Entity is too large" error, you can apply a standard solution from StackOverFlow: http://stackoverflow.com/questions/10122957/
2. If WCF throws the "The maximum string content length quota (8192) has been exceeded while reading XML data." error, you can extend bindings in the following manner:

<bindings>
      <basicHttpBinding>
        <binding name="ServicesBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" transferMode="Streamed" >
          <readerQuotas maxDepth="2147483647"
            maxArrayLength="2147483647"
            maxStringContentLength="2147483647"/>
        </binding>
      </basicHttpBinding>
</bindings>

 

 

See The maximum string content length quota (8192) has been exceeded while reading XML data

See also:
Transferring Data via WCF Services
How to use XPO with a Web ServiceHow to connect to a remote data service instead of using a direct database connection


Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

xpo_how-to-implement-a-distributed-object-layer-service-working-via-wcf-e5072's People

Contributors

andreykozhevnikov avatar devexpressexamplebot avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.