You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Marco Piraccini <ma...@acm.org> on 2008/01/24 16:42:06 UTC

item element with xmlns=""

I need to expose a service (java-first) with CXF with an exception  
(EchoComplexException
) that includes an array of object (of class EchoStruct).
The service is setted with: anonymousWrapperType, qualifyWrapperSchema  
ad wrapped to true.

The wsdl generated seems to be correct, with a wrapper  
EchoComplexException of the type:

<xs:complexType final="#all" name="echoStructArray">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="item"  
nillable="true" type="tns:echoStruct"/>
</xs:sequence>
</xs:complexType>

The problem is that, on object deserialization, the  
EchoComplexException is serialized in:

<EchoComplexException xmlns="xxx">
<ns2:reason xsi:type="echoStructArray" xmlns="yyy" xmlns:ns2="xxx"  
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<item xmlns="" xmlns:ns4="yyy">
<ns4:fieldBoolean>true</ns4:fieldBoolean>
</item>
</ns2:reason>
</EchoComplexException>

...that's correct, except for the xmlns="" item namespace. Of course  
the schema validation fails.

Anyone meet the same problem?

Marco.



Re: item element with xmlns=""

Posted by Daniel Kulp <dk...@apache.org>.
Any chance you could send me a testcase?  (You can send a zip/tgz 
directly to me at dan@dankulp.com)

One more thing to try:   (this will only really work for 2.0.4)
In the package containing the EchoStruct class, add a package-info.java 
that contains something like:

@javax.xml.bind.annotation.XmlSchema(
	namespace = "yyy", 
        elementFormDefault=javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package yyy;


Dan


On Thursday 24 January 2008, Marco Piraccini wrote:
> Thank you Dan for your quick answer.
> I already tried with CXF-2.0.4 (RC) but the behaviour seems to be the
> same as the 2.0.3
> version.
>
> Marco.
>
> Quoting Daniel Kulp <dk...@apache.org>:
> > Any chance you could check with the 2.0.4 release candidates
> > available at:
> > http://people.apache.org/~dkulp/stage_cxf/2.0.4-incubator/
> >
> > There were definite issues with Exceptions not working correctly
> > with qualified schemas in 2.0.3.   They should (hopefully) be fixed
> > there.
> >
> > Dan
> >
> > On Thursday 24 January 2008, Marco Piraccini wrote:
> >> I need to expose a service (java-first) with CXF with an exception
> >> (EchoComplexException
> >> ) that includes an array of object (of class EchoStruct).
> >> The service is setted with: anonymousWrapperType,
> >> qualifyWrapperSchema ad wrapped to true.
> >>
> >> The wsdl generated seems to be correct, with a wrapper
> >> EchoComplexException of the type:
> >>
> >> <xs:complexType final="#all" name="echoStructArray">
> >> <xs:sequence>
> >> <xs:element maxOccurs="unbounded" minOccurs="0" name="item"
> >> nillable="true" type="tns:echoStruct"/>
> >> </xs:sequence>
> >> </xs:complexType>
> >>
> >> The problem is that, on object deserialization, the
> >> EchoComplexException is serialized in:
> >>
> >> <EchoComplexException xmlns="xxx">
> >> <ns2:reason xsi:type="echoStructArray" xmlns="yyy" xmlns:ns2="xxx"
> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> >> <item xmlns="" xmlns:ns4="yyy">
> >> <ns4:fieldBoolean>true</ns4:fieldBoolean>
> >> </item>
> >> </ns2:reason>
> >> </EchoComplexException>
> >>
> >> ...that's correct, except for the xmlns="" item namespace. Of
> >> course the schema validation fails.
> >>
> >> Anyone meet the same problem?
> >>
> >> Marco.
> >
> > --
> > J. Daniel Kulp
> > Principal Engineer, IONA
> > dkulp@apache.org
> > http://www.dankulp.com/blog



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: item element with xmlns=""

Posted by ja...@aurora.org.
I am having the same issue trying to return a Collection <String>.
I am using apache-cxf-2.0.4-incubator-SNAPSHOT with Aegis bindings.

<soap:Envelope 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:getCollectionTestResponse 
xmlns:ns1="http://beans.partner.aurora.org"><ns2:ArrayOfString 
xmlns:ns2=""><ns1:string/><ns1:string/><ns1:string/></ns2:ArrayOfString></ns1:getCollectionTestResponse></soap:Body></soap:Envelope>

Client throws this error:
Caused by: com.ctc.wstx.exc.WstxParsingException: Non-default namespace 
can not map to empty URI (as per Namespace 1.0 # 2) in XML 1.0 documents
        at [row,col {unknown-source}]: [1,187]
        at 
com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:605)
        at 
com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:461)
        at 
com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(BasicStreamReader.java:3052)
        at 
com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:2934)
        at 
com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2846)
        at 
com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
        at 
org.apache.cxf.staxutils.DepthXMLStreamReader.next(DepthXMLStreamReader.java:215)
        at 
org.apache.cxf.staxutils.StaxUtils.nextEvent(StaxUtils.java:132)
        ... 15 more

I am thinking the issues is the fact that the namespace is mssing in 
<ns2:ArrayOfString xmlns:ns2="">





Marco Piraccini <ma...@acm.org> 
01/24/2008 10:06 AM
Please respond to
cxf-user@incubator.apache.org


To
cxf-user@incubator.apache.org
cc

Subject
Re: item element with xmlns=""






Thank you Dan for your quick answer.
I already tried with CXF-2.0.4 (RC) but the behaviour seems to be the 
same as the 2.0.3
version.

Marco.


