CXF发布服务,WebService缺少<wsdl:types/><wsdl:message/>标签
来源:互联网 发布:孙叔敖之知 编辑:程序博客网 时间:2024/05/06 04:45
发布CXF时遇到一个问题,发布的服务,wsdl文件中没有<wsdl:types/><wsdl:message/>标签,wsdl文件如下:
<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="com.oristartech.sms.core.ws.server" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns2="http://schemas.xmlsoap.org/soap/http" xmlns:ns1="http://server.ws.core.sms.oristartech.com/" name="dispatchService" targetNamespace="com.oristartech.sms.core.ws.server"> <wsdl:import location="http://localhost:8080/sms/webservice/isSwitch?wsdl=DispatchService.wsdl" namespace="http://server.ws.core.sms.oristartech.com/"> </wsdl:import> <wsdl:binding name="dispatchServiceSoapBinding" type="ns1:DispatchService"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="isSwitchHall"> <soap:operation soapAction="" style="document"/> <wsdl:input name="isSwitchHall"> <soap:body use="literal"/> </wsdl:input> <wsdl:output name="isSwitchHallResponse"> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="dispatchService"> <wsdl:port binding="tns:dispatchServiceSoapBinding" name="DispatchServiceImplPort"> <soap:address location="http://localhost:8080/sms/webservice/isSwitch"/> </wsdl:port> </wsdl:service></wsdl:definitions>对比别的wsdl文件,发现多了wsdl:import,将其地址复制到浏览器地址栏,发现里面是丢失的两个标签,这才发现不是丢失,而是包含在wsdl:import标签里面。
仔细查找原因:实现类中标明了命名空间@WebService(targetNamespace=“com.oristartech.sms.core.ws.server"),接口类未标明命名空间(@WebService())
解决方案:将接口类和实现类标注命名空间,两者保持一致即可。
接口类代码:
@WebService(targetNamespace = "com.oristartech.sms.core.ws.server")public interface DispatchService {public String isSwitchHall(@WebParam(name="isSwitch")String isSwitch);}实现类代码:
@WebService(endpointInterface = "com.oristartech.sms.core.ws.server.DispatchService", targetNamespace = "com.oristartech.sms.core.ws.server", serviceName="dispatchService")public class DispatchServiceImpl implements DispatchService {public String isSwitchHall(@WebParam(name="isSwitch")String isSwitch) {System.out.println("===="+isSwitch);return "111";}}
阅读全文
0 0
- CXF发布服务,WebService缺少<wsdl:types/><wsdl:message/>标签
- 解决cxf+spring发布的webservice缺少<wsdl:types>和<wsdl:message>标签的问题
- 解决cxf+spring发布的webservice缺少<wsdl:types>和<wsdl:message>标签的问题
- 解决cxf+bboss发布的webservice缺少<wsdl:types>和<wsdl:message>标签的问题
- webservice cxf -- wsdl
- WSDL/WebService/SOAP/REST/AXIS/CXF 开放式服务
- WebService wsdl没有types的问题
- WSDL发布WebService (第一部分)
- webservice wsdl文件标签讲解
- CXF客户端调用?wsdl webservice接口开发
- cxf webservice生成wsdl文件错误
- WebService apache cxf wsdl 生成客户端代码
- Spring整合CXF 发布webservice接口服务器(普通及REST)和客户端,WSDL简单解析
- webservice wsdl
- WebService WSDL
- webservice--WSDL
- cxf发布webservice 服务
- WSDL发布WebService(第二部分)
- 第三周项目一(2)
- python3 sm3 编码器
- 学习redis的简单命令及相关
- Oracle 11g必须开启的服务及服务详细介绍
- spring源码学习(六)Bean的加载(中)
- CXF发布服务,WebService缺少<wsdl:types/><wsdl:message/>标签
- 解决Cannot change version of project facet Dynamic web module to 2.5
- docker compose flask环境搭建
- JS 关于URL的正则
- webpack入门第五篇
- 第四周项目1建立单链表
- js表现与数据分离
- 第四周 项目4
- CDH 5.12.0版本集群安装