WSO2存储服务器RSSAdminStub.addDatabaseForTenant无法正常工作

时间:2016-09-28 09:48:36

标签: api wso2


我尝试使用RSSAdminStub类的方法通过代码添加数据库 使用RSSAdminStub.addDatabase成功添加了数据库,但未将其添加到租户RSSAdminStub.addDatabaseForTenant

代码:

RSSAdminStub admin = new RSSAdminStub("https://localhost:9443/services/RSSAdmin");
AuthenticateStubUtil.authenticateStub("admin","admin", admin);

DatabaseInfo databaseInfo = new DatabaseInfo();
databaseInfo.setName("database01");
databaseInfo.setRssInstanceName("SYSTEM");
databaseInfo.setType("SYSTEM");

admin.addDatabaseForTenant("DEFAULT",databaseInfo,"domain.local");

此操作的结果是:

  

线程中的异常" main" org.apache.axis2.AxisFault:未知       at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)       at org.apache.axis2.description.RobustOutOnlyAxisOperation $ RobustOutOnlyOperationClient.handleResponse(RobustOutOnlyAxisOperation.java:91)       at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:445)       在org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)       在org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)       在org.wso2.carbon.rssmanager.ui.stub.RSSAdminStub.addDatabaseForTenant(RSSAdminStub.java:4323)       在md.esempla.plugin.DatabaseTests.main(DatabaseTests.java:39)       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)       at java.lang.reflect.Method.invoke(Method.java:498)       在com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

Upadate :还尝试使用SoapUI(xml)和Postman(json)调用此服务,并获得与unkwnown相同的错误

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Body>
    <soapenv:Fault>
       <faultcode>soapenv:Server</faultcode>
       <faultstring>unknown</faultstring>
       <detail/>
    </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>

1 个答案:

答案 0 :(得分:0)

我刚试过这个。看起来addDatabaseForTenant操作存在问题。但您可以使用addDatabase操作。假设您要将数据库添加到租户X,那么您应该以租户X的用户身份登录,并执行此操作。这将为租户X创建一个数据库。希望这会有所帮助。