Java Code Examples for org.wso2.carbon.user.mgt.stub.UserAdminStub#_getServiceClient

The following examples show how to use org.wso2.carbon.user.mgt.stub.UserAdminStub#_getServiceClient . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ApplicationManagementServiceClient.java    From carbon-identity-framework with Apache License 2.0 6 votes vote down vote up
/**
 * @param cookie
 * @param backendServerURL
 * @param configCtx
 * @throws AxisFault
 */
public ApplicationManagementServiceClient(String cookie, String backendServerURL,
                                          ConfigurationContext configCtx) throws AxisFault {

    String serviceURL = backendServerURL + "IdentityApplicationManagementService";
    String userAdminServiceURL = backendServerURL + "UserAdmin";
    stub = new IdentityApplicationManagementServiceStub(configCtx, serviceURL);
    userAdminStub = new UserAdminStub(configCtx, userAdminServiceURL);

    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);

    ServiceClient userAdminClient = userAdminStub._getServiceClient();
    Options userAdminOptions = userAdminClient.getOptions();
    userAdminOptions.setManageSession(true);
    userAdminOptions.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);

    if (debugEnabled) {
        log.debug("Invoking service " + serviceURL);
    }

}
 
Example 2
Source File: ApplicationManagementServiceClient.java    From carbon-identity with Apache License 2.0 6 votes vote down vote up
/**
 * @param cookie
 * @param backendServerURL
 * @param configCtx
 * @throws AxisFault
 */
public ApplicationManagementServiceClient(String cookie, String backendServerURL,
                                          ConfigurationContext configCtx) throws AxisFault {

    String serviceURL = backendServerURL + "IdentityApplicationManagementService";
    String userAdminServiceURL = backendServerURL + "UserAdmin";
    stub = new IdentityApplicationManagementServiceStub(configCtx, serviceURL);
    userAdminStub = new UserAdminStub(configCtx, userAdminServiceURL);

    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);

    ServiceClient userAdminClient = userAdminStub._getServiceClient();
    Options userAdminOptions = userAdminClient.getOptions();
    userAdminOptions.setManageSession(true);
    userAdminOptions.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);

    if (debugEnabled) {
        log.debug("Invoking service " + serviceURL);
    }

}
 
Example 3
Source File: UserAdminClient.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
public UserAdminClient(String cookie, String url, String serviceName,
        ConfigurationContext configContext) throws java.lang.Exception {
    try {
        stub = new UserAdminStub(configContext, url + serviceName);
        ServiceClient client = stub._getServiceClient();
        Options option = client.getOptions();
        option.setManageSession(true);


        option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
    } catch (Exception e) {
        handleException(e);
    }
}
 
Example 4
Source File: UserAdminClient.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
public UserAdminClient(String cookie, String url, ConfigurationContext configContext)
        throws java.lang.Exception {
    try {

        stub = new UserAdminStub(configContext, url + "UserAdmin");
        ServiceClient client = stub._getServiceClient();
        Options option = client.getOptions();
        option.setManageSession(true);
        option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
    } catch (Exception e) {
        handleException(e);
    }
}
 
Example 5
Source File: SamplesInvoker.java    From product-ei with Apache License 2.0 5 votes vote down vote up
private static void initUserAdminStub() throws Exception {
    userAdminStub = new UserAdminStub(USER_MANAGEMENT_SERVICE_URL);

    ServiceClient serviceClient = userAdminStub._getServiceClient();
    Options serviceClientOptions = serviceClient.getOptions();
    serviceClientOptions.setManageSession(true);
    CarbonUtils.setBasicAccessSecurityHeaders("admin", "admin", serviceClient);
}
 
Example 6
Source File: UserAdminClient.java    From carbon-identity with Apache License 2.0 5 votes vote down vote up
public UserAdminClient(String cookie, String url, String serviceName,
        ConfigurationContext configContext) throws java.lang.Exception {
    try {
        stub = new UserAdminStub(configContext, url + serviceName);
        ServiceClient client = stub._getServiceClient();
        Options option = client.getOptions();
        option.setManageSession(true);


        option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
    } catch (Exception e) {
        handleException(e);
    }
}
 
Example 7
Source File: UserAdminClient.java    From carbon-identity with Apache License 2.0 5 votes vote down vote up
public UserAdminClient(String cookie, String url, ConfigurationContext configContext)
        throws java.lang.Exception {
    try {

        stub = new UserAdminStub(configContext, url + "UserAdmin");
        ServiceClient client = stub._getServiceClient();
        Options option = client.getOptions();
        option.setManageSession(true);
        option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
    } catch (Exception e) {
        handleException(e);
    }
}