# # #pom. xml ' maven '
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
< Cxf-version>3.1.7</cxf-version>
</properties>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId> cxf-rt-frontend-jaxws</artifactid>
<version>${cxf-version}</version>
</dependency >
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId> cxf-rt-transports-http</artifactid>
<version>${cxf-version}</version>
</ Dependency>
# # #web. xml
<!--webService CXF-->
<servlet>
<servlet-name>cxf</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>cxf</servlet-name>
<url-pattern>/webService/*</url-pattern>
</servlet-mapping>
# # #applicationContext. xml
<import resource= "Classpath:applicationcontext-cxf.xml"/>
# # #applicationContext-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-3.2.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd ">
<jaxws : Endpoint id= "Testwsservice"
implementor= "Com.wjh.test.sync.service.impl.testwsServiceImpl" "address="
Testwsservice "/></beans>
Or
<!--JAX-WS Standard publishing mode-->
<jaxws:server id= "Auditservice" address= "/auditservice" >
<jaxws :servicebean>
<ref bean= "Auditserviceimpl"/>
</jaxws:serviceBean>
</jaxws: Server>
-------------------------------------------------------------------------
Import Javax.jws.WebParam;
Import Javax.jws.WebResult;
Import Javax.jws.WebService;
@WebService Public
interface Testwsservice {
@WebResult (name= ' result ') public
String GetInfo (@WebParam ( Name = "Bsid") string bsid, @WebParam (name = "Boid") string boid);
----------------------------------------------------------------------------------------
Import org.springframework.beans.factory.annotation.Autowired;
Import org.springframework.stereotype.Component;
Import Javax.jws.WebParam;
Import Javax.jws.WebResult;
Import Javax.jws.WebService;
@WebService (endpointinterface= "Com.wjh.test.sync.service.TestwsService") Public
class Testwsserviceimpl Implements Testwsservice {
@Autowired
private commonservice commonservice;
@WebResult (name= ' result ') public
string GetInfo (@WebParam (name = "Bsid") string bsid, @WebParam (name = "Boid") String boid) {return
commonservice.getinfo (Bsid, boid);
}
}
Eventually:
http://localhost:8080/webService/testwsService?wsdl