Hi there

I am trying to develop a silverlight game to be deployed on facebook. This game needs to make use of a database to store information about the players stats.

At the moment i am just trying to get the silverlight wcf services working. By making a simple grid which must get information from the database.

I followed a tutorial on web services and I can get it working fine on my local host, while connecting to the database on the server.

My problem comes in when I deploy the website. I get this error message:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; FDM; .NET4.0C; .NET4.0E; Tablet PC 2.0)
Timestamp: Wed, 18 Aug 2010 12:18:25 UTC


Message: Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at Dbconnection.CustomerService.CustomerListCompletedEventArgs.get_Result()
at Dbconnection.MainPage.client_CustomerListCompleted(Object sender, CustomerListCompletedEventArgs e)
at Dbconnection.CustomerService.SampleServiceClient.OnCustomerListCompleted(Object state)
Line: 1
Char: 1
Code: 0
URI: http://www.facebookml.zar.cc/Silverlight.js

Now i also found that you need to tell it where the service resides.
The folder structure of the server is 2 folders and another called wwwroot.
This is where my default page resides as well as the service file (.svc)

<client>
            <endpoint address="http://localhost:58622/SampleService.svc"
                binding="customBinding" bindingConfiguration="CustomBinding_SampleService"
                contract="CustomerService.SampleService" name="CustomBinding_SampleService" />
        </client>

my question is do i change the address to: http://www.facebookml.zar.cc/SampleService.svc
or to: http://www.facebookml.zar.cc/wwwroot/SampleService.svc

I have actually tried both of these and have had no luck. Am i missing something?
Even better, is there a way to do the database transactions without using a wcf service?

An update on this...

When I publish the files to my computer(file system) and try and run the html file, it gives me the same error as I get on my deployment server...

Okay. Turns out that, when you choose to run a silverlight app in .net 3.5 it doesn't make your .web project run in 3.5. So it was running on .net 4.0 which my server did not support. changing this along with "IIS supports specifying multiple IIS bindings per site, which results in multiple base addresses per scheme. A WCF service hosted under a site allows binding to only one baseAddress per scheme." taken from: http://blogs.msdn.com/b/rampo/archive/2008/02/11/how-can-wcf-support-multiple-iis-binding-specified-per-site.aspx
using the solution there resulted in a working service.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.