Technology related to WCF Ria Service

Source: Internet
Author: User
Tags silverlight visual studio 2010

Copy the object property of the WCF Ria Service

private void DoSubmit() {    ((IEditableObject)this.RepairContract).EndEdit();    var domainContext = new DmsDomainContext();    var newRepairContract = new RepairContract();    domainContext.RepairContracts.Add(newRepairContract);    newRepairContract.ApplyState(null, this.RepairContract.ExtractState(ExtractType.ModifiedState));    foreach(var repairContractItem in this.RepairContract.RepairContractItems) {        var newRepairContractItem = new RepairContractItem();        newRepairContract.RepairContractItems.Add(newRepairContractItem);        newRepairContractItem.ApplyState(null, repairContractItem.ExtractState(ExtractType.ModifiedState));        foreach(var repairContractMaterial in repairContractItem.RepairContractMaterials) {            var newRepairContractMaterial = new RepairContractMaterial();            newRepairContractItem.RepairContractMaterials.Add(newRepairContractMaterial);            newRepairContractMaterial.ApplyState(null, repairContractMaterial.ExtractState(ExtractType.ModifiedState));            foreach(var oldSparePart in repairContractMaterial.OldSpareParts) {                var newOldSparePart = new OldSparePart();                newRepairContractMaterial.OldSpareParts.Add(newOldSparePart);                newOldSparePart.ApplyState(null, oldSparePart.ExtractState(ExtractType.ModifiedState));        }    }}

2. How to configure the WCF Ria Service

When aspnetcompatibilityenabled = "true", SL cannot reference the WCF Service. When the file of the WCF Servics. SVC is browsed, an error is prompted, as shown below:

The service cannot be activated because it does not support ASP.NET compatibility. ASP.NET compatibility 
is enabled for this application. Turn off ASP.NET compatibility mode in the web.config or add the 
AspNetCompatibilityRequirements attribute to the service type with RequirementsMode setting as ‘Allowed‘ or ‘Required‘.

When aspnetcompatibilityenabled = "false", an error occurs during the test run:

An unhandled exception ('unhandled error in Silverlight Application

Code: 4004

Category: managedruntimeerror

Message:

System. servicemodel. domainservices. Client. domainoperationexception:

This project includes the WCF Service and RIA service. What should I do?

Solution:

First, set aspnetcompatibilityenabled = "true" in Web. config"

Next, mark the following attribute on the WCF Service Class

Using system. servicemodel. activation;

[Aspnetcompatibilityrequirements (
Requirementsmode = aspnetcompatibilityrequirementsmode. Allowed)]
Public class service2: classlibrary1.iservice2

Conclusion: The same error will not be reported during re-running.

3. An error occurred while installing WCF Ria services on the server.
? When you create an application pool in Internet Information Service (IIS) manager, the. NET Framework Version drop-down option does not contain. NET Framework 4.0.30319.
? When you access the business system homepage in a browser, the Silverlight download progress stays at 100%, and the logon interface is not displayed correctly.
? When you access a business node in the Business System in a browser, the system fails to load the content in the drop-down box of the query Panel correctly.
? Dynamic/static content compression is enabled in the Internet Information Service (IIS) manager, but the server response is still uncompressed.
An error occurred while installing WCF Ria services on the server.
An error occurred while installing WCF Ria services. The message "prerequisites check" is displayed.
The following required components are missing:
Microsoft Visual Studio 2010 or visual web developer 2010 Express
Microsoft Silverlight 4 developer Runtime
Microsoft Silverlight 4 SDK"
Use the following command to install riaservices on the Application Server:
Msiexec/I riaservices. MSI Server = true
When you create an application pool in Internet Information Service (IIS) manager, the. NET Framework Version drop-down option does not contain. NET Framework 4.0.30319.
Make sure that. NET Framework 4.0 is installed on the server.
On this premise, you can run this command to re-register. NET Framework 4.0 to IIS: % WINDIR %/Microsoft. NET/framework/v4.0.30319/aspnet_regiis.exe-I
When you access the business system homepage in a browser, the Silverlight download progress stays at 100%, and the logon interface is not displayed correctly.
You can use fiddler for tracking. If the HTTP code returned by the client when accessing the server path \ LicenseService. SVC is 500, the activation mechanism is incorrectly loaded by the business system.
On the Advanced Settings page of the application pool used by the website, set the 32-bit application attribute to true.
When you access a business node in the Business System in a browser, the system fails to load the content in the drop-down box of the query Panel correctly.
You can use fiddler tracking. If the HTTP code returned when the client accesses the server path/clientbin/Sunlight-Silverlight-Dms-Web-DmsDomainService.svc/is 400, the file in the bin directory of the server should be incomplete.
Because the telerik reporting component is required for business system printing, make sure that the bin directory of the server contains the two DLL files telerik. Reporting. dll and telerik. Reporting. Service. dll.
Dynamic/static content compression is enabled in the Internet Information Service (IIS) manager, but the server response is still uncompressed.
You can use the failure request tracking function of IIS to search for the keyword "_ compression" in the log. If the reason for compression failure is "no_accept_encoding ", the firewall between the client and the server filters the accept-encoding attribute of the request.
You can adjust the firewall settings. Take ISA Server as an example to disable compression filter and caching compressed content filter.

Technology related to WCF Ria Service

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.