Hi Rob I dont think MT supports portable class lib's YET. The easiest way is to make a new MT library project, and add the files (link them, dont copy them) into it, then build it. You end up with two almost identical csproj's, but the output DLL's work....
But yes, otherwise, you should be able to share the model between client and server if they are otherwise just POCOs Have a look at RestSharp, and DropNet (a Dropbox client which uses RestSharp) which might give you some ideas on how to implement the client. > Oh, and how I pass some credentials with Identity Management from the > client to the server, hopefully that's trivial!? I'm not sure how IM works, and what you have to pass. MT does support Basic auth out of the box, and RS can do OAuth, so it kind of depends how WebAPI works.... Cheers Nic On Mon, Jul 16, 2012 at 5:37 PM, Rob Wilson <[email protected]> wrote: > Hi Nic, > > Thanks for getting back to me. The way I see it is that in theory I > only need .NET 4.5 on the server and something lower in the client, > after all it's only JSON being sent backwards and forwards. I've > watched a couple of videos on WebAPI and it makes it look very > straight forward. > > If I move my model into some code that's shared between the .NET 4.5 > server and client projects using the 'Portable Class Library' support, > I'm pretty close to getting what I want. > > My only hiccup so far is that the models are annotated with > [serializable] (for binary deep cloning), but the 'Portable Class > Library' doesn't like Serializable at all. Once I resolve this I'm a > happy man - maybe someone on these forums can help. > > > Cheers, > Rob. > > > On 16 July 2012 10:17, Nic Wise <[email protected]> wrote: >> Hi Rob >> >> The JSON part is easy. You can either roll it yourself, or use a >> library like RestSharp, which wraps up a lot of it for you. Thats my >> preference. ServiceStack may also work, tho it's not something I've >> used personally. >> >> .NET 4.5 stuff, however, doesn't _directly_ work on MonoTouch (or >> Mono), so I doubt you'd be able to take your 4.5-generated client and >> use it unchanged on MT. That said, I've not used 4.5 much, so I may be >> very wrong there. A quick google around says it uses SAML 2.0, tho I >> suspect you'll have to write a lot of it yourself. >> >> You might be better off wrapping the 4.5 WIF stuff and exposing it as >> a less-MS-specific manner. eg using oauth for the authentication, and >> then wrapping it up on the server into a WIF call if needed. >> >> Looking at this WebAPI tutorial: >> >> http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api >> >> It looks like it's all REST + JSON, which RestSharp / ServiceStack / >> just doing it yourself is fairly easy. >> >> Hope that helps >> >> Nic >> >> >> >> On Sun, Jul 15, 2012 at 10:22 AM, Netplay <[email protected]> wrote: >>> Hi all, >>> >>> I am looking at writing a new mono touch iPhone application that will >>> integrate with a dot net 4.5 server with identity management and JSON >>> services exposed through the web API. >>> >>> Does anyone on these forums have experience with either identity management >>> or web API, or can advise on the compatibility with net 4.5 with mono touch? >>> >>> Regards, >>> Rob >>> >>> (this email was produced on an iPad and I may have used the dictation >>> feature) >>> _______________________________________________ >>> MonoTouch mailing list >>> [email protected] >>> http://lists.ximian.com/mailman/listinfo/monotouch >> >> >> >> -- >> Nic Wise >> t. +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise >> b. http://www.fastchicken.co.nz/ >> >> mobileAgent (for FreeAgent): get your accounts in your pocket. >> http://goo.gl/IuBU >> Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa >> Earnest: Self-employed? Track your business expenses and income. >> http://earnestapp.com >> Nearest Bus: find when the next bus is coming to your stop. >> http://goo.gl/Vcz1p >> London Bike App: Find the nearest Boris Bike, and get riding! >> http://goo.gl/Icp2 > _______________________________________________ > MonoTouch mailing list > [email protected] > http://lists.ximian.com/mailman/listinfo/monotouch -- Nic Wise t. +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise b. http://www.fastchicken.co.nz/ mobileAgent (for FreeAgent): get your accounts in your pocket. http://goo.gl/IuBU Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa Earnest: Self-employed? Track your business expenses and income. http://earnestapp.com Nearest Bus: find when the next bus is coming to your stop. http://goo.gl/Vcz1p London Bike App: Find the nearest Boris Bike, and get riding! http://goo.gl/Icp2 _______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
