开发者

use original wsdl to generate wsdl in CXF

开发者 https://www.devze.com 2023-03-25 07:57 出处:网络
Can any one please let me know what is the method to gen开发者_StackOverflow社区erate WSDL in Apache CXF Server using original WSDL.

Can any one please let me know what is the method to gen开发者_StackOverflow社区erate WSDL in Apache CXF Server using original WSDL.

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

I want to know the setting in CXF.


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

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.

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

EDIT:

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 - 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

Remember to define the namespaces for e: and e1 by xmlns:e="namespace as in your 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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消