c# - Accessing Azure Mobile Service on Windows Phone from Different Projects -
hello having following exception:
additional information: request not completed. (bad request)
i did not understand why since function worked therefore found following on stackoverflow: mobileserviceinvalidoperationexception when trying retrieve data azure. issue unfortunately not solve issue.
the time correct , using https connection. , communication working perfectly. have divided windows phone silverlight application several projects, reason have stated in stackoverflow question: deleting project/pages/usercontrols memory.
the application flow is:
project 1:
- login (authenticate mobileservice)
- navigate mainmenu, upon success.
- service contacted
await mobileservice.invokeapiasync<dto.userinfodto, dto.userinfodto>(userinfodto);
success allways! - mobileservice saved resources
application.current.resources.add("navigationparam", app.mobileservice);
, navigating new project done.
- project 2:
- navigation parameter retrieved
mobileservice = mobileserviceclient)application.current.resources["navigationparam"];
(information seems intact when looking debugger). - service contacted
await mobileservice.invokeapiasync<dto.userinfodto, dto.userinfodto>(userinfodto);
success never!
- navigation parameter retrieved
i know packages in order in project 2 because can upload information blob storage , includes same in both projects. contact own backend service application crashes above exception.
so can me issue, need create new mobileserviceclient , reauthenticate? seems stupid?
i'm not sure going wrong, generally, recommend making new client instance here.
to avoid login issue @ caching mobile service's token. (see: http://azure.microsoft.com/en-us/documentation/articles/mobile-services-windows-dotnet-how-to-use-client-library/#caching)
then can spin new client, reuse existing auth tokens/etc, , continue on.
Comments
Post a Comment