WebService服务端简单搭建WebService服务端简单搭建
webService依赖包
<dependency>
<groupId>f</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>3.2.4</version>
</dependency>
webService服务端总⼊⼝
1. 接⼝
//targetNamespace 接⼝所在包路径反着写
@WebService(targetNamespace ="service.M04.scybstl.yinhai/")
public interface STLServicesInterface {
/**
* @param inputXml
* @return
*/
@WebMethod
String callBusiness(String inputXml);
}
2. 接⼝实现类
@WebService(serviceName ="stlService",
targetNamespace="service.M04.scybstl.yinhai/",
endpointInterface ="com.yinhai.scybstl.M04.service.STLServicesInterface")
@Service
@Transactional(rollbackFor ={AppException.class})
public class STLServicesImpl implements STLServicesInterface {
@Override
public String callBusiness(@WebParam(name ="inputXml") String inputXml){
}
}
3. 配置类
@Configuration
public class WebServiceConfig {
@Resource
private Bus bus;
@Resource
private STLServicesInterface stlServicesInterface;
/**
* 站点服务发布接⼝
* @return
*/
@Bean
调用webservice服务public Endpoint studentServiceEndpoint(){
EndpointImpl endpoint =new EndpointImpl(bus,stlServicesInterface);        endpoint.publish("/stlService");
return endpoint;
}
}
测试webService
2. postman
XML模板
<Envelope soapenv"pm <Header/>
<Body
<callBusiness
<arg0
</arg0>
</callBusiness
</Body
</Envelope

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。