Hi Folks,
We are trying to develop a client for the WSAS admin services (WSAS version
is 2.3). We want to invoke the restart operation of the ServerAdmin service
using a client. So we used WSDL2Code to generate the necessary stubs for the
GlobalAdmin and ServerAdmin services. Then using the GlobalAdmin client we
are able to login to WSAS. Now we want to restart the server using the
established session. How can we do this in our code. We tried the following
but it didn't work.
String path = System.getProperty("user.dir");
System.setProperty("javax.net.ssl.trustStore", path +
"/src/wso2wsas.jks");
System.getProperty("javax.net.ssl.trustStorePassword", "wso2wsas");
GlobalAdminStub gStub = new GlobalAdminStub();
Options options = gStub._getServiceClient().getOptions();
options.setManageSession(true);
Login login = new Login();
login.setUsername("admin");
login.setPassword("admin");
if (gStub.login(login).get_return()) {
ServerAdminStub stub = new ServerAdminStub(cfgCtx);
stub._getServiceClient().getOptions().setManageSession(true);
stub.restart();
}
This code returns the following exception.
Exception in thread "main" org.apache.axis2.AxisFault: Access Denied. Please
login first.
at
org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at
org.wso2.wsas.admin.service.ServerAdminStub.restart(ServerAdminStub.java:193)
at org.moinc.server.test.WSASHandler.main(WSASHandler.java:29)
According to the WSAS logs the login attempt has been successful. But the
restart operation has failed. Can somebody please help me figure out the
correct way to do this?
Thanks
Best Regards,
Hiranya
_______________________________________________
Wsas-java-dev mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/wsas-java-dev