如何通过WIFI在Android上调用WCF服务?

问题描述:

我已经创建了一个基于phonegap的android应用程序,我在其中调用了WCF服务及其工作,现在我想转移到Native,我正在使用android studio,请帮我如何调用这些服务,或者可以我使用已经创建的phonegap项目的JS文件?



我尝试过:



我只是想知道如何通过WIFI在Android上调用WCF服务?

I have created a phonegap based android application, in which I have called WCF Services and its working, Now I want to move to Native,for which I am using android studio, Please help me how to call those services, or can I use the already created JS file of phonegap project?

What I have tried:

I just want to know how do I call WCF services on android over WIFI ?

由于PhoneGap(或者Cordova)使用JavaScript,问题是如何使用JavaScript调用WCF服务...

因为你可以使用JQuery的ajax方法(当然你必须在你的WCF上启用HTTP / S绑定,最好使用JSON格式来返回值) )...

这里有一个很好的例子:使用jQuery调用WCF服务 [ ^ ]
As PhoneGap (or maybe Cordova) uses JavaScript, the question is how to call WCF services using JavaScript...
for that you can use JQuery's ajax method (of course you have to enable HTTP/S bindings on your WCF and better to use JSON format for return values)...
There is a nice sample of all this here: Calling WCF Services using jQuery[^]