Java Code Examples for org.apache.axis2.client.Stub#_getServiceClient

The following examples show how to use org.apache.axis2.client.Stub#_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: AuthenticateStub.java    From micro-integrator with Apache License 2.0 6 votes vote down vote up
public static Stub authenticateStub(Stub stub, String sessionCookie, String backendURL) {
    long soTimeout = 5 * 60 * 1000; // Three minutes

    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setTimeOutInMilliSeconds(soTimeout);
    System.out.println("XXXXXXXXXXXXXXXXXXX" + backendURL + client.getServiceContext().getAxisService().getName()
            .replaceAll("[^a-zA-Z]", ""));
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie);
    option.setTo(new EndpointReference(
            backendURL + client.getServiceContext().getAxisService().getName().replaceAll("[^a-zA-Z]", "")));
    if (log.isDebugEnabled()) {
        log.debug("AuthenticateStub : Stub created with session " + sessionCookie);
    }

    return stub;
}
 
Example 2
Source File: AuthenticateStub.java    From product-ei with Apache License 2.0 6 votes vote down vote up
public static Stub authenticateStub(Stub stub, String sessionCookie, String backendURL) {
    long soTimeout = 5 * 60 * 1000; // Three minutes

    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setTimeOutInMilliSeconds(soTimeout);
    System.out.println("XXXXXXXXXXXXXXXXXXX" +
                       backendURL +  client.getServiceContext().getAxisService().getName().replaceAll("[^a-zA-Z]", ""));
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie);
    option.setTo(new EndpointReference(backendURL +  client.getServiceContext().getAxisService().getName().replaceAll("[^a-zA-Z]", "")));
    if (log.isDebugEnabled()) {
        log.debug("AuthenticateStub : Stub created with session " + sessionCookie);
    }

    return stub;
}
 
Example 3
Source File: AuthenticateStub.java    From product-es with Apache License 2.0 6 votes vote down vote up
public static Stub authenticateStub(Stub stub, String sessionCookie, String backendURL) {
    long soTimeout = 5 * 60 * 1000; // Three minutes

    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setTimeOutInMilliSeconds(soTimeout);
    System.out.println("XXXXXXXXXXXXXXXXXXX" +
                       backendURL +  client.getServiceContext().getAxisService().getName().replaceAll("[^a-zA-Z]", ""));
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie);
    option.setTo(new EndpointReference(backendURL +  client.getServiceContext().getAxisService().getName().replaceAll("[^a-zA-Z]", "")));
    if (log.isDebugEnabled()) {
        log.debug("AuthenticateStub : Stub created with session " + sessionCookie);
    }

    return stub;
}
 
Example 4
Source File: AuthenticateStub.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
/**
 * Stub authentication method
 *
 * @param stub          valid stub
 * @param sessionCookie session cookie
 */
public static void authenticateStub(String sessionCookie, Stub stub) {
    long soTimeout = 5 * 60 * 1000; // Three minutes

    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setTimeOutInMilliSeconds(soTimeout);
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie);
    if (log.isDebugEnabled()) {
        log.debug("AuthenticateStub : Stub created with session " + sessionCookie);
    }
}
 
Example 5
Source File: AuthenticateStubUtil.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
/**
 * Stub authentication method
 *
 * @param stub          valid stub
 * @param sessionCookie session cookie
 */
public static void authenticateStub(String sessionCookie, Stub stub) {
    long soTimeout = 5 * 60 * 1000; // Three minutes

    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setTimeOutInMilliSeconds(soTimeout);
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie);
    if (log.isDebugEnabled()) {
        log.debug("AuthenticateStub : Stub created with session " + sessionCookie);
    }
}
 
Example 6
Source File: SOAPEntitlementServiceClient.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
private void setAuthCookie(boolean isExpired, Stub stub, Authenticator authenticator) throws Exception {
    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING,
                       authenticator.getCookie(isExpired));
}
 
Example 7
Source File: AuthenticateStubUtil.java    From product-ei with Apache License 2.0 5 votes vote down vote up
/**
 * Stub authentication method
 *
 * @param stub          valid stub
 * @param sessionCookie session cookie
 */
public static void authenticateStub(String sessionCookie, Stub stub) {
    long soTimeout = 5 * 60 * 1000; // Three minutes

    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setTimeOutInMilliSeconds(soTimeout);
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie);
    if (log.isDebugEnabled()) {
        log.debug("AuthenticateStub : Stub created with session " + sessionCookie);
    }
}
 
Example 8
Source File: AuthenticateStubUtil.java    From product-ei with Apache License 2.0 5 votes vote down vote up
/**
 * Stub authentication method
 *
 * @param stub          valid stub
 * @param sessionCookie session cookie
 */
