[ https://issues.apache.org/jira/browse/CXF-2895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12890417#action_12890417 ]
Daniel Kulp commented on CXF-2895: ---------------------------------- The behavior is correct. When a namespace is not set, we are supposed to generate a namespace from the package name. That said, the targetNamespace really would not affect whether the message looks like one or the other. You can generate the second message with a schema with a targetNamespace just fine. The elementFormDefault would be unqualified which would result in the elements output without a namespace. > CXF is unable to correctly generate embedded WSDL for schemas without XML > namespaces. > -------------------------------------------------------------------------------------- > > Key: CXF-2895 > URL: https://issues.apache.org/jira/browse/CXF-2895 > Project: CXF > Issue Type: Bug > Affects Versions: 2.2.9 > Reporter: Gyorgy Orban > Fix For: Invalid > > Attachments: noNamespaceBug.tar > > > This archive should be uncompressed in the root directory of a recent CXF > binary > distribution, in order for the scripts to work. > CXF is unable to correctly generate embedded WSDL for schemas without XML > namespaces. The behaviour of CXF is the same as the reference implementation, > but I'm hoping this behaviour is not what the specs say. > There are two versions of the data model classes, models/allNS.jar and > models/someNS.jar. The allNS.jar contains a JAXB data model generated from two > schemas, main.xsd and sub.xsd, both of which have a targetNamespace, implying > a message format like this: > <m:M xmlns:m="http://xmlns.foo.com/main" > xmlns:s="http://xmlns.foo.com/sub" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://xmlns.foo.com/main main.xsd > http://xmlns.foo.com/sub sub.xsd"> > <s:A>1</s:A> > <s:B>2</s:B> > <s:C> > <s:D>3</s:D> > <s:E>4</s:E> > </s:C> > </m:M> > The someNS.jar contains a JAXB data model similarly generated from two schemas > main.xsd and sub.xsd. This time, main.xsd has a targetNamespace, but sub.xsd > does not, implying a message format like this: > <m:M xmlns:m="http://xmlns.foo.com/main" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://xmlns.foo.com/main main.xsd" > xsi:noNamespaceSchemaLocation="sub.xsd"> > <A>1</A> > <B>2</B> > <C> > <D>3</D> > <E>4</E> > </C> > </m:M> > The runAll.sh script starts a CXF server with the first model; fetching WSDL > from http://localhost:9000/Service?wsdl will give you the correct embedded > schemas. > The runSome.sh script will start a CXF server with the second model. This time > when you fetch the WSDL from http://localhost:9000/Service?wsdl, you get the > main.xsd schema generated correctly, but the sub.xsd appears in the same > namespace as the main.xsd. This is not correct, it should have no namespace. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.