Search Wiki:
This sample creates a simple WCF calculator service and builds a Silverlight client for it. The client is then hosted alonside the service in the Azure fabric. Both client and service are hosted over HTTPS and the client calculation is only allowed if the client supplies valid credentials.

Here is a quick walkthrough of the steps taken to build this solution:
  1. Create new Web Cloud Service project called Calculator
  2. Configure a SSL certificate as described in this topic. Also enable a HTTPS service endpoint in the service definition file.
  3. In the Calculator_WebRole website, add a new WCF Service called Service.svc. The service contains two endpoints defined in the Web.config file.
    1. an endpoint using a cusom binary binding over HTTPS with a security binding element specifying authenticationMode="UserNameOverTransport". This secure configuration can be used by both .Net and Silverlight clients
    2. a metadata endpoint that both .Net and Silverlight clients can use to generate references to the service
  4. Add a custom username and password validator and add it to the service configuration.
  5. Create a Silverlight client by adding a new Silverlight Application project called SilverlightCalculator. When adding the project you will be asked where to host the Silverlight control, and you should accept the default value of hosting it inside of the Calculator_WebRole website. We want the Silverlight control to be hosted alongside the WCF service in the Azure cloud fabric, and this is the exact configuration being suggested.
  6. Add a Service Reference to the WCF Service in the SilverlightCalculator project and use it to call operations
  7. Note that you need to enable SSL in Visual Studio in order to try this sample, since it use HTTPS. Follow the steps in this documentation topic for instructions on how to configure SSL in the local fabric and the cloud fabric.

Demo Client | Demo Service

Note that navigating to these URIs will cause the browser to warn you against acepting an invalid certificate. For the purposes of testing this sample you can choose to continue, although in general you should never access a production site with invalid certificates. The correct credentials are username test and password 123.

Here is the final result showing the Silverlight client accessing the service:

Secure Result.png
Last edited Sep 21 2009 at 6:45 AM  by Yavor, version 7
Comments
adityavoleti wrote  Sep 26 2009 at 4:09 PM  
This one was really helpful. http://blogs.msdn.com/jnak/archive/2009/05/12/https-endpoint-on-windows-azure.aspx.

Updating...
Page view tracker