1
votes

It's a silverlight application connects to a wcf service which in turn connects to another wcf service.

This entire application is on a windows 2003 server, both wcf services and the silverlight application. It's silverlight, so it works on a browser. We can access/run it from 2 of our many development machines. It works fine from those 2 machines but not from any other machines or from within the same server.

It throws the following error:

[Async_ExceptionOccurred] Arguments: Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=4.0.60310.0&File=System.dll&Key=Async_ExceptionOccurred

at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary() at SilverlightClient.TestWCFReference.sendRequestCompletedEventArgs.get_Result() at SilverlightClient.Views.TestFormControl.sendRequestCompleted(Object sender, sendRequestCompletedEventArgs e) at SilverlightClient.TestWCFReference.Service1Client.OnsendRequestCompleted(Object state)

1
This looks like the exception at the client, which doesn't really indicate what happened. You should check the server for errors, assuming it writes to a log or something. - CodingWithSpike
the reason it works on those 2 dev machines are the same wcf services are already installed on those machines. It was picking up the local wcf instead of the one on the server - GaneshT
so, basically, the silverlight application can't access the wcf services at all. Tried fiddler with no avail. - GaneshT

1 Answers

1
votes

I found the issue, the silverlight client was using the clientconfig file from .xap, not the external one. I had to remove the clientconfig from the project.

And for the EndPoint setting, I manually added the settings in the silverlight web project's web.config, pass it to the .js file and read it from App.config. It works.

web.config

  <appSettings>
    <add key="serviceurl" value="http://localhost/Service/Service.svc"/>
  </appSettings>

default.aspx.cs

protected void Page_Load(object sender, EventArgs e)
{
    InitialParams = "serviceurl=" + System.Configuration.ConfigurationManager.AppSettings["ServiceURL"];
}

default.aspx

<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<!--other params go here-->
              <param name="initParams" value="<%= InitialParams%>" />
</object>

App.xaml.cs

//field
public static string ServiceURL = "";

private void Application_Startup(object sender, StartupEventArgs e)
{
    ServiceURL = e.InitParams["serviceurl"];
        this.RootVisual = new MainPage();
}

MainPage.Xaml.cs

string url = App.ServiceURL;