コード例 #1
0
ファイル: ClientTest.java プロジェクト: GeeQuery/cxf-plus
  // 调试用
  @Test
  @Ignore
  public void rawTest() {
    JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
    bean.setAddress("http://*****:*****@163.net","jiyi","lu"));
    //		System.out.println(id);
  }
コード例 #2
0
  private WebClient createWebClient(String address, Map<String, Object> extraProperties) {
    JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
    bean.setAddress(address);

    SpringBusFactory bf = new SpringBusFactory();
    URL busFile = JAXRSSamlAuthorizationTest.class.getResource("client.xml");
    Bus springBus = bf.createBus(busFile.toString());
    bean.setBus(springBus);

    Map<String, Object> properties = new HashMap<String, Object>();
    properties.put(
        "security.saml-callback-handler",
        "org.apache.cxf.systest.jaxrs.security.saml.SamlCallbackHandler");
    if (extraProperties != null) {
      properties.putAll(extraProperties);
    }
    bean.setProperties(properties);

    bean.getOutInterceptors().add(new SamlEnvelopedOutInterceptor());

    return bean.createWebClient();
  }