使用原始wsdl在CXF中生成wsdl [英] use original wsdl to generate wsdl in CXF

查看:335
本文介绍了使用原始wsdl在CXF中生成wsdl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以让我知道使用原始WSDL在 Apache CXF 服务器中生成WSDL的方法是什么。

Can any one please let me know what is the method to generate WSDL in Apache CXF Server using original WSDL.

我知道轴2 Service.xml 中有一个配置,用于设置 useOriginalWSDL 为TRUE,我得到原始的wsdl。

I know Axis 2 has a configuration in Service.xml to set useOriginalWSDL to TRUE and I get the original wsdl.

我想知道CXF中的设置。

I want to know the setting in CXF.

推荐答案

要使用原始WSDL在CXF Server中生成WSDL,我们可以在元素<$ c中使用属性 wsdlLocation $ c> jaxws:endpoint

For using the original WSDL to generate WSDL in CXF Server we can use the attribute wsdlLocation in the element jaxws:endpoint

该属性指定端点的WSDL合同的位置。 WSDL合同的位置是相对于部署服务的文件夹的。

The attribute ,Specifies the location of the endpoint's WSDL contract. The WSDL contract's location is relative to the folder from which the service is deployed.

或CXF中的
我们可以使用 @WebService 注释,我们可以指定WSDL的位置。请参考文档
关于 @ WebService

OR in CXF we can use @WebService annotation we can specify the WSDL location Please refer the documentation about @WebService

我自己找到了答案,我认为这是一个简单的问题,但是觉得这个答案可以在堆栈溢出中

I myself found the answer, I think this is a simple question, but felt that this answer can be in stackoverflow

编辑:

事件我添加了 wsdlLocation ,该服务无法由CXF框架创建。 apache tomcat中的错误没有太大帮助,只是指出无法创建服务。
为了正常工作, jaxws:endpoint 应该具有以下属性:

Eventhough I added wsdlLocation , the service could not be created by CXF framework. Errors in apache tomcat are not that helpful, except stating that Service could not be created. For proper working jaxws:endpoint should have following attributes:


  1. wsdlLocation -项目文件夹中的相对路径,例如 /WEB-INF/originalwsdl.wsdl

  2. serviceName -WSDL中的服务名称,在wsdl中指定了名称空间,例如 e:ServiceName

  3. endpointName -这是端口绑定名称,与serviceName相同,例如 e1:endpointName

  1. wsdlLocation - relative path from the project folder e.g /WEB-INF/originalwsdl.wsdl
  2. serviceName - service name in the WSDL, with namespace specified in wsdl e.g e:ServiceName
  3. endpointName - this is the port binding name, same rules as serviceName e.g e1:endpointName

请记住使用 xmlns:e = namespace来定义e:和e1的命名空间,如您的wsdl

所有这些设置之后,我的应用程序就可以正常工作了。
我们从wsdl创建的类应与目标名称空间具有相同的包名称,以便使用原始WSDL创建完全相同的WSDL。请有人确认这一发现。

After all this setting my application worked. The classes we create from wsdl should have the same package name as target name space, for creating exactly same WSDL using original WSDL. Please someone confirm this finding.


我发现CXF的文档很少,不得不在代码中挖掘
和xsds用于我的解决方案

I found that there is very little documentation for CXF, and had to dig in the code and xsds for my solutions

这篇关于使用原始wsdl在CXF中生成wsdl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