当前位置: 首页>>代码示例>>Java>>正文


Java Stub类代码示例

本文整理汇总了Java中org.apache.axis2.client.Stub的典型用法代码示例。如果您正苦于以下问题:Java Stub类的具体用法?Java Stub怎么用?Java Stub使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Stub类属于org.apache.axis2.client包,在下文中一共展示了Stub类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initStub

import org.apache.axis2.client.Stub; //导入依赖的package包/类
private void initStub(Stub stub) throws AxisFault
{
	if( stub != null )
	{
		final ServiceClient client = stub._getServiceClient();

		final Options options = client.getOptions();
		options.setProperty(WSHandlerConstants.PW_CALLBACK_REF, this);
		options.setProperty(WSSHandlerConstants.OUTFLOW_SECURITY, ofc.getProperty());
		options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, "true");
		options.setProperty(HTTPConstants.HTTP_PROTOCOL_VERSION, HTTPConstants.HEADER_PROTOCOL_11);
		URI uri = URI.create(bbUrl);
		if( uri.getScheme().toLowerCase().startsWith("https") )
		{
			Protocol myhttps = new Protocol("https", new EasySSLProtocolSocketFactory(), 443);
			options.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER, myhttps);
		}
		client.engageModule("rampart-1.5.1");
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:21,代码来源:BlackboardConnectorServiceImpl.java

示例2: authenticateStub

import org.apache.axis2.client.Stub; //导入依赖的package包/类
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;
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:18,代码来源:AuthenticateStub.java

示例3: authenticateStub

import org.apache.axis2.client.Stub; //导入依赖的package包/类
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;
}
 
开发者ID:DistX,项目名称:Learning,代码行数:18,代码来源:AuthenticateStub.java

示例4: prepareStubInternal

import org.apache.axis2.client.Stub; //导入依赖的package包/类
private void prepareStubInternal(Stub stub)
{
    Options options = stub._getServiceClient().getOptions();
    options.setExceptionToBeThrownOnSOAPFault(true);
    options.setTimeOutInMilliSeconds(timeout);
    options.setManageSession(true);
    if (sessionCookie != null)
    {
        options.setProperty(HTTPConstants.COOKIE_STRING, sessionCookie);
    }
    options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);

    if (httpUsername != null && httpUsername.length() >= 0 && httpPassword != null)
    {
        HttpTransportProperties.Authenticator authenticator =
            new HttpTransportProperties.Authenticator();
        authenticator.setUsername(httpUsername);
        authenticator.setPassword(httpPassword);
        options.setProperty(HTTPConstants.AUTHENTICATE, authenticator);
    }
}
 
开发者ID:hschott,项目名称:cargo-wso2-container,代码行数:22,代码来源:AbstractWSO2Carbon4xRemoteService.java

示例5: setBasicAuth

import org.apache.axis2.client.Stub; //导入依赖的package包/类
/**
 * Ugly hack which only works due to the fact that the session server
 * doesn't verifiy the user's organization role
 * 
 * @param stub
 */
private void setBasicAuth(Stub stub) {
    HttpTransportProperties.Authenticator basicAuth = new HttpTransportProperties.Authenticator();
    basicAuth.setUsername(userKey);
    basicAuth.setPassword(password);
    basicAuth.setPreemptiveAuthentication(true);
    final Options clientOptions = stub._getServiceClient().getOptions();
    clientOptions.setProperty(HTTPConstants.AUTHENTICATE, basicAuth);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:15,代码来源:BssClient.java

示例6: authenticateStub

import org.apache.axis2.client.Stub; //导入依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:19,代码来源:AuthenticateStubUtil.java

示例7: cleanup

import org.apache.axis2.client.Stub; //导入依赖的package包/类
private void cleanup(Stub stub) {
    if (stub != null) {
        try {
            stub.cleanup();
        } catch (AxisFault axisFault) {
            log.warn("Failed to clean the stub " + stub.getClass());
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:10,代码来源:DeviceEventManagementServiceImpl.java

示例8: cleanup

import org.apache.axis2.client.Stub; //导入依赖的package包/类
private void cleanup(Stub stub) {
    if (stub != null) {
        try {
            stub.cleanup();
        } catch (AxisFault axisFault) {
            //do nothing
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:10,代码来源:DeviceAnalyticsArtifactUploaderAdminServiceImpl.java

示例9: setupStub

import org.apache.axis2.client.Stub; //导入依赖的package包/类
public static void setupStub(final @NotNull Stub stub, final @NotNull Credentials credentials, final @NotNull URI serverUri) {
  Options options = stub._getServiceClient().getOptions();

  // http params
  options.setProperty(HTTPConstants.CHUNKED, Constants.VALUE_FALSE);
  options.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
  options.setProperty(HTTPConstants.SO_TIMEOUT, SOCKET_TIMEOUT);
  if (Registry.is("tfs.set.connection.timeout", false)) {
    options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, SOCKET_TIMEOUT);
  }

  // credentials
  if (credentials.getType() == Credentials.Type.Alternate) {
    String basicAuth =
      BasicScheme.authenticate(new UsernamePasswordCredentials(credentials.getUserName(), credentials.getPassword()), "UTF-8");
    Map<String, String> headers = new HashMap<String, String>();
    headers.put(HTTPConstants.HEADER_AUTHORIZATION, basicAuth);
    options.setProperty(HTTPConstants.HTTP_HEADERS, headers);
  }
  else {
    HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
    auth.setUsername(credentials.getUserName());
    auth.setPassword(credentials.getPassword() != null ? credentials.getPassword() : "");
    auth.setDomain(credentials.getDomain());
    auth.setHost(serverUri.getHost());
    options.setProperty(HTTPConstants.AUTHENTICATE, auth);

    HttpMethodParams params = new HttpMethodParams();
    params.setBooleanParameter(USE_NATIVE_CREDENTIALS, credentials.getType() == Credentials.Type.NtlmNative);
    options.setProperty(HTTPConstants.HTTP_METHOD_PARAMS, params);
  }

  // proxy
  final HttpTransportProperties.ProxyProperties proxyProperties;
  final HTTPProxyInfo proxy = HTTPProxyInfo.getCurrent();
  if (proxy.host != null) {
    proxyProperties = new HttpTransportProperties.ProxyProperties();
    Pair<String, String> domainAndUser = getDomainAndUser(proxy.user);
    proxyProperties.setProxyName(proxy.host);
    proxyProperties.setProxyPort(proxy.port);
    proxyProperties.setDomain(domainAndUser.first);
    proxyProperties.setUserName(domainAndUser.second);
    proxyProperties.setPassWord(proxy.password);
  }
  else {
    proxyProperties = null;
  }

  options.setProperty(HTTPConstants.PROXY, proxyProperties);
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:51,代码来源:WebServiceHelper.java

示例10: setAuthCookie

import org.apache.axis2.client.Stub; //导入依赖的package包/类
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));
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:9,代码来源:SOAPEntitlementServiceClient.java

示例11: setSSLProtocolHandler

import org.apache.axis2.client.Stub; //导入依赖的package包/类
/**
 * Set the custom trust manager as the ssl protocol handler for the stub
 * 
 * @param stub
 * @throws Exception
 */
public static void setSSLProtocolHandler(Stub stub) throws Exception {
	init();
	stub._getServiceClient()
	    .getOptions()
	    .setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER,
	                 new Protocol("https", (ProtocolSocketFactory) new CustomSSLProtocolSocketFactory(sslCtx), 443));
}
 
开发者ID:wso2,项目名称:developer-studio,代码行数:14,代码来源:SSLUtils.java

示例12: configureServiceClient

import org.apache.axis2.client.Stub; //导入依赖的package包/类
private void configureServiceClient(Stub stub, HttpSession session) {
    ServiceClient client;Options options;
    client = stub._getServiceClient();
    options = client.getOptions();
    if (workListConfig.getUsername() != null
            && workListConfig.getPassword() != null && workListConfig.isRemote()) {
        CarbonUtils.setBasicAccessSecurityHeaders(workListConfig.getUsername(),
                workListConfig.getPassword(), client);
    } else {
        options.setProperty(HTTPConstants.COOKIE_STRING,
                session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE));
    }
    options.setManageSession(true);
}
 
开发者ID:wso2,项目名称:carbon-governance,代码行数:15,代码来源:HumanTaskClient.java

示例13: prepareStub

import org.apache.axis2.client.Stub; //导入依赖的package包/类
protected void prepareStub(Stub stub)
{
    authenticate();

    prepareStubInternal(stub);
}
 
开发者ID:hschott,项目名称:cargo-wso2-container,代码行数:7,代码来源:AbstractWSO2Carbon4xRemoteService.java

示例14: getServiceStub

import org.apache.axis2.client.Stub; //导入依赖的package包/类
public Stub getServiceStub(){
    return this.authenticationAdminStub;
}
 
开发者ID:wso2,项目名称:carbon-platform-integration-utils,代码行数:4,代码来源:AuthenticatorClient.java

示例15: getAuthenticationAdminStub

import org.apache.axis2.client.Stub; //导入依赖的package包/类
public Stub getAuthenticationAdminStub() {
    return authenticationAdminStub;
}
 
开发者ID:wso2,项目名称:carbon-platform-integration-utils,代码行数:4,代码来源:AuthenticatorClient.java


注:本文中的org.apache.axis2.client.Stub类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。