springboot集成axis1.4打成jar包开发webService

本文介绍了如何在SpringBoot项目中集成Axis1.4来开发Web服务,并将项目打包为JAR。主要内容包括添加Maven依赖,编写接口并使用server-config.wsdd文件发布,以及注意在打包时wsdd文件的位置。同时,文章强调了在注册Web服务Servlet时避免与Spring默认的DispatcherServlet名称冲突,以确保HTTP接口和Web服务接口都能正常访问。
摘要由CSDN通过智能技术生成

@springboot集成axis1.4打成jar包开发webService

一:添加开发所用maven依赖

		<dependency>
			<groupId>org.apache.axis</groupId>
			<artifactId>axis</artifactId>
			<version>1.4</version>
		</dependency>

		<dependency>
			<groupId>axis</groupId>
			<artifactId>axis-jaxrpc</artifactId>
			<version>1.4</version>
		</dependency>

		<dependency>
			<groupId>commons-discovery</groupId>
			<artifactId>commons-discovery</artifactId>
			<version>0.2</version>
		</dependency>
		<dependency>
			<groupId>wsdl4j</groupId>
			<artifactId>wsdl4j</artifactId>
			<version>1.6.3</version>
		</dependency>
        <!-- axis 依赖结束 -->

二:书写接口方法利用server-config.wsdd文件发布

<?xml version="1.0" encoding="UTF-8"?>

<!-- globalConfiguration 标签内容为系统默认 无需更改 -->
<globalConfiguration>
    <parameter name="adminPassword" value="admin" />
    <parameter name="attachments.Directory" value="./attachments" />
    <parameter name="attachments.implementation"
               value="org.apache.axis.attachments.AttachmentsImpl" />
    <parameter name="sendXsiTypes" value="true" />
    <parameter name="sendMultiRefs" value="true" />
    <parameter name="sendXMLDeclaration" value="true" />
    <parameter name="axis.sendMinimizedElements" value="true" />
    <requestFlow>
        <handler type="java:org.apache.axis.handlers.JWSHandler">
            <parameter name="sc
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要实现Spring Boot整合Axis1.4实现WebService服务端,可以按照以下步骤进行: 1. 在pom.xml文件中添加Axis1.4依赖: ``` <dependency> <groupId>org.apache.axis</groupId> <artifactId>axis</artifactId> <version>1.4</version> </dependency> ``` 2. 创建一个WebService接口,并在接口上添加@WebService注解: ``` @WebService public interface UserService { String sayHello(String name); } ``` 3. 创建一个WebService接口的实现类,并在实现类上添加@WebService(endpointInterface = "com.example.demo.UserService")注解: ``` @WebService(endpointInterface = "com.example.demo.UserService") public class UserServiceImpl implements UserService { @Override public String sayHello(String name) { return "Hello, " + name + "!"; } } ``` 4. 在Spring Boot的配置文件application.properties中添加Axis1.4的配置: ``` # Axis1.4配置 axis.servletPath=/services/* ``` 5. 创建一个AxisServlet的注册类,并在类上添加@Configuration和@EnableWebMvc注解: ``` @Configuration @EnableWebMvc public class AxisServletRegistration { @Bean public ServletRegistrationBean<AxisServlet> axisServlet() { ServletRegistrationBean<AxisServlet> registration = new ServletRegistrationBean<>(new AxisServlet(), "/services/*"); registration.addInitParameter("axis.servicesPath", "/WEB-INF/services"); registration.addInitParameter("axis.wsddPath", "/WEB-INF/server-config.wsdd"); return registration; } } ``` 6. 启动Spring Boot应用程序,访问http://localhost:8080/services/UserService?wsdl,可以看到WebService服务端已经成功启动。 以上就是Spring Boot整合Axis1.4实现WebService服务端的全部步骤。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值