servicestack,Xamarin.android,servicestack" /> servicestack,Xamarin.android,servicestack" />

Xamarin.android 使用servicestack在Mono for Android上进行身份验证

Xamarin.android 使用servicestack在Mono for Android上进行身份验证,xamarin.android,servicestack,Xamarin.android,servicestack,我已经让ServiceStack在服务器和Windows测试客户端上运行良好,现在需要让它在我的Mono For Android应用程序中运行 我下载了以下内容: var c = new JsonServiceClient("http://localhost:53434"); var authResponse = c.Get(new Auth { UserName = "myusername", Password = "password", RememberMe = true }); Ser

我已经让ServiceStack在服务器和Windows测试客户端上运行良好,现在需要让它在我的Mono For Android应用程序中运行

我下载了以下内容:

var c = new JsonServiceClient("http://localhost:53434");
var authResponse = c.Get(new Auth { UserName = "myusername", Password = "password", RememberMe = true });
  • ServiceStack.Common.dll

  • ServiceStack.Interfaces.dll

  • ServiceStack.Text.dll

在我的Mono for Android项目中添加了对这些的引用

但是,我们需要使用身份验证,因此需要ServiceStack.ServiceInterface.Web命名空间可用于客户端,因此我可以执行以下操作:

var c = new JsonServiceClient("http://localhost:53434");
var authResponse = c.Get(new Auth { UserName = "myusername", Password = "password", RememberMe = true });
看看我的工作测试客户机,Auth是在ServiceStack.ServiceInterface.dll中定义的,所以我可能需要掌握这个dll,或者它的源代码,并在我的项目中编译它

我说的对吗,还是有更简单的方法来安排事情?我已经搜索过了,但是找不到一个关于如何在Android上使用ServiceStack和Mono的好资源-如果有,请随时告诉我

我注意到StackOverflow表明我的思路是正确的——我可能需要的只是为Android版Mono编译的ServiceStack.ServiceInterface.dll


James

您不必编译服务器
ServiceStack.ServiceInterface.dll
以在任何客户端库中使用,因为在
ServiceStack.Common.dll
客户端库中也有一个Auth dto副本


这是可能的,因为服务器和客户端DTO都生成相同的有线格式

您不必编译服务器
ServiceStack.ServiceInterface.dll
,以便在任何客户端库中使用,因为在
ServiceStack.Common.dll
客户端库中也有一份Auth DTO的副本


这是可能的,因为服务器和客户端DTO都生成相同的有线格式

谢谢,这很有道理。但是,我从()中提取的ServiceStack.Common.dll没有定义ServiceStack.Common.ServiceClient.Web.Auth。因此,我是否必须下拉并编译/包含ServiceClient.Web.AuthDtos.cs?或者是否有一个ServiceStack.Common.dll可用于此包含?是的,MonoDroid/MonoTouch构建由社区提供,因此它们可能会有点过时。最好从src编译以获得最新版本。谢谢-那就是我接下来要做的!刚刚下载并编译了源代码,现在一切正常-谢谢!实际上,我刚刚意识到我不需要下载和编译。我为Auth使用了错误的名称空间,它一直存在,如:ServiceStack.Common.ServiceClient.Web.authThank-这很有意义。但是,我从()中提取的ServiceStack.Common.dll没有定义ServiceStack.Common.ServiceClient.Web.Auth。因此,我是否必须下拉并编译/包含ServiceClient.Web.AuthDtos.cs?或者是否有一个ServiceStack.Common.dll可用于此包含?是的,MonoDroid/MonoTouch构建由社区提供,因此它们可能会有点过时。最好从src编译以获得最新版本。谢谢-那就是我接下来要做的!刚刚下载并编译了源代码,现在一切正常-谢谢!实际上,我刚刚意识到我不需要下载和编译。我为Auth使用了错误的名称空间,它一直存在,如:ServiceStack.Common.ServiceClient.Web.Auth