cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CXF-4877) CXF will throw javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Can't find prefix if the SEI has Action annotation
Date Wed, 06 Mar 2013 20:04:13 GMT

     [ https://issues.apache.org/jira/browse/CXF-4877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Daniel Kulp updated CXF-4877:
-----------------------------

    Description: 
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}

  was:
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:
@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);
}

Impl class
@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;}
}


command: java2ws -cp . -verbose -client -server -wsdl -d "D:\temp\wsgencxf" -s "D:\temp\wsgencxf"


The exception statck is:
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)

    
> 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

Mime
View raw message