R – Silverlight WCF access returning an IList of LLBLGen entities

silverlight-2.0

I'm having a problem passing an entity collection back from LLBLGen to silverlight. My contract looks like this. I don't even know if this is possible.

My web service code looks like this:

public IEnumerable<WaterWorksCustomersEntity> GetCustomer(long custId, string acctKey)
{
    var toReturn = new WaterWorksCustomersEntity(custId, acctKey);
    using (var adapter = new DataAccessAdapter())
    {
        adapter.ConnectionString = "data source=CWCPROD.cwc.local;user.."; 
        adapter.FetchEntity(toReturn);
    }
    IList<WaterWorksCustomersEntity> customers = new List<WaterWorksCustomersEntity>();
    customers.Add(toReturn);
    return customers; 
}

On the silverlight client I'm doing …

var client = new Service1Client();
client.GetCustomerCompleted += new EventHandler<GetCustomerCompletedEventArgs>(client_GetCustomerCompleted);
client.GetCustomerAsync(2,"110865");

The compilation is failing with this error:

Error 1 The type or namespace name 'ArrayOfXElement' does not exist in the namespace 'AppointmentClientSL.ServiceReference1' (are you missing an assembly reference?) c:\work\Appointment\Appointment\AppointmentClientSL\Service
References\ServiceReference1\Reference.cs 63 54 AppointmentClientSL

It looks like SL is not able to deal with the data the web service is returning.

Can anyone help???

Best Answer

There is an example of calling LLBLGEN over WCF on the LLBLGEN website here: http://www.llblgen.com/pages/secure/ListDownloads.aspx?ProductVersion=6#6

It's doing synchronous calls over netTcp, but there might be some usefull clues...