[
https://issues.apache.org/jira/browse/CXF-4877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13595073#comment-13595073
]
Daniel Kulp commented on CXF-4877:
----------------------------------
Thanks for looking into this and a very good detailed explanation of a test for
it. I was able to quickly reproduce it with a testcase here. However, I'm
not going to use your patch. It kind of patches the symptom of the problem,
but not the real problem. Instead, I'm updating the ServiceWSDLBuilder to
actually pass the appropriate WSDL definition around so that namespaces added
by extensors and other things can be properly added to the correct definition
instead of the "root" one.
> CXF will throw javax.wsdl.WSDLException: WSDLException:
> faultCode=OTHER_ERROR: Can't find prefix if the SEI has Action annotation
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: CXF-4877
> URL: https://issues.apache.org/jira/browse/CXF-4877
> Project: CXF
> Issue Type: Bug
> Components: Integration, Tooling
> Affects Versions: 2.6.2
> Reporter: Yan Min Sheng
> Attachments: CXF-4877.patch
>
>
> There are two key conditions to reproduce this problem:
> 1. The targetNamesapce of SEI and impl class is different;
> 2. Add @Action annotation in SEI.
> SEI:
> {code:java}
> @WebService(name = "SimonTestOne", targetNamespace =
> "iftest.interfaces.webservice_g2.annotations")
> @XmlSeeAlso({
> ObjectFactory.class
> })
> public interface SimonTestOne {
> /**
> *
> * @param arg0
> * @return
> * returns java.lang.String
> */
> @WebMethod
> @WebResult(name = "notreturn", targetNamespace = "")
> @RequestWrapper(localName = "bareIfMethod", targetNamespace =
> "iftest.interfaces.webservice_g2.annotations", className =
> "annotations.webservice_g2.interfaces.iftest.BareIfMethod")
> @ResponseWrapper(localName = "bareIfMethodResponse", targetNamespace =
> "iftest.interfaces.webservice_g2.annotations", className =
> "annotations.webservice_g2.interfaces.iftest.BareIfMethodResponse")
> @Action(input =
> "iftest.interfaces.webservice_g2.annotations/InterfaceTestOne/bareIfMethodRequest",
> output =
> "iftest.interfaces.webservice_g2.annotations/InterfaceTestOne/bareIfMethodResponse")
> public String bareIfMethod(
> @WebParam(name = "arg0", targetNamespace = "")
> String arg0);
> }
> {code}
> Impl class
> {code:java}
> @WebService(targetNamespace="server.interfaces.webservice_g2.annotations",
> serviceName="ifimplsvc",
> portName="iftest",
>
> endpointInterface="annotations.webservice_g2.interfaces.server.SimonTestOne"
> )
>
> public class SimonTestOneImpl{
> // implemented from interface
> public String bareIfMethod(String s){return s;}
> }
> {code}
> command:
> {code}
> java2ws -cp . -verbose -client -server -wsdl -d "D:\temp\wsgencxf" -s
> "D:\temp\wsgencxf"
> {code}
> The exception statck is:
> {code}
> javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Can't find
> prefix for 'http://www.w3.org/2007/05/addressing/metadata'. Namespace
> prefixes must be set on the Definition object using the addNamespace(...)
> method.
> at com.ibm.wsdl.util.xml.DOMUtils.getPrefix(Unknown Source)
> at com.ibm.wsdl.util.xml.DOMUtils.getQualifiedValue(Unknown Source)
> at com.ibm.wsdl.util.xml.DOMUtils.printQualifiedAttribute(Unknown
> Source)
> at com.ibm.wsdl.xml.WSDLWriterImpl.printExtensibilityAttributes(Unknown
> Source)
> at com.ibm.wsdl.xml.WSDLWriterImpl.printInput(Unknown Source)
> at com.ibm.wsdl.xml.WSDLWriterImpl.printOperations(Unknown Source)
> at com.ibm.wsdl.xml.WSDLWriterImpl.printPortTypes(Unknown Source)
> at com.ibm.wsdl.xml.WSDLWriterImpl.printDefinition(Unknown Source)
> at com.ibm.wsdl.xml.WSDLWriterImpl.writeWSDL(Unknown Source)
> at com.ibm.wsdl.xml.WSDLWriterImpl.writeWSDL(Unknown Source)
> at
> org.apache.cxf.tools.java2wsdl.generator.wsdl11.WSDL11Generator.generate(WSDL11Generator.java:99)
> at
> org.apache.cxf.tools.java2wsdl.generator.wsdl11.WSDL11Generator.generate(WSDL11Generator.java:1)
> at
> org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor.generate(JavaToWSDLProcessor.java:156)
> at
> org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor.process(JavaToWSDLProcessor.java:118)
> at
> org.apache.cxf.tools.java2ws.JavaToWSContainer.processWSDL(JavaToWSContainer.java:110)
> at
> org.apache.cxf.tools.java2ws.JavaToWSContainer.execute(JavaToWSContainer.java:75)
> at
> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
> at
> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:58)
> at
> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:40)
> at org.apache.cxf.tools.java2ws.JavaToWS.run(JavaToWS.java:77)
> at org.apache.cxf.tools.java2ws.JavaToWS.main(JavaToWS.java:45)
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira