Skip to content

Instantly share code, notes, and snippets.

@uphy
Last active February 10, 2017 06:07
Show Gist options
  • Save uphy/ea987b982a508cea6ad6b50ea607e25c to your computer and use it in GitHub Desktop.
Save uphy/ea987b982a508cea6ad6b50ea607e25c to your computer and use it in GitHub Desktop.
import org.wso2.am.admin.clients.registry.ResourceAdminServiceClient;
import org.wso2.carbon.endpoint.stub.types.EndpointAdminEndpointAdminException;
import org.wso2.carbon.registry.info.stub.RegistryExceptionException;
import org.wso2.carbon.registry.resource.stub.ResourceAdminServiceExceptionException;
import org.wso2.carbon.rest.api.stub.RestApiAdminAPIException;
import java.rmi.RemoteException;
public class ResourceAdminServiceClientSample {
public static void main(String[] args) throws RemoteException, RestApiAdminAPIException, EndpointAdminEndpointAdminException, RegistryExceptionException, ResourceAdminServiceExceptionException {
System.setProperty("javax.net.ssl.trustStore", "/Users/ishikura/wso2am/wso2am-2.1.0/repository/resources/security/wso2carbon.jks");
final String backendUrl = "https://localhost:9443/services/";
final String userName = "admin";
final String password = "admin";
final String path = "/_system/governance/apimgt/applicationdata/workflow-extensions.xml";
final ResourceAdminServiceClient client = new ResourceAdminServiceClient(backendUrl, userName, password);
System.out.println(client.getTextContent(path));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment