No data from generated service
-
martes, 13 de marzo de 2012 21:00
I am trying to implement the sample provided with Sync Framework 4, but on my own database. It all builds correctly, and as far as I can tell the service is working, but whenever I try to sync data , nothing happens; Load completes, but the OfflineContext classes data structures are empty.
I am using a desktop application that uses Entity Framework to access the database the Windows Phone 7 app is using and the data shows correctly using SQL Server 2008 Management Studio.
Most of the time, if I use LoadAsync() like in the tutorial, I get the following exception:
Could not load type 'System.Runtime.InteropServices.SEHException' from assembly 'mscorlib, Version=3.7.0.0, Culture=neutral, PublicKeyToken=969DB8053D3322AC'.
I am happy to post any source files that would be helpful, I'm just not sure where to look. The only other significant change from the tutorial is that I don't use WebClient.BaseAddress because every time I access that it is null.
Thanks for the help.
Todas las respuestas
-
miércoles, 14 de marzo de 2012 12:03Moderador
does the diagnostic page show the service as ok?
is the WP7 store on Isolated Storage?
try using Fiddler as well to sniff the traffic
-
miércoles, 14 de marzo de 2012 18:58
I haven't tried the diagnostic page, could you supply guidance on how to access that?
The WP7 store is (trying) to use isolated storage. One of the weird things that I noticed is that you have to change the name of the isolated storage "folder" everytime I change the scope name or the URI of the service. Is there a way to reset the "used" list, since I would like to go back to a normal name once those two values are constant?
Thanks
-
jueves, 15 de marzo de 2012 2:25Moderador
you can find it in the documentation that comes with the toolkit.
or see: http://msdn.microsoft.com/en-us/library/gg298994(v=sql.110).aspx
-
jueves, 15 de marzo de 2012 16:03
I got to the diagnostic page and everything was fine except:
ClientAccessPolicy.xml/CrossDomain.xml files FAILED Could not find clientaccesspolicy.xml or crossdomain.xml file. Silverlight clients invoking the service from another domain will be unable to make requests successfully. Not sure if that will be an issue or not... (I'm not on a domain). Also, I just got navigation working on my WP7 application, and whenever I navigate back to the home page, I get an exception saying that the application tried to recreate the context (or something to that effect). Should I be using NavigationService.Navigate, or is there a better way?
-
viernes, 16 de marzo de 2012 1:29Moderadorhard to tell what's wrong with your app if this is a custom app you built rather than the sample apps included in the framework. if its the sample app, we have at least something to compare it to and figure out what you changed. im guessing you're error is that in your home page, you're creating the context and navigating back fires the same logic again.
-
viernes, 16 de marzo de 2012 1:45
The custom part is the data schema being used. I changed the name of the scope and that's it. Since those strings match everywhere (including case), I cannot determine why I don't get any data when I call Load().
As far as the problem I am having with navigation, I agree with you, however, I want to know if there is a way to navigate back without recreating the context. I am using the same logic provided in the sample (I construct the object in the page's constructor).