Implement and extend a service Contract using Microsoft Robotics Studio

Source: Internet
Author: User
Tags extend

This article describes the use of three methods to implement or extend a common service protocol (Generic Service contract), which includes implementing a generic service agreement, extending a service agreement, and a long service (multi-headed services), which The common service agreement used is the Tutorial 8 (C #)-Generic service declaration. Created.

This instance is implemented by C # and can be found in the following directory:

Samples "Servicetutorials" TUTORIAL9 "CSharp

First step: Create a project

Since the project needs to extend a generic service agreement (Generic Service contract), you will need to refer to the DLL file generated by the service Tutorial 8 project in the project, and in the service Tutorial 9 project you'll see that it implements three services, To implement multiple services in a project, make sure that the namespaces for these services are different.

Step two: Implement a common service agreement

The first service instance is genericserviceimplementation, and the file that implements this service is GenericServiceImplementation.cs and GenericServiceImplementationTypes.cs, this service simply implements a generic service agreement.

Service type declaration (services type Declarations):

Because the Generic service protocol is used in this service, it does not require us to define his state and operations, which are already defined in the Generic service agreement and see ServiceTutorial8, but it still requires a protocol identifier (Contract identifier), Because this identity is needed to locate the service, the service identity is defined as follows:

1///<summary>

2///Generic Service implementation Contract Identifier

3///</summary>

4 Pub     LIC sealed class Contract

5 

6 {

7///the Unique Contract Identifier for this service

8 

9 [DataMember ()]

Ten Public const String Identifier = "http://schemas.tempuri.org/2007/08/servicetutorial9/genericservice/ Implementation.html ";

One}

12

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.