public static void authenticateStub(String sessionCookie, Stub stub) {
    long soTimeout = 5 * 60 * 1000; // Three minutes

    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setTimeOutInMilliSeconds(soTimeout);
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie);
    if (log.isDebugEnabled()) {
        log.debug("AuthenticateStub : Stub created with session " + sessionCookie);
    }
}
 
Example 9
Source File: AuthenticateStubUtil.java    From product-ei with Apache License 2.0 5 votes vote down vote up
/**
 * Stub authentication method
 *
 * @param stub          valid stub
 * @param sessionCookie session cookie
 */
public static void authenticateStub(String sessionCookie, Stub stub) {
    long soTimeout = 5 * 60 * 1000; // Three minutes

    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setTimeOutInMilliSeconds(soTimeout);
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie);
    if (log.isDebugEnabled()) {
        log.debug("AuthenticateStub : Stub created with session " + sessionCookie);
    }
}
 
Example 10
Source File: AuthenticateStub.java    From product-ei with Apache License 2.0 5 votes vote down vote up
/**
 * Stub authentication method
 *
 * @param stub          valid stub
 * @param sessionCookie session cookie
 */
public static void authenticateStub(String sessionCookie, Stub stub) {
    long soTimeout = 5 * 60 * 1000; // Three minutes

    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setTimeOutInMilliSeconds(soTimeout);
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie);
    if (log.isDebugEnabled()) {
        log.debug("AuthenticateStub : Stub created with session " + sessionCookie);
    }
}
 
Example 11
Source File: SOAPEntitlementServiceClient.java    From carbon-identity with Apache License 2.0 5 votes vote down vote up
private void setAuthCookie(boolean isExpired, Stub stub, Authenticator authenticator)
        throws Exception {
    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING,
            authenticator.getCookie(isExpired));
}
 
Example 12
Source File: AuthenticateStubUtil.java    From product-cep with Apache License 2.0 5 votes vote down vote up
/**
 * Stub authentication method
 *
 * @param stub          valid stub
 * @param sessionCookie session cookie
 */
public static void authenticateStub(String sessionCookie, Stub stub) {
    long soTimeout = 5 * 60 * 1000; // Three minutes

    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setTimeOutInMilliSeconds(soTimeout);
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie);
    if (log.isDebugEnabled()) {
        log.debug("AuthenticateStub : Stub created with session " + sessionCookie);
    }
}
 
Example 13
Source File: AbstractAPIGatewayAdminClient.java    From carbon-apimgt with Apache License 2.0 5 votes vote down vote up
/**
 * Log into the API gateway as an admin, and initialize the specified client stub using
 * the established authentication session. This method will also set some timeout
 * values and enable session management on the stub so that it can be successfully used
 * for any subsequent admin service invocations.
 * 
 * @param stub A client stub to be setup
 * @throws AxisFault if an error occurs when logging into the API gateway
 */
protected void setup(Stub stub, Environment environment) throws AxisFault {
    String cookie = login(environment);
    ServiceClient client = stub._getServiceClient();
    Options options = client.getOptions();
    options.setTimeOutInMilliSeconds(15 * 60 * 1000);
    options.setProperty(HTTPConstants.SO_TIMEOUT, 15 * 60 * 1000);
    options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, 15 * 60 * 1000);
    options.setManageSession(true);
    options.setProperty(HTTPConstants.COOKIE_STRING, cookie);
}
 
Example 14
Source File: LocalEntryAdminClient.java    From carbon-apimgt with Apache License 2.0 5 votes vote down vote up
protected final void setup(Stub stub, Environment environment, ConfigurationContext configurationContext) throws AxisFault {
    String cookie = gatewayLogin(environment, configurationContext);
    ServiceClient serviceClient = stub._getServiceClient();
    Options options = serviceClient.getOptions();
    options.setTimeOutInMilliSeconds(15 * 60 * 1000);
    options.setProperty(HTTPConstants.SO_TIMEOUT, 15 * 60 * 1000);
    options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, 15 * 60 * 1000);
    options.setManageSession(true);
    options.setProperty(HTTPConstants.COOKIE_STRING, cookie);

}
 
Example 15
Source File: AuthenticateStub.java    From product-es with Apache License 2.0 5 votes vote down vote up
/**
 * Stub authentication method
 *
 * @param stub          valid stub
 * @param sessionCookie session cookie
 */
public static void authenticateStub(String sessionCookie, Stub stub) {
    long soTimeout = 5 * 60 * 1000; // Three minutes

    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setTimeOutInMilliSeconds(soTimeout);
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie);
    if (log.isDebugEnabled()) {
        log.debug("AuthenticateStub : Stub created with session " + sessionCookie);
    }
}