use original wsdl to generate wsdl in CXF

前端 未结 1 798
执笔经年
执笔经年 2021-01-15 09:16

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

I know Axis 2 has a configurat

相关标签:
1条回答
  • 2021-01-15 09:56

    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 讨论(0)
提交回复
热议问题