cxf accept the one-way server-side SSL authentication

sponsored links
Important URL:
The first is the official wiki, this certification process to add structure and detail through the configuration of the CXF support for SSL
The second parameter to which this configuration
 package com.cxf.client;

import java.util.Iterator;
import java.util.List;

import javax.xml.namespace.QName;

import org.apache.cxf.configuration.jsse.TLSClientParameters;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.transport.http.HTTPConduit;

public final class Client {

    private Client() {

    public static void main(String args[]) throws Exception {
        ClassPathXmlApplicationContext context 
            = new ClassPathXmlApplicationContext(new String[] {"com/cxf/client/client-beans.xml"});
        ICardInfoWebService client = (ICardInfoWebService)context.getBean("client");
                org.apache.cxf.endpoint.Client proxy = ClientProxy.getClient(client);
                HTTPConduit conduit = (HTTPConduit) proxy.getConduit(); 
                TLSClientParameters tls= new TLSClientParameters(); 
        tls.setTrustManagers( new TrustManager[]{ new TrustAllX509TrustManager()}); 
        tcp.setDisableCNCheck(true);// Accept the server-side authentication  
List<TxnDtlAccountVo> list = client.findTxnDtlAccountInfo(txnDtlAccountVo);

Configuration file com / cxf / client / client-beans.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- START SNIPPET: beans -->
<beans xmlns=""

      factory-bean="clientFactory" factory-method="create"/>
<property name="serviceClass" value="com.cxf.client.ICardInfoWebService"/>
<property name="address" value=""/>
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of cxf accept the one-way server-side SSL authentication

  • Servlet brief introduction

    Servlet brief introduction: Servlet is a small application server Are used to complete the B / S architecture, the client requests the response to treatment Platform independence, performance, able to run thread Servlet API for Servlet provides the s ...

  • First Hibernate Example

    Curd a simple example. Source does not contain the dependent libraries, or playing too much of the package. PO object Note: One must have the default constructor 2 non-final modified. Otherwise useless lazy loading. UserDAOImpl category code, and other co

  • Spring2.0 + hibernate3.1 + log4j + mysql demo

    applicationContext.xml Non-attachment jar package, necessary friends can send an email to todd.liangt @

  • Struts2 + hibernate + spring problem user log in

    dao layer services layer action jsp <tr> <td align="center"> <b> user name: </ b> </ td> <td> <s: textfield name = "czyNumber" cssClass = "textstyle" theme = "simple" size = &q

blog comments powered by Disqus
Recent Entries
Tag Cloud
Random Entries