我正在开发一个Android应用程序,用于连接到Tridion 2011 SP1核心服务.到目前为止,我已经使用wsclient从核心服务wsdl创建了Android WS Stubs.
导入了那些允许访问所有核心服务方法的存根.
我现在可以通过Android应用程序向Tridion进行身份验证,但是一旦我尝试执行最基本的Web服务调用,例如getApiVersion(),我就会收到错误消息:
ReflectionHelper*java.lang.NoSuchFieldException:GetApiVersionResult.
我想知道有没有其他人设法创建一个与核心服务通信的java android应用程序?
有趣的是,如果我将代码作为java应用程序运行,那么使用wsimport存根就可以了.
任何帮助赞赏.这里有一个代码片段供参考:
要连接到Tridion:
class TridionConnect extends AsyncTask<String, Integer, String> {
// Called to initiate the background activity
@Override
protected String doInBackground(String... statuses) {
try {
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("username", "password".toCharArray());
}
});
url = new URL("http://tridion-server/webservices/CoreService2011.svc?wsdl");
System.out.println(String.format("Get Service"));
service = new CoreService2011();
System.out.println(String.format("Get Client"));
client = service.getBasicHttp();
return "Authenticated To Tridion";
} catch (Exception e) {
Log.e("Authentication failure", e.toString());
e.printStackTrace();
return …Run Code Online (Sandbox Code Playgroud)