[ 
https://issues.apache.org/jira/browse/CXF-5254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13783857#comment-13783857
 ] 

Grzegorz Grzybek commented on CXF-5254:
---------------------------------------

Hello

Tomorrow I'll post the patch (or pull request for Git). But now (oh these 
timezones...) some observations:
* IDL/Corba Arrays are the same as Sequences (correct me). In WSDL/XSD and 
while creating corba binding, arrays are sequences that have 
maxOccurs==minOccurs and both are greater than one
* so the "wrapping" should be handled for both arrays and sequences
* sequences and arrays may be named or anonymous. So we have problems designing 
class hierarchy - anon/named and sequence/struct - this is ugly in 
{{/rt/bindings/corba/src/main/resources/schemas/wsdl/corba-binding.xsd}}
* I have prepared interesting type for tests (it covers all 8 combinations):
{code:xml}
<complexType name="MixedArray">
    <sequence>
        <!-- unwrapped sequence -->
        <element maxOccurs="unbounded" minOccurs="0" name="array1"
                type="string"/>
        <!-- wrapped sequence -->
        <element maxOccurs="1" minOccurs="1" name="array2"
                type="x1:UnboundedArray"/>
        <!-- unwrapped array -->
        <element maxOccurs="3" minOccurs="3" name="array3"
                type="string"/>
        <!-- wrapped array -->
        <element maxOccurs="1" minOccurs="1" name="array4"
                type="x1:FixedArray"/>
        <!-- anonymous unwrapped sequence -->
        <element maxOccurs="unbounded" minOccurs="0" name="array5">
            <simpleType>
                <xsd:restriction base="string" />
            </simpleType>
        </element>
        <!-- anonymous wrapped sequence -->
        <element maxOccurs="1" minOccurs="1" name="array6">
            <complexType>
                <sequence>
                    <element maxOccurs="unbounded" minOccurs="0" name="item"
                        type="string"/>
                </sequence>
            </complexType>
        </element>
        <!-- anonymous unwrapped array -->
        <element maxOccurs="3" minOccurs="3" name="array7">
            <simpleType>
                <xsd:restriction base="string" />
            </simpleType>
        </element>
        <!-- anonymous wrapped array -->
        <element maxOccurs="1" minOccurs="1" name="array8">
            <complexType>
                <sequence>
                    <element maxOccurs="3" minOccurs="3" name="item"
                        type="int"/>
                </sequence>
            </complexType>
        </element>
    </sequence>
</complexType>
{code}
* the _special_ case in 
{{/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaStructEventProducer.java}}
 should not be controlled by the _primitiveness_ of sequence elements, but 
rather by your "wrapped" flag - correct me if I'm wrong
* there were some problems with {{CorbaStructListener}} so the patch contains 
some changes
* there were problems with finding corba types for anonymous XSD types, so the 
patch contains changes in {{WSDLToCorbaHelper}}

regards
Grzegorz Grzybek

> Unmarshall exception if a sequence<string> is used in a struct.
> ---------------------------------------------------------------
>
>                 Key: CXF-5254
>                 URL: https://issues.apache.org/jira/browse/CXF-5254
>             Project: CXF
>          Issue Type: Bug
>          Components: CORBA Binding
>    Affects Versions: 2.7.5, 2.7.6
>         Environment: JAVA7 / Windows 7
>            Reporter: Juergen Bockhorn
>            Priority: Blocker
>         Attachments: CorbaBugRepro.zip, patch.txt
>
>
> A server function returns a struct. This struct contains another struct which 
> contains a sequence<string>. Calling this method with a CXF/Corba-Client 
> leads to an unmarshall exception:
> {code}
> Warnung: Interceptor for 
> {http://cxf.apache.org/bindings/corba/idl/repro}repro.ServiceCORBAService#{http://cxf.apache.org/bindings/corba/idl/repro}getFirst
>  has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Unmarshalling Error: unerwartetes Element 
> (URI:"", lokal:"item"). Erwartete Elemente sind 
> <{http://cxf.apache.org/bindings/corba/idl/repro}id>,<{http://cxf.apache.org/bindings/corba/idl/repro}s1>
>  
>       at 
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:808)
>       at 
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:629)
>       at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:157)
>       at 
> org.apache.cxf.interceptor.BareInInterceptor.handleMessage(BareInInterceptor.java:138)
> ...
> {code}
> (sorry for german).
> Using a pure CORBA-client works.
> I will attach a repro project to this issue if I have figured out how it 
> works :-)



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to