简体   繁体   中英

WSO2 Storage server RSSAdminStub.addDatabaseForTenant won't work


I try to add database through code using RSSAdminStub class's methods database is added successfully using RSSAdminStub.addDatabase but won't add this for tenant RSSAdminStub.addDatabaseForTenant

Code:

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");

And result for this operation is:

Exception in thread "main" org.apache.axis2.AxisFault: unknown 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) at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149) at org.wso2.carbon.rssmanager.ui.stub.RSSAdminStub.addDatabaseForTenant(RSSAdminStub.java:4323) at 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) at com. intellij.rt.execution.application.AppMain.main(AppMain.java:144)

Upadate : Also tried to invoke this service using SoapUI(xml) and Postman(json) and get same error as 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>

I just tried this. Looks like there is an issue with addDatabaseForTenant operation. But you can use addDatabase operation instead. Say you want to add a database to tenant X, then you should login as a user of tenant X, and do this operation. That will create a database for tenant X. Hope this will help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM