JTIM
JTIM

Reputation: 2771

Accessing Azure Mobile Service on Windows Phone from Different Projects

Hello I am having the following exception:

Additional information: The request could not be completed. (Bad Request)

I did not understand why since the function worked sometimes I therefore found the following on stackoverflow: MobileServiceInvalidOperationException When Trying To Retrieve Data From Azure. This issue unfortunately does not solve my issue.

The time is correct and I am using https connection. And all the communication is working perfectly. I however have divided my Windows Phone Silverlight application into several projects, the reason for this I have stated in another stackoverflow question: Deleting project/pages/usercontrols from memory.

The application flow is:

I know the packages are in order in Project 2 because I can upload information to blob storage and the includes are the same in both projects. But as soon as I contact my own backend service the application crashes with the above exception.

So can anyone help me with this issue, do I need to create a new mobileserviceclient and reauthenticate? Seems stupid?

Upvotes: 1

Views: 136

Answers (1)

phillipv
phillipv

Reputation: 1717

I'm not sure what is going wrong, but generally, I would recommend making a new client instance here.

To avoid a login issue I would look at caching the mobile service's token. (See: http://azure.microsoft.com/en-us/documentation/articles/mobile-services-windows-dotnet-how-to-use-client-library/#caching)

Then you can spin up a new client, reuse your existing auth tokens/etc, and continue on.

Upvotes: 1

Related Questions