From 3b2decedde042efe481330a20981a374efdf5978 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期二, 18 六月 2024 10:39:33 +0800
Subject: [PATCH] 提交

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/util/JaxWsDynamicClientFactory.java |   73 ++++++++++++++++++++++++++++++++++++
 1 files changed, 73 insertions(+), 0 deletions(-)

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/util/JaxWsDynamicClientFactory.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/util/JaxWsDynamicClientFactory.java
new file mode 100644
index 0000000..7fd662a
--- /dev/null
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/util/JaxWsDynamicClientFactory.java
@@ -0,0 +1,73 @@
+package org.jeecg.modules.mdc.util;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.CXFBusFactory;
+import org.apache.cxf.endpoint.EndpointImplFactory;
+import org.apache.cxf.endpoint.dynamic.DynamicClientFactory;
+import org.apache.cxf.jaxws.support.JaxWsEndpointImplFactory;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * @author Lius
+ * @date 2024/6/14 11:07
+ * 娉細瑙e喅姝わ紙閿欒锛氱紪鐮丟BK鐨勪笉鍙槧灏勫瓧绗︼級闂
+ */
+public class JaxWsDynamicClientFactory extends DynamicClientFactory {
+
+    protected JaxWsDynamicClientFactory(Bus bus) {
+        super(bus);
+    }
+
+    @Override
+    protected EndpointImplFactory getEndpointImplFactory() {
+        return JaxWsEndpointImplFactory.getSingleton();
+    }
+
+    protected boolean allowWrapperOps() {
+        return true;
+    }
+
+    /**
+     * Create a new instance using a specific <tt>Bus</tt>.
+     *
+     * @param b the <tt>Bus</tt> to use in subsequent operations with the
+     *            instance
+     * @return the new instance
+     */
+    public static JaxWsDynamicClientFactory newInstance(Bus b) {
+        return new JaxWsDynamicClientFactory(b);
+    }
+
+    /**
+     * Create a new instance using a default <tt>Bus</tt>.
+     *
+     * @return the new instance
+     */
+    public static JaxWsDynamicClientFactory newInstance() {
+        Bus bus = CXFBusFactory.getThreadDefaultBus();
+        return new JaxWsDynamicClientFactory(bus);
+    }
+
+    /**
+     * 瑕嗗啓鐖剁被鐨勮鏂规硶<br/>
+     * 娉細瑙e喅姝わ紙閿欒锛氱紪鐮丟BK鐨勪笉鍙槧灏勫瓧绗︼級闂
+     *
+     * @return
+     */
+    @Override
+    protected boolean compileJavaSrc(String classPath, List<File> srcList, String dest) {
+        org.apache.cxf.common.util.Compiler javaCompiler
+                = new org.apache.cxf.common.util.Compiler();
+
+        // 璁剧疆缂栬瘧缂栫爜鏍煎紡锛堟澶勪负鏂板浠g爜锛�
+        javaCompiler.setEncoding("UTF-8");
+
+        javaCompiler.setClassPath(classPath);
+        javaCompiler.setOutputDir(dest);
+        javaCompiler.setTarget("1.6");
+
+        return javaCompiler.compileFiles(srcList);
+    }
+}

--
Gitblit v1.9.3