Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ServiceStack web service hosting on monotouch/monodroid?

I'm currently trying to host a REST webservice on ios/android using Xamarin and monotouch/monodroid. I already successfully have a basic webserver running using HttpListener, but now I would like to host a complete webservice using ServiceStack.

monotouch/monodroid have very limited web hosting capabilities (HttpListener is basically the only way), but ServiceStack can in theory accomodate with that.

It seems to be possible as I found someone who did it: http://www.servicestack.net/mythz_blog/?p=417

The problem is that project does not work anymore on the last monotouch version, and ServiceStack seems to have removed server hosting capabilites in the monotouch/monodroid latest builds...

Xamarin have a fork of ServiceStack (https://github.com/xamarin/ServiceStack) which seems to have hosting capabilities, but the monotouch specific service hosting build does not compile, and the fork seems outdated.

Has anyone succeeded in making the ServiceStack hosting capabilities work on monotouch/monodroid? Or do you have an idea on how to make it work?

like image 495
sinedied Avatar asked Dec 22 '25 17:12

sinedied


2 Answers

You might try this tutorial for self-hosting ServiceStack.

It looks like it will use HttpListener under the hood, but I don't know if the AppHostHttpListenerBase class will compile for MonoTouch/Mono for Android or not.

like image 151
jonathanpeppers Avatar answered Dec 24 '25 10:12

jonathanpeppers


Ok so after some research, the project to allow ServiceStack self-hosting has been dropped. It had a better luck with the (old) Xamarin version (https://github.com/xamarin/ServiceStack) and could compile it and make it work somehow.

Since I need to be in sync with the latest ServiceStack version, I guess that I have no other choice than to roll my own adaptation, using the old Xamarin branch as a starting point.

like image 45
sinedied Avatar answered Dec 24 '25 09:12

sinedied



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!