Silverlight WCF 访问返回 LLBLGen 实体的 IList?

发布于 2024-07-13 21:30:57 字数 1203 浏览 2 评论 0原文

我在将实体集合从 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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

甲如呢乙后呢 2024-07-20 21:30:57

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...

人间☆小暴躁 2024-07-20 21:30:57

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'.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文