From 55d88e187202f2c668b95b2f3f2f2beb0088f16c Mon Sep 17 00:00:00 2001 From: "USER-20220102CG\\noblelift" <546428999@qq.com> Date: Sun, 26 Mar 2023 21:11:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0webservices?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- acs/nladmin-system/jrebel-classpath-12132.jar | Bin 0 -> 23555 bytes acs/nladmin-system/pom.xml | 10 ++++ .../wms/service/impl/WmsToAcsServiceImpl.java | 1 - .../acs/ext/wms/service/wsdl/AutoPublish.java | 23 ++++++++++ .../acs/ext/wms/service/wsdl/CxfConfig.java | 15 ++++++ .../ext/wms/service/wsdl/IWebServiceTest.java | 10 ++++ .../ext/wms/service/wsdl/PublishEndpoint.java | 43 ++++++++++++++++++ .../org/nl/acs/ext/wms/service/wsdl/Test.java | 8 ++++ .../ext/wms/service/wsdl/WebServiceTest.java | 23 ++++++++++ .../security/satoken/SaTokenConfigure.java | 6 +-- 10 files changed, 135 insertions(+), 4 deletions(-) create mode 100644 acs/nladmin-system/jrebel-classpath-12132.jar create mode 100644 acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/AutoPublish.java create mode 100644 acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/CxfConfig.java create mode 100644 acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/IWebServiceTest.java create mode 100644 acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/PublishEndpoint.java create mode 100644 acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/Test.java create mode 100644 acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/WebServiceTest.java diff --git a/acs/nladmin-system/jrebel-classpath-12132.jar b/acs/nladmin-system/jrebel-classpath-12132.jar new file mode 100644 index 0000000000000000000000000000000000000000..34d5fa25409830eef0189f6a741138f7b5f1148e GIT binary patch literal 23555 zcmbuHO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pom.xml index a48b3f8..69bd163 100644 --- a/acs/nladmin-system/pom.xml +++ b/acs/nladmin-system/pom.xml @@ -40,6 +40,16 @@ 1.50 --> + + org.apache.cxf + cxf-spring-boot-starter-jaxws + 3.3.0 + + + org.apache.cxf + cxf-rt-features-logging + 3.3.0 + org.apache.commons commons-csv diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index de7039b..b4f10cf 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -44,7 +44,6 @@ import java.util.Map; @Service @RequiredArgsConstructor @Slf4j -@WebService public class WmsToAcsServiceImpl implements WmsToAcsService { private final ApplicationContext applicationContext; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/AutoPublish.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/AutoPublish.java new file mode 100644 index 0000000..2bf30ff --- /dev/null +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/AutoPublish.java @@ -0,0 +1,23 @@ +package org.nl.acs.ext.wms.service.wsdl; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + *

description:自动发布接口地址注解

+ * + * @author newzhong + * @version 1.0 + */ +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +public @interface AutoPublish { + /** + *

description:发布地址

+ * @return String + * @author newzhong + */ + String publishAddress(); +} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/CxfConfig.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/CxfConfig.java new file mode 100644 index 0000000..d380fe4 --- /dev/null +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/CxfConfig.java @@ -0,0 +1,15 @@ +package org.nl.acs.ext.wms.service.wsdl; + +import org.apache.cxf.Bus; +import org.apache.cxf.bus.spring.SpringBus; +import org.apache.cxf.feature.LoggingFeature; +import org.springframework.context.annotation.Bean; + +public class CxfConfig { + @Bean(name = Bus.DEFAULT_BUS_ID) + public SpringBus springBus() { + SpringBus bus = new SpringBus(); + bus.getFeatures().add(new LoggingFeature()); + return bus; + } +} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/IWebServiceTest.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/IWebServiceTest.java new file mode 100644 index 0000000..a350eab --- /dev/null +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/IWebServiceTest.java @@ -0,0 +1,10 @@ +package org.nl.acs.ext.wms.service.wsdl; + +import javax.jws.WebParam; +import javax.jws.WebService; + +@WebService(targetNamespace = "http://service.mrxu.com/") +public interface IWebServiceTest { + + String getDept(@WebParam(name = "jsonStr")String jsonStr); +} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/PublishEndpoint.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/PublishEndpoint.java new file mode 100644 index 0000000..e3593c6 --- /dev/null +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/PublishEndpoint.java @@ -0,0 +1,43 @@ +package org.nl.acs.ext.wms.service.wsdl; + +import lombok.extern.slf4j.Slf4j; +import org.apache.cxf.Bus; +import org.apache.cxf.bus.spring.SpringBus; +import org.apache.cxf.jaxws.EndpointImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.stereotype.Component; +import org.springframework.web.context.WebApplicationContext; + + +@Component +@Slf4j +public class PublishEndpoint implements ApplicationRunner { + + @Autowired + private WebApplicationContext applicationConnect; + + @Autowired() + @Qualifier(Bus.DEFAULT_BUS_ID) + private SpringBus bus; + + @SuppressWarnings("resource") + @Override + public void run(ApplicationArguments applicationArguments) throws Exception { + log.info("开始进行自动发布webService接口"); + + String[] beanNames = applicationConnect.getBeanNamesForAnnotation(AutoPublish.class); + for(String beanName : beanNames) { + String publishAddr = applicationConnect.getType(beanName).getAnnotation(AutoPublish.class).publishAddress(); + EndpointImpl endpoint = new EndpointImpl(bus, applicationConnect.getBean(beanName)); + endpoint.publish(publishAddr); + + log.info(String.format("发布接口地址:[%s]", publishAddr)); + } + + log.info("weBservice接口自动发布结束"); + } + +} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/Test.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/Test.java new file mode 100644 index 0000000..baef190 --- /dev/null +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/Test.java @@ -0,0 +1,8 @@ +package org.nl.acs.ext.wms.service.wsdl; + +public class Test { + + public static void Test(){ + System.out.println("1111"); + } +} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/WebServiceTest.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/WebServiceTest.java new file mode 100644 index 0000000..8c2ee9d --- /dev/null +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/wsdl/WebServiceTest.java @@ -0,0 +1,23 @@ +package org.nl.acs.ext.wms.service.wsdl; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.jws.WebService; +import java.util.List; + + +@Service("WebServiceTest") +@AutoPublish(publishAddress = "ACS") +@WebService(endpointInterface = "org.nl.acs.ext.wms.service.wsdl.IWebServiceTest", + serviceName = "WebServiceTest", + targetNamespace = "http://127.0.0.1:8010/WebServiceTest/" +) +public class WebServiceTest implements IWebServiceTest { + + @Override + public String getDept(String jsonStr) { + return "111"; + } +} diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/security/satoken/SaTokenConfigure.java b/acs/nladmin-system/src/main/java/org/nl/modules/security/satoken/SaTokenConfigure.java index ca4c66d..6b8cf7f 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/security/satoken/SaTokenConfigure.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/security/satoken/SaTokenConfigure.java @@ -34,9 +34,9 @@ public class SaTokenConfigure implements WebMvcConfigurer { @Override public void addInterceptors(InterceptorRegistry registry) { // 注册 Sa-Token 拦截器,打开注解式鉴权功能 - registry.addInterceptor(new SaInterceptor(handle -> StpUtil.checkLogin())) - .addPathPatterns("/**") - .excludePathPatterns(securityProperties.getExcludes()); // 白名单 +// registry.addInterceptor(new SaInterceptor(handle -> StpUtil.checkLogin())) +// .addPathPatterns("/**") +// .excludePathPatterns(securityProperties.getExcludes()); // 白名单 } }