---
title: "CXF动态客户端如何优化JaxWsDynamicClientFactory.createClient -- 慢"
author: "PangSir"
date: "2012-04-21T01:46:29Z"
tags: []
categories: ["开源软件"]
slug: "cxf-jaxwsdynamicclientfactory-createclient"
draft: false
lastmod: "2012-04-21T01:46:29Z"
id: 1492515
url: "https://pangsir.iteye.com/blog/1492515"
---

在CXF动态创建客户端时，如下：

JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
Client client = null;
// 创建客户端连接
client = factory.createClient("http://localhost:9090/cxf/saveLove?wsdl");

经测试，在createClient操作中，会生产webservice下所有方法类、参数类、返回值类等等文件，耗时相当惊人，超级慢，后来想要需要优化创建初始化步骤；

后来从博友http://ruijf.iteye.com/blog/1186961上看到创建的client是线性安全，正好是自己所想要的效果；

特此记录，作为标志。