【问题标题】:Using JavaScript proxy to consume WCF service on android使用 JavaScript 代理在 android 上使用 WCF 服务
【发布时间】:2011-10-22 02:10:02
【问题描述】:

我需要使用一些通常在 Web 应用程序中使用但这次来自 android 的第 3 方 WCF Web 服务。

我在生成的javascript代理中有如下函数,

loginToW:function(email,password,succeededCallback, failedCallback, userContext) {
/// <param name="email" type="String">System.String</param>
/// <param name="password" type="String">System.String</param>
/// <param name="succeededCallback" type="Function" optional="true" mayBeNull="true"></param>
/// <param name="failedCallback" type="Function" optional="true" mayBeNull="true"></param>
/// <param name="userContext" optional="true" mayBeNull="true"></param>
return this._invoke(this._get_path(), 'loginToW',false,{email:email,password:password},succeededCallback,failedCallback,userContext); },

我无法更改服务中的任何内容。 在android中使用这种服务的最简单方法是什么?我可以将这个 javascipt 传递给 webView 还是应该使用 HttpClient 构建一个 JSON 消息并发布它?如何处理回调?

谢谢。

【问题讨论】:

  • 更好的是你构造一个 JSON 消息

标签: android wcf json web-services


【解决方案1】:

用 gson 构造 json 很容易。但由于我无法访问服务代码,我不得不使用 http fox 来查看每种方法的 json 实际外观。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-04
    相关资源
    最近更新 更多