How to Enable WCF in SilverLight
Accept the default option "Host the Silverlight application in a new Web site" in the "New Silverlight Application" wizard that pops up. Leave the default "SilverlightApplication1.Web" selected for the "New Web Project" name. Keep the default "ASP.NET Web Application Project" as the New Web project type. Then click "OK."
Right-click the "SilverlightApplication1.Web" and select "Add." Click on "New Item" and wait for the "Add New Item" window to open. Select Silverlight from the corresponding language group in the "Installed Templates" pane on the left.
Select the "Silverlight-enabled WCF Service" template from the central pane. Set the service name to "CustomerService.svc" in the "Name" box near the bottom. Click the "Add" button to the right of the "Name" box.
Implement the "CustomerService" contract by replacing the "DoWork" method in the "CustomerService" class with the operations you want the service to support. Modify the service contracts to match your needs.
Test the service implementation by selecting the "CustomerService.svc" file in Solution Explorer. Right-click the "CustomerService.svc" file and select "View in Browser." Confirm you see a "CustomerService" test page to verify the service is available. Review your code to confirm there are no spelling errors if the test page fails.
0 comments:
Post a Comment
Click to see the code!
To insert emoticon you must added at least one space before the code.