WCF template issues using Silverlight

Source: Internet
Author: User

Environment configuration: Silverlight 2 Tools for Visual Studio 2008 SP1

VSTS2008 +SP1

MSSQLSERVER2005

Silverlight-enabled WCF templates

Can you pass in Visual Studio? Innovation builds a WCF project to build WCF services that can communicate with Silverlight applications.

As an alternative to creating WCF services, you can select a file project template in Visual Studio to create the Silverlight-enabled WCF service. The new project template in Visual Studio is displayed. It is said that this template automatically sets the bindings to BasicHttpBinding and adds some properties to make the service compatible with ASP.net. Although this method can set the correct binding configuration for you, do not forget that you can still use existing WCF services, provided that these bindings are set for BasicHttpBinding.

As long as the Silverlight application has a basichttpbinding type of binding, it can invoke the standard WCF service. You must make sure that you can change the default binding of the WCF service from custombinding to BasicHttpBinding, or you must create a new binding for the BasicHttpBinding type. The Web.config file for the WCF service host application contains the following XML used to define the service configuration.

In my VS2008 English version, web.config for WCF more than the following information configuration;

<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name= "WCF. Wcfbehavior ">
<servicemetadata httpgetenabled= "true"/>
<servicedebug includeexceptiondetailinfaults= "false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name= "CUSTOMBINDING0" >

</binding>
</customBinding>
</bindings>
<servicehostingenvironment aspnetcompatibilityenabled= "true"/>
<services>
<service behaviorconfiguration= "WCF. Wcfbehavior "Name=" WCF. WCF ">
<endpoint address= "" binding= "CustomBinding" bindingconfiguration= "CUSTOMBINDING0"
Contract= "WCF. WCF "/>
<endpoint address= "Mex" binding= "mexHttpBinding" contract= "IMetadataExchange"/>
</service>
</services>
</system.serviceModel>

Do not know is not English version of the reason,<custombinding> should default is <basichttpbinding> In some foreign forums found the same problem,

Moreover, the key issue is in the client's Servicereferences.clientconfig file, only </configuration> This can easily occur "The keyword is not in the data dictionary problem", the problem is obvious

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.