-
Spring 集成CXF 发布webService 服务生成的wsdl文件中没有接口参数信息0
我通过spring+cxf2.7.5 发布了一个java实现的webservie,但是在发布生成的wsdl文件中没有看到接口的参数信息,请问是什么原因?
java服务接口如下@WebService public interface EngineServices { /** * 处方/医嘱审核接口 * @param xml * @param postType * @return */ @WebMethod(operationName="postPres",action="urn:http://services.engine.health.dh.com/EngineServices/postPres") public String postPres( @WebParam(name="xml",targetNamespace="http://services.engine.health.dh.com/") String xml, @WebParam(name="postType",targetNamespace="http://services.engine.health.dh.com/") int postType); // @WebMethod(operationName="postPres",action="urn:http://services.engine.health.dh.com/EngineServices/postPres") // public String postPres( // ); }
服务实现类如下:package com.dh.health.engine.services.impl; import javax.jws.WebParam; import javax.jws.WebService; import com.dh.health.engine.Engine; import com.dh.health.engine.services.EngineServices; import com.dj.tools.StringUtils; /** * * 处方干预服务实现类 */ @WebService(endpointInterface="com.dh.health.engine.services.EngineServices") public class EngineServiceImpl implements EngineServices { /** * @param xml 处方XML数据 * @param postType 提交类型 */ @Override public String postPres( @WebParam(name="xml",targetNamespace="http://services.engine.health.dh.com/") String xml, @WebParam(name="postType",targetNamespace="http://services.engine.health.dh.com/") int postType) { EngineMessage message = new EngineMessage(); if(StringUtils.isEmpty(xml)){ message.setIsSuccess(0); message.setMessage("传过来的XML为空,请检查"); return getBackMessage(message); } try { String ret = Engine.runString(xml,postType+""); if (!ret.startsWith("<infos>")) message.setMessage(ret.replaceAll("<", "<") .replaceAll(">", ">").replaceAll("&", "&")); else { message.setMessage(ret); } message.setIsSuccess(1); return getBackMessage(message); } catch (Exception e) { e.printStackTrace(); message.setIsSuccess(0); message.setMessage(e.getMessage()); return getBackMessage(message); } } // @Override // public String postPres(){ // return "测试合理用药"; // } /** * 返回干预结果 * @param message * @return */ private String getBackMessage(EngineMessage message) { StringBuffer sb = new StringBuffer(); sb.append("<root><message>\n"); sb.append(message.getMessage()+"\n"); sb.append("</message>\n"); sb.append("<isSuccess>\n"); sb.append(message.getIsSuccess()+"\n"); sb.append("</isSuccess>\n"); sb.append("</root>"); return sb.toString(); } } class EngineMessage { private String message; private int isSuccess; public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public int getIsSuccess() { return isSuccess; } public void setIsSuccess(int isSuccess) { this.isSuccess = isSuccess; } }
spring配置如下:<jaxws:endpoint id="engineService" implementor="com.dh.health.engine.services.impl.EngineServiceImpl" address="/es" > </jaxws:endpoint>
发布之后生成的wsdl如下:<?xml version="1.0" encoding="GBK"?> -<wsdl:definitions targetNamespace="http://impl.services.engine.health.dh.com/" name="EngineServiceImplService" xmlns:ns1="http://services.engine.health.dh.com/" xmlns:ns2="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://impl.services.engine.health.dh.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <wsdl:import namespace="http://services.engine.health.dh.com/" location="http://192.168.0.234/ws/es?wsdl=EngineServices.wsdl"> </wsdl:import> -<wsdl:binding name="EngineServiceImplServiceSoapBinding" type="ns1:EngineServices"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> -<wsdl:operation name="postPres"> <soap:operation style="document" soapAction="urn:http://services.engine.health.dh.com/EngineServices/postPres"/> -<wsdl:input name="postPres"> <soap:body use="literal"/> </wsdl:input> -<wsdl:output name="postPresResponse"> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> -<wsdl:service name="EngineServiceImplService"> -<wsdl:port name="EngineServiceImplPort" binding="tns:EngineServiceImplServiceSoapBinding"> <soap:address location="http://192.168.0.234/ws/es"/> </wsdl:port> </wsdl:service> </wsdl:definitions>
问题补充:postPres 这个方法有两个参数,但是在wsdl中好像没有参数定义的信息2014年5月28日 11:30
目前还没有答案
相关推荐
3、web.xml里配置spring监听器,及其加载的beans.xml,把cxf-servlet.xml删掉,发布到WEB服务器即可,注意这种方式在必须需要本地wsdl文件 手动放在src下,默认发布到web服务器的路径为WEB-INF/classes/xxx.wsdl ...
第一天: 什么是webservice? 从案例(便民查询网站)分析如何实现? 使用socket实现。 使用jaxws开发webservice。 Webservice三要素 ... CXF发布rest的webservice。(重点) 综合案例: 实现便民查询网站
webservice地址 http://localhost:8080/springCxf/HelloWorld?wsdl
CXF简化了构造,集成,面向服务架构(SOA)业务组件与技术的灵活复用。在CXF中,Service使用WSDL标准定义并能够使用各种不同的消息格式(或binding)和网络协议(transports)包括SOAP、XML(通过HTTP或JMS)进行访问。CXF...
Apache CXF 提供方便的Spring整合方法,可以通过注解、Spring标签式配置来暴露Web Services和消费Web Services 各种类型的Annotation。@WebService和@WebMethod是WSDL映射Annatotion。这些Annotation将描述Web ...
testWebService 是webservice的服务端 zxntest 是webservice 的客户端(很大一部分jar包无效) http://localhost:8080/testWebService/webservice/webservice?wsdl 测试路径
调用webservice,插入数据,整合druid监控数据源;... webservice配置文件在spring-mvc.xml和web.xml中; 数据库监控地址http://localhost:8080/taixingMsg/druid/index.html... 各位同仁,生命不止,奋斗不息
CXF 是实现webService ,包括服务端和客户端,还有与spring的结合
2.在cmd中输入wsdl2java http://localhost:8080/cxf_spring_service/mm/cxf?wsdl报wsdl2java不是内部命令,需要配置path环境变量为D:\workspace\apache-cxf-3.2.1\bin和cxf_home变量为D:\workspace\apache-cxf-3.2.1...
Spring Web Services 是基于 Spring 框架的 Web 服务框架,主要侧重于基于文档驱动的Web服务,提供 SOAP 服务开发,允许通过多种方式创建 Web 服务。本章利用Apache CXF构建和开发webservice. 1. webservice远程...
cxf与spring集成 需要最少的jar如下: cxf-2.3.3.jar geronimo-annotation_1.0_spec-1.1.1.jar geronimo-jaxws_2.2_spec-1.0.jar geronimo-stax-api_1.0_spec-1.0.1.jar geronimo-ws-metadata_2.0_spec-1.1.3.jar ...
这是一个包含简单登录和查询的Web项目,内附有一个表sql文件和两个java项目。 WS_WebService是服务端,是一个Web项目,先启动它,进入的登录页面的链接为:http://localhost:8080/WS_WebService/ wsdl的进入链接为:...
cxf+spring开发webservice的简单实例,通过查看cfx的doc文档确定wsdl支持所引用的最少jar包
使用spring3+ cxf 3.4做服务方,Axis1.4做请求方,在调用的时候,通过转换cxf的wsdl格式为axis1.4的wsdl格式来达到调用的目的。
以前做java的初步理解了下...实现了3个接口服务,1个接口服务端提供登录是用的传统webservice,用的cxf。1个接口只是测试,测试了双向json数据传输解析。还一个接口是网络上提供的手机归属地查询,实现了它的接口。
有大量简单的 API 用来快速地构建代码优先的 Services,各种 Maven 的插件也使集成更加容易,支持 JAX-WS API ,支持 Spring 2.0 更加简化的 XML 配置方式,等等。 4. 支持二进制和遗留协议:CXF 的设计是一种可插...
antlr-2.7.7.jar ...wsdl4j-1.6.2.jar wss4j-1.6.7.jar xalan-2.7.1.jar xml-resolver-1.2.jar xmlbeans-2.5.0.jar xmlschema-core-2.0.3.jar xmlsec-1.5.2.jar xmltooling-1.3.2-1.jar xsdlib-2010.1.jar
最近项目中遇到需要去掉老系统的webservice服务中的insert方法,找了很久,发现这样最简单,实测有效!!!
这个代码例子是为了调用CXF提供的WS服务,所以先要下载“CXF和Spring结合的例子”,并将服务器(tomcat)运行起来,在利用本客户端测试,本客户端是根据服务端发布的WSDL文件,用wsdl2java直接生成java代码,加入到...