Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/380.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在Spring框架中部署CXF web服务_Java_Web Services_Spring_Wsdl_Cxf - Fatal编程技术网

Java 在Spring框架中部署CXF web服务

Java 在Spring框架中部署CXF web服务,java,web-services,spring,wsdl,cxf,Java,Web Services,Spring,Wsdl,Cxf,在运行了CXF示例之后,我创建了一个简单的web服务,并且运行良好。但是,我想将它与servlet容器中的SpringWeb应用程序集成。更新servlet.xml配置文件后: <jaxws:endpoint id="HelloWorldService" implementor="path.to.webservice.HelloWorldImpl" endpointName="e:HelloEndpoint" serviceName="s:HelloService" address="/H

在运行了CXF示例之后,我创建了一个简单的web服务,并且运行良好。但是,我想将它与servlet容器中的SpringWeb应用程序集成。更新servlet.xml配置文件后:

<jaxws:endpoint id="HelloWorldService"
implementor="path.to.webservice.HelloWorldImpl"
endpointName="e:HelloEndpoint"
serviceName="s:HelloService"
address="/HelloService"
xmlns:e="http://service.jaxws.cxf.apache.org/endpoint"
xmlns:s="http://service.jaxws.cxf.apache.org/service"/>

和web.xml:

<servlet>
    <servlet-name>CXFServlet</servlet-name>
    <servlet-class>
        org.apache.cxf.transport.servlet.CXFServlet
    </servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>CXFServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
</servlet-mapping>

CXF服务器
org.apache.cxf.transport.servlet.CXFServlet
1.
CXF服务器
/服务/*
我能够在servlet中部署它,但是Spring服务的WSDL是非常错误的,即使Java接口和实现文件是相同的。请参见下面的Eclipse WSDL概要:


为什么会从相同的.java文件生成如此不同的WSDL?我如何让它在servlet中工作?提前感谢。

WSDL和模式取决于CXF中前端和数据绑定的选择。如果您的另一个环境不是相同版本的JAX-WS+JAXB,那么您将得到非常不同的结果。即使它只是这些服务的一个非CXF版本,您也可以期待不同的结果。

我没有看到用于评论的wsdl大纲,因此不同的服务引擎生成不同的wsdl