Welcome to MSDN Blogs Sign in | Join | Help

XAML, WPF, Silverlight, .NET, Office 2007, Windows

XAML, WPF, Silverlight, .NET, Office 2007, Windows code samples and other interesting things
Configuring IIS 7 to work with WCF Web Services for Silverlight 2

I've tried these, and there are some interesting parts that can take some time figuring out by digging in docs.

This post will probably solve the 404.3 error (svc not registered as MIME type)

So here's the whole solution for getting a WCF service started up and using it from Silverlight 2 Beta 1:

1. To build the service: How to: Build a Service for Silverlight Clients
2. To enable cross-domain for the service, if needed: How to: Make a Service Available Across Domain Boundaries

3. To add the service to IIS 7:

  • Create new IIS 7 application - Right-click on Default Web Site in the IIS Manager console, Add application, setup the folder (e.g. D:\test\SampleAppFolder) and name. Click OK
  • Deploy your service to http://localhost/SampleApp (or your app virtual name)
  • Important This step took me a while to figure out: install WCF: open admin cmd prompt, and execute ServiceModelreg -i in c:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation folder.

c:\>cd c:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation

c:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation>

c:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation>ServiceModelreg -i
Microsoft(R) Windows Communication Foundation Installation Utility
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.648]
Copyright (c) Microsoft Corporation.  All rights reserved.


Installing: Machine.config Section Groups and Handlers

Installing: System.Web Build Provider

Installing: System.Web Compilation Assemblies

Installing: HTTP Handlers

Installing: HTTP Modules

Installing: ListenerAdapter node for protocol net.tcp

Installing: Protocol node for protocol net.tcp

Installing: TransportConfiguration node for protocol net.tcp

Installing: ListenerAdapter node for protocol net.pipe

Installing: Protocol node for protocol net.pipe

Installing: TransportConfiguration node for protocol net.pipe

Installing: ListenerAdapter node for protocol net.msmq

Installing: Protocol node for protocol net.msmq

Installing: TransportConfiguration node for protocol net.msmq

Installing: ListenerAdapter node for protocol msmq.formatname

Installing: Protocol node for protocol msmq.formatname

Installing: TransportConfiguration node for protocol msmq.formatname

Installing: HTTP Modules (WAS)

Installing: HTTP Handlers (WAS)

c:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation>

Hope this helps. If you have any other suggestions or things you stumbled upon please let me know. I appreciate your feedback!

Published Thursday, March 06, 2008 1:18 PM by nikola

Filed under: , , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Configuring IIS 7 to work with WCF Web Services for Silverlight 2 Beta 1 @ Monday, March 17, 2008 5:15 AM

Hi,

Have you ever come across an exception of "Async_ExceptionOccurred"? I have followed your steps above to get WCF working on IIS 7.  I can now access the WCF Test page without error, and my unit tests can consume the service and return desired results.  However, from silverligth 2 I recieve the above exceptions.

Thanks

Kev Moore

Kev Moore

# re: Configuring IIS 7 to work with WCF Web Services for Silverlight 2 Beta 1 @ Wednesday, March 19, 2008 11:25 PM

I haven't received this exception before, some things to try:

1. check the binding: should be basicHttpBinding not wsHttpBinding (in web.config)

2. Try enabling cross-domain access

3. Download the sample attached to this blog: http://blogs.msdn.com/nikola/archive/2008/03/12/visual-studio-2008-walkthrough-creating-hosting-and-using-wcf-services-with-silverlight-2-beta-1.aspx and see if it works on your box.

Hope this helps - please let me know if it worked or not.

nikola

Leave a Comment

(required) 
required 
(required) 
Page view tracker