At
work, i'm involved in a silverlight application, and i've got my first challange.
It's not that easy to use an WCF service which is not hosted in an IIS environment right from an Silverlight application.
With the help of the official
Silverlight forum, i figured it out.
You may download an test this sample visual studio solution. Of course you have to set up the proper environment for developing Silverlight application first.
The solution contains the following project:
- SilverLightTestAppWeb (Startup website for the silverlight application)
- SilverLightTestApp.csproj (Silverlight application)
- WCF.csproj (WCF service for providing data)
- WCFServer.csproj (Console application for hosting WCFServer.csproj)
- WCFPolicy.csproj (WCF/REST service for providing clientaccesspolicy.xml)
- WCFPolicyServer.csproj (Console application for hosting WCFPolicy.csproj)
- WCFTestApp.csproj (Test application for WCFServer.csproj)
To test it, the following projects must be started: WCFServer, WCFPolicyServer, SilverLightTestAppWeb.
With this you are ready to go. If you then see the silverlight application, and press the button, it will first call the WCFServer, and then request the WCFPolicyServer for receive the clientaccesspolicy.xml. The policy is only checked once at the first webservice call.
For testing it, you may download it from here
WCF.rar.
Just make sure to set the proper startup projects:
cheers
manuel
im trying since days to consume a WCF-Service which is hosted in a Console-Application in my Silverlight2 beta2-Applicaiton...
I have read that you created a demo app...
Can you send this to my e-mail address?
Cheers,
Stefan
It should be possible to download it via http://www.suntsu.ch/serendipity/uploads/WCF.rar
cheers