如何通过Silverlight 4-WP7客户端使用SOAP-OData-Json的WCF RIA? [英] How do i use WCF RIA by SOAP-OData-Json via Silverlight 4 - WP7 Client?

查看:87
本文介绍了如何通过Silverlight 4-WP7客户端使用SOAP-OData-Json的WCF RIA?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个域服务(在Silverlight业务应用程序Web中构建),Silverlight App本地应用程序(例如TestAppSilverlight和TestAppSilverlight.Web)可以,我可以实现CRUD方法. (但我无法使该应用异步!!!)

但是,当我通过SOAP-ODATA-JSON为另一个Silverlight应用程序部署此域服务时,实现该服务(使用SOAP-VS 2010调试服务内部的某些错误,使用ODATA-JSON可以)以及我检索时遇到了大问题一些记录(通过ODTA-JSON),我从IE收到了这样的消息:

Hi guys,

I had a domain services (build in Silverlight Business Application Web) the Silverlight App local (e.g TestAppSilverlight and TestAppSilverlight.Web) is ok which I can implement CRUD method. (but I can''t async this app !!!)

But when I deploy this domain services via SOAP-ODATA-JSON for another Silverlight App ,i got big problem when implement this service (with SOAP-VS 2010 debug some error inside the sevice,with ODATA-JSON are ok) and when I retrieve some record (via ODTA-JSON) i got message from IE like that :

===========
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E) Timestamp: Wed, 20 Apr 2011 03:27:25 UTC
Message: Unhandled Error in Silverlight Application Silverlight does not enable you to directly enumerate over a data service query. This is because enumeration automatically sends a synchronous request to the data service. Because Silverlight only supports asynchronous operations, you must instead call the BeginExecute and EndExecute methods to obtain a query result that supports enumeration. at System.Data.Services.Client.DataServiceQuery1.System.Collections.Generic.IEnumerable<TElement>.GetEnumerator() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at SilverlightClient.MainPage..ctor() at SilverlightClient.App.Application_Startup(Object sender, StartupEventArgs e) at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName) Line: 1 Char: 1 Code: 0
================


我现在该怎么办:(?
请帮助我.


What should I do now :( ?
Please help me.

推荐答案

< strike>< strike>< strike>< strike>< small>< big>< pre><< ; code>< code>& lt;& amp;< a href ="></a>< a href ="></a> [< a href =""target =" _ blank</a>]</code></code></pre</big</small</strike</strike>< ;/strike></strike>
<strike><strike><strike><strike><small><big><pre><code><code>&lt;&amp;<a href=""></a><a href=""></a>[<a href="" target="_blank"></a>]</code></code></pre></big></small></strike></strike></strike></strike>


您不能枚举(收集)一些集合.

尝试执行"var myNewCollection = yourCollection.ToList();"首先并对此进行枚举.
You can''t enumerate (do a foreach) on some collection.

Try doing a "var myNewCollection = yourCollection.ToList();" first and enumerate on that.


这篇关于如何通过Silverlight 4-WP7客户端使用SOAP-OData-Json的WCF RIA?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