WebService接口服务

这篇博客介绍了作者利用Spring、SpringMVC和Mybatis开发的一个简单WebService接口服务,详细记录了开发环境、配置文件、项目结构、遇到的问题及解决方案。在问题部分,讨论了'No operation was found'错误的原因和处理,以及Date类型数据只有年月日的解决办法。最后,提供了GitHub项目链接供读者参考。
摘要由CSDN通过智能技术生成

一个简单的接口服务

最近写了一个接口服务,发现有许多东西自己都忘了,记在笔记本上又怕忘了,所以想想还是写在微博上吧。

开发环境

tomcat 8.0.52、maven 3.3.9、JDK1.8

开发工具

Intellij IDEA

技术实现

Spring + SpringMVC + Mybatis

主要配置文件

jdbc.properties

jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
jdbc.url=jdbc:oracle:thin:@localhost:1521:orcl
jdbc.username=xiongzx123
jdbc.password=xiongzx123
#定义初始连接数
jdbc.initialSize=0
#定义最大连接数
jdbc.maxActive=20
#定义最大空闲
jdbc.maxIdle=20
#定义最小空闲
jdbc.minIdle=1
#定义最长等待时间
jdbc.maxWait=60000

srping-cxf.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:jaxws="http://cxf.apache.org/jaxws"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd
       http://cxf.apache.org/jaxws
       http://cxf.apache.org/schemas/jaxws.xsd">

    <import resource="classpath:META-INF/cxf/cxf.xml"/>
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
    <!--<import resource="classpath:META-INF/cxf/cxf-extension-xml.xml"/>-->

    <bean id="ServiceImpl" class="com.sunland.webservice.impl.WebServiceImpl"/>
    <jaxws:endpoint id="financeServiceWsdl" implementor="#ServiceImpl" address="/vioService">
        <jaxws:inInterceptors>
            <bean class="com.sunland.webservice.WebServiceInterceptor"/>
        </jaxws:inInterceptors>
    </jaxws:endpoint>
</beans>

spring-mybatis.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

    <!-- 自动扫描 -->
    <context:component-scan base-package="com.sunland"/>

    <context:property-place
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值