Silverlight WCF 访问返回 LLBLGen 实体的 IList?
我在将实体集合从 LLBLGen 传递回 silverlight 时遇到问题。 我的合同是这样的。 我什至不知道这是否可能。
我的 Web 服务代码如下所示:
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;
}
在 silverlight 客户端上,我正在执行...
var client = new Service1Client();
client.GetCustomerCompleted += new EventHandler<GetCustomerCompletedEventArgs>(client_GetCustomerCompleted);
client.GetCustomerAsync(2,"110865");
编译失败并出现以下错误:
错误 1 命名空间“AppointmentClientSL.ServiceReference1”中不存在类型或命名空间名称“ArrayOfXElement”(是否缺少程序集引用?)c:\work\Appointment\Appointment\AppointmentClientSL\Service 参考文献\ServiceReference1\Reference.cs 63 54 AppointmentClientSL
看起来 SL 无法处理 Web 服务返回的数据。
有人可以帮忙吗???
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???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
LLBLGEN 网站上有一个通过 WCF 调用 LLBLGEN 的示例: http://www.llblgen.com/pages/secure/ListDownloads.aspx?ProductVersion=6#6
它正在通过 netTcp 进行同步调用,但可能有一些有用的线索...
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...
Silverlight 构建在不同的 .NET 框架上,因此我们的实体类型不能在该平台上使用。 如果您想将我们的实体类发送到 silverlight,请使用 DTO 类。 我们的论坛有几个可用的模板,可以为您生成帮助程序代码+ DTO 类。 搜索“DTO 模板”。
Silverlight is build on a different .NET framework, and our entity types therefore can't be used on that platform. If you want to send our entity classes to silverlight, use DTO classes. Our forum has several templates available which can generate helper code + DTO classes for you. Search for 'DTO template'.