views:

957

answers:

1

I've got a Silverlight application which uses a built-in .ASMX WebService to access a SQL database and run some queries. Everything runs without any hitches on my Development machine.

I'm trying to deploy the application to IIS 6 and I'm having some issues.

The Silverlight application itself seems to run fine, however the Web Service does not. I get an unhandled exception error that says [Async_ExceptionOcurred] as soon as the page loads (when the page loads I'm making some Async WebService method calls).

I think this is an issue with the Web Service but I don't know what the problem is. I tried setting the WebService namespace to my URL, but that didn't work. I've tried messing with the SQL connection string in my Web Config but that also affects nothing.

One thing to note is that my IIS Virtual Directory only contains my SilverlightApp.Web folder. I know that the other folder that's part of the application contains a .ClientSettings file for the WebService, but I think this is embedded into the .xap.

Can anyone shed any light on this?

+1  A: 

The most likely thing that's happening: Your webservice proxy on the client is using the address of the web service it was built against: ("http://localhost..."). Things to do:

  • Use fiddler to confirm this is the issue. It will show you where the proxy is making the call to.
  • Use the overloaded constructor for the web service and specify a URI. Consider using id/deffing for debug/release. This will overwrite the settings in the client.config.
  • Create another endpoint in the client config for the release build (Shawn's article here) and select one or the other (again using if/defs).

There are other options as well (looking at the URI and building up the service adress)... but that's the general idea.

hth, Erik

Erik Mork
Thanks Erik. Spot on. I used Fiddler and I immediately noticed that my Web Service was trying to access a localhost-based URL. I created a new endpoint and 4 lines of code later everything was up and running. Thanks again.
Overhed