简体   繁体   English

POST后在Android中从WCF返回JSON

[英]Returning JSON from WCF after POST in Android

I just started coding for my android application and I am unsure of how I should start coding. 我刚刚开始为我的android应用程序编码,但不确定如何开始编码。

If I want to do lets say a login in my android application. 如果我想做的话,请说我的Android应用程序中的登录名。 How should i start? 我应该如何开始? Is it possible if I do it in this way: 如果我这样做,是否有可能:

Send POST to my WebService > Web Service Validates credentials > Return user information 将POST发送到我的WebService> Web Service验证凭据>返回用户信息

Please help! 请帮忙!

Yes your process is correct. 是的,您的过程是正确的。

If you have simple needs like what you describe using the default serializer should be enough, just specify: 如果您有简单的需求,例如使用默认序列化程序描述的内容就足够了,只需指定:

WebMessageFormat.Json

Later if you need a full fledged JSON library use Json.NET 稍后,如果您需要完整的JSON库,请使用Json.NET

A small tutorial to get you started (it uses a similar use-case): http://www.codeproject.com/Articles/167159/How-to-create-a-JSON-WCF-RESTful-Service-in-60-sec 一个入门小指南(它使用类似的用例): http : //www.codeproject.com/Articles/167159/How-to-create-a-JSON-WCF-RESTful-Service-in-60秒

Do not forget to use authentication over HTTPS only... 不要忘记仅通过HTTPS使用身份验证...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM