CXF使用wsdl生成的webservice客户端用户名密码验证,超时设置

//设置webservice用户名密码,接口验证
    BindingProvider bp = (BindingProvider) port;
    Map context = bp.getRequestContext();
    context.put(BindingProvider.USERNAME_PROPERTY, "username");
    context.put(BindingProvider.PASSWORD_PROPERTY, "password");

//设置连接超时时间,使用BindingProviderProperties.CONNECT_TIMEOUT

    context.put(BindingProviderProperties.CONNECT_TIMEOUT,10*1000);

//设置请求超时时间,使用BindingProviderProperties.REQUEST_TIMEOUT

  context.put(BindingProviderProperties.REQUEST_TIMEOUT, 60* 1000);

 

你可能感兴趣的:(接口编程)