2

我正在使用自动化工具来自动化 Android 应用程序。该工具提供了 C# 代码,我可以将其添加到我的 C# 项目中。

我正在使用该工具的一个 API。它抛出异常

XmlRpcTypeMismatchException:响应包含预期字符串的结构值

我该如何解决这个问题?API 应string根据自动化工具的文档返回。

示例代码

//Set the client to interact with Automation tool

client = new Client(host, port);

//Set the android device

client.SetApplicationTitle(activeDevice);

//Call automation tool API HybridRunJavascript( Webview, index , Javascript) to execute Javascript . This is mocking the App object 

string str0 = client.HybridRunJavascript("", 0, "AppObj.set(null, 0.1, true, true);");
4

1 回答 1

0

只需将方法定义的返回值从 XmlRpcStruct 更改为 String。

前:

XmlRpcStruct myMethod(...params...);

后:

String myMethod(...params...);
于 2016-06-03T08:26:37.847 回答