Basics of WCF Ria services

Source: Internet
Author: User

Http://www.cnblogs.com/2018/category/262512.html

Previous articlesArticleThe usage of the WCF data service is analyzed. In the development of the RIA system, similar to the WCF data service, the WCF Ria Service provides more convenient functions.

Currently, WCF Ria services is mainly used in silverligh scenarios.

Development Environment:

Vs2010

Siliverlight 4 tools for vs2010(silverligh4_tools.exe): sl4 SDK, Ria service, etc.

Silverlight 4 Toolkit

Riaservicestoolkit

Project template business application

This template contains the basic application framework of membership.

Template project directory structure

Server:

Models:

Dto: objects used for transmission on the server and client

Shared: used for sharing between the server and the client.Code

Resources:

Contains localized resource files [shared by connecting to the client and server]

Services

Domain service class: a service generated based on the WCF Ria services framework

Client:

The name is clear

If the hidden project file is displayed, you can see the generated_code directory. This IDE is based on the object automatically generated by WCF Ria services, so that the client does not manually generate a Project LINK through proxy ].

Add a new domain service

1. Add ado.net entity (edmx) and build the project

2. Add domain service class,

Build Project

3. You can access it in the browser, as shown in figure

[The service is automatically generated by a framework. The corresponding rules are as follows:

 
If the service class is: Ria. Web. Services. northwindservice

Then the SVC service address is the RIA-Web-Services-NorthWindService.svc

]

Odata format

Http: // localhost: 52878/RIA-Web-Services-NorthWindService.svc/odata/

Http: // localhost: 52878/RIA-Web-Services-NorthWindService.svc/odata/$ metadata

The Architecture Information is returned.

Http: // localhost: 52878/RIA-Web-Services-NorthWindService.svc/odata/customerset

The returned data content

Publish a service in JSON format

1. Add a service bearer component

C: \ Program Files \ microsoft sdks \ Ria Services \ V1.0 \ toolkit \ libraries \ Server \ Microsoft. servicemodel. domainservices. Hosting. dll

This is a set of implemented functions in the RIA toolkit.

2. Configure Components

Web. config

 
<Domainservices>

<Endpoints>
<Add name = "JSON" type ="

Microsoft. servicemodel. domainservices. Hosting. jsonendpointfactory, Microsoft. servicemodel. domainservices. Hosting,

Version = 4.0.0.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "/>

3. Use Services

Http: // localhost: 52878/RIA-Web-Services-NorthWindService.svc/JSON/getcustomers

Example reference: http://dskit.codeplex.com

Related Article

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.