GETTING STARTED: Download the latest Silverlight 4.0 Tooolkit By the time of this port I used the February 2011. You can get the latest toolkit from codeplex following this link: silverlight.codeplex.com/releases
ADD REFERENCE TO SILVERLIGHT PROJECT: Microsoft.ServiceModel.DomainServices.Hosting.dll C:\Program Files (x86)\Microsoft SDKs\RIA Services\v1.0\Toolkit\Libraries\Server\Microsoft.ServiceModel.DomainServices.Hosting.dll
MODIFY WEB.CONFIG
Windows Phone 7 supports a specialized version of Silvelright 3, therefore it does not support all version of WCF endpoints/bindings but it does support WS-HTTP. For this reason, for WP7 to access a WCF RIA Service the only endpoint required is the SAOP endpoint. You can copy and paste in your the following into your web.config:
ADD A SERVICE REFERENCE TO YOUR WP7 PROJECT
If I have added the my service into a directory named Services of my Silverlight application and the namespave looks like this:
namespace PatrolCenter.Web.Services
{
// using
[EnableClientAccess()]
public class RidePlanService : LinqToEntitiesDomainService
{
...
Then the URI would be like this:
< namespace_of_ria_service >-< classname_of_your_ria_service >.svc where “.” are replaced with “-“.
Save and build. In the case that you get errors, try closing Visual Studio and starting it again. If everything goes "OK" then click the "All Files" button in solution explorer and expand the newly added WCF RIA Service. It should look similar to this image:
In the case that the "Reference.svcmap" is empy then this is an indication that errors need to be corrected. This is probably the most frustrating part because no obvious errors are issued.


No comments:
Post a Comment