Quoting Daniel Kulp <dk...@apache.org>:

>
> Any chance you could check with the 2.0.4 release candidates available
> at:
> http://people.apache.org/~dkulp/stage_cxf/2.0.4-incubator/
>
> There were definite issues with Exceptions not working correctly with
> qualified schemas in 2.0.3.   They should (hopefully) be fixed there.
>
> Dan
>
>
> On Thursday 24 January 2008, Marco Piraccini wrote:
>> I need to expose a service (java-first) with CXF with an exception
>> (EchoComplexException
>> ) that includes an array of object (of class EchoStruct).
>> The service is setted with: anonymousWrapperType, qualifyWrapperSchema
>> ad wrapped to true.
>>
>> The wsdl generated seems to be correct, with a wrapper
>> EchoComplexException of the type:
>>
>> <xs:complexType final="#all" name="echoStructArray">
>> <xs:sequence>
>> <xs:element maxOccurs="unbounded" minOccurs="0" name="item"
>> nillable="true" type="tns:echoStruct"/>
>> </xs:sequence>
>> </xs:complexType>
>>
>> The problem is that, on object deserialization, the
>> EchoComplexException is serialized in:
>>
>> <EchoComplexException xmlns="xxx">
>> <ns2:reason xsi:type="echoStructArray" xmlns="yyy" xmlns:ns2="xxx"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>> <item xmlns="" xmlns:ns4="yyy">
>> <ns4:fieldBoolean>true</ns4:fieldBoolean>
>> </item>
>> </ns2:reason>
>> </EchoComplexException>
>>
>> ...that's correct, except for the xmlns="" item namespace. Of course
>> the schema validation fails.
>>
>> Anyone meet the same problem?
>>
>> Marco.
>
>
>
> --
> J. Daniel Kulp
> Principal Engineer, IONA
> dkulp@apache.org
> http://www.dankulp.com/blog
>





Re: item element with xmlns=""

Posted by Marco Piraccini <ma...@acm.org>.
Thank you Dan for your quick answer.
I already tried with CXF-2.0.4 (RC) but the behaviour seems to be the  
same as the 2.0.3
version.

Marco.


Quoting Daniel Kulp <dk...@apache.org>:

>
> Any chance you could check with the 2.0.4 release candidates available
> at:
> http://people.apache.org/~dkulp/stage_cxf/2.0.4-incubator/
>
> There were definite issues with Exceptions not working correctly with
> qualified schemas in 2.0.3.   They should (hopefully) be fixed there.
>
> Dan
>
>
> On Thursday 24 January 2008, Marco Piraccini wrote:
>> I need to expose a service (java-first) with CXF with an exception
>> (EchoComplexException
>> ) that includes an array of object (of class EchoStruct).
>> The service is setted with: anonymousWrapperType, qualifyWrapperSchema
>> ad wrapped to true.
>>
>> The wsdl generated seems to be correct, with a wrapper
>> EchoComplexException of the type:
>>
>> <xs:complexType final="#all" name="echoStructArray">
>> <xs:sequence>
>> <xs:element maxOccurs="unbounded" minOccurs="0" name="item"
>> nillable="true" type="tns:echoStruct"/>
>> </xs:sequence>
>> </xs:complexType>
>>
>> The problem is that, on object deserialization, the
>> EchoComplexException is serialized in:
>>
>> <EchoComplexException xmlns="xxx">
>> <ns2:reason xsi:type="echoStructArray" xmlns="yyy" xmlns:ns2="xxx"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>> <item xmlns="" xmlns:ns4="yyy">
>> <ns4:fieldBoolean>true</ns4:fieldBoolean>
>> </item>
>> </ns2:reason>
>> </EchoComplexException>
>>
>> ...that's correct, except for the xmlns="" item namespace. Of course
>> the schema validation fails.
>>
>> Anyone meet the same problem?
>>
>> Marco.
>
>
>
> --
> J. Daniel Kulp
> Principal Engineer, IONA
> dkulp@apache.org
> http://www.dankulp.com/blog
>




Re: item element with xmlns=""

Posted by Daniel Kulp <dk...@apache.org>.
Any chance you could check with the 2.0.4 release candidates available 
at:
http://people.apache.org/~dkulp/stage_cxf/2.0.4-incubator/

There were definite issues with Exceptions not working correctly with 
qualified schemas in 2.0.3.   They should (hopefully) be fixed there.

Dan


On Thursday 24 January 2008, Marco Piraccini wrote:
> I need to expose a service (java-first) with CXF with an exception
> (EchoComplexException
> ) that includes an array of object (of class EchoStruct).
> The service is setted with: anonymousWrapperType, qualifyWrapperSchema
> ad wrapped to true.
>
> The wsdl generated seems to be correct, with a wrapper
> EchoComplexException of the type:
>
> <xs:complexType final="#all" name="echoStructArray">
> <xs:sequence>
> <xs:element maxOccurs="unbounded" minOccurs="0" name="item"
> nillable="true" type="tns:echoStruct"/>
> </xs:sequence>
> </xs:complexType>
>
> The problem is that, on object deserialization, the
> EchoComplexException is serialized in:
>
> <EchoComplexException xmlns="xxx">
> <ns2:reason xsi:type="echoStructArray" xmlns="yyy" xmlns:ns2="xxx"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <item xmlns="" xmlns:ns4="yyy">
> <ns4:fieldBoolean>true</ns4:fieldBoolean>
> </item>
> </ns2:reason>
> </EchoComplexException>
>
> ...that's correct, except for the xmlns="" item namespace. Of course
> the schema validation fails.
>
> Anyone meet the same problem?
>
> Marco.



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog