You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Andreas Hörnicke <an...@gmx.info> on 2006/03/30 15:15:53 UTC

Re[2]: [axis2] 0.94 Array only deserializes 1 element of complex type

I already did. But either i get an Exception 'Wrong Qname' when
trying to access the WS with PHP or one with 'illegal state,
mixed content' when using .NET :/

Gruß Andi


am Donnerstag, 30. März 2006 schrieb Ajith Ranabahu:

AR> Hmm.. This seems like a bug in de-ser code of the ADB template.
AR> However I suggest you do a test with the latest 0.95 release before
AR> filing a Jira

AR> Ajith

AR> On 3/30/06, Andreas Hörnicke <an...@gmx.info> wrote:
>> Hi,
>>
>> im having a hard time while migrating from Axis 1.3 to 2. After
>> struggling with some minor difficulties i came up with this one.
>>
>> Recieving a request with generated Adb-Code from the following
>> Wsdl-portion i get only one element of Type01 instead of 20
>> (which where serialized and definitely are in the envelope).
>>
>> I already searched through jira, but with no big success. Any
>> ideas?
>>
>> ------------------------------
>> <complexType name="Type01">
>>   <all>
>>     <element name="id01"     type="xsd:int"/>
>>     <element name="id02"     type="xsd:int"/>
>>     <element name="id03"      type="xsd:string"/>
>>   </all>
>> </complexType>
>>
>> <complexType name="Type01Array">
>>   <sequence>
>>     <element minOccurs="0" maxOccurs="unbounded"
>> name="type01Arr" type="typens:Type01"/>
>>   </sequence>
>> </complexType>
>>
>> <complexType name="Request01">
>>   <all>
>>     <element name="param01"    type="xsd:string" />
>>     <element name="param02"    type="typens:Type01Array" minOccurs="0" />
>>   </all>
>> </complexType>
>>
>> <element name="GetRequest01"   type="typens:Request01" />
>> ------------------------------
>>
>> - Andreas
>>
>>


AR> --
AR> Ajith Ranabahu


Re[4]: [axis2] 0.94 Array only deserializes 1 element of complex type

Posted by Andreas Hörnicke <an...@gmx.info>.
AR> The mixed content exception is thrown when the deser
AR> mechanism encounters mixed text content. Mixed content is not
AR> supported by ADB. However I'm not sure whether having line
AR> breaks inside text content makes the deserializer wrongfully
AR> understand the things as mixed content (i've been told about
AR> something like that but I've not verified it yet)

This SOAP-Body:
---------
<GetLoginRequest xmlns="http://user.service/beans"><pageId xmlns="">1234</pageId><hash xmlns="">hi there</hash></GetLoginRequest>
---------

results in this Exception:

---------
Caused by: java.lang.RuntimeException: Illegal state!Mixed Content 1234
    at org.apache.axis2.databinding.utils.SimpleElementReaderStateMachine.read(SimpleElementReaderStateMachine.java:104)
---------

responsible code:
---------
if (reader.getText().trim().length()==0){
    //the text is empty - don't change the state
}else{
    //we do NOT handle mixed content
    currentState = ILLEGAL_STATE;
    errorMessage = "Mixed Content " +reader.getText();  //todo I18n this
}
---------

- Andreas


AR> Ajith

AR> On 3/30/06, Andreas Hörnicke <an...@gmx.info> wrote:
>>
>> I already did. But either i get an Exception 'Wrong Qname' when
>> trying to access the WS with PHP or one with 'illegal state,
>> mixed content' when using .NET :/
>>
>> Gruß Andi
>>
>>
>> am Donnerstag, 30. März 2006 schrieb Ajith Ranabahu:
>>
>> AR> Hmm.. This seems like a bug in de-ser code of the ADB template.
>> AR> However I suggest you do a test with the latest 0.95 release before
>> AR> filing a Jira
>>
>> AR> Ajith
>>
>> AR> On 3/30/06, Andreas Hörnicke <an...@gmx.info> wrote:
>> >> Hi,
>> >>
>> >> im having a hard time while migrating from Axis 1.3 to 2. After
>> >> struggling with some minor difficulties i came up with this one.
>> >>
>> >> Recieving a request with generated Adb-Code from the following
>> >> Wsdl-portion i get only one element of Type01 instead of 20
>> >> (which where serialized and definitely are in the envelope).
>> >>
>> >> I already searched through jira, but with no big success. Any
>> >> ideas?
>> >>
>> >> ------------------------------
>> >> <complexType name="Type01">
>> >>   <all>
>> >>     <element name="id01"     type="xsd:int"/>
>> >>     <element name="id02"     type="xsd:int"/>
>> >>     <element name="id03"      type="xsd:string"/>
>> >>   </all>
>> >> </complexType>
>> >>
>> >> <complexType name="Type01Array">
>> >>   <sequence>
>> >>     <element minOccurs="0" maxOccurs="unbounded"
>> >> name="type01Arr" type="typens:Type01"/>
>> >>   </sequence>
>> >> </complexType>
>> >>
>> >> <complexType name="Request01">
>> >>   <all>
>> >>     <element name="param01"    type="xsd:string" />
>> >>     <element name="param02"   
>> type="typens:Type01Array" minOccurs="0" />
>> >>   </all>
>> >> </complexType>
>> >>
>> >> <element name="GetRequest01"   type="typens:Request01" />
>> >> ------------------------------
>> >>
>> >> - Andreas
>> >>
>> >>
>>
>>
>> AR> --
>> AR> Ajith Ranabahu
>>
>>


AR> --
AR> Ajith Ranabahu


Re: Re[2]: [axis2] 0.94 Array only deserializes 1 element of complex type

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi,
The "Wrong Qname" exception is thrown when the ADB de-ser is presented
with a QName that is not the right one to start with. The most
frequent cause of this exception is the presence of a wrong namespace
(wrong w.r.t the Namespace represented in the schema)
So please use a tracer tool (we recommend TCPmon :)) and check whether
the QNames of the elements are correct.
The mixed content exception is thrown when the deser mechanism
encounters mixed text content. Mixed content is not supported by ADB.
However I'm not sure whether having line breaks inside text content
makes the deserializer wrongfully understand the things as mixed
content (i've been told about something like that but I've not
verified it yet)

Ajith

On 3/30/06, Andreas Hörnicke <an...@gmx.info> wrote:
>
> I already did. But either i get an Exception 'Wrong Qname' when
> trying to access the WS with PHP or one with 'illegal state,
> mixed content' when using .NET :/
>
> Gruß Andi
>
>
> am Donnerstag, 30. März 2006 schrieb Ajith Ranabahu:
>
> AR> Hmm.. This seems like a bug in de-ser code of the ADB template.
> AR> However I suggest you do a test with the latest 0.95 release before
> AR> filing a Jira
>
> AR> Ajith
>
> AR> On 3/30/06, Andreas Hörnicke <an...@gmx.info> wrote:
> >> Hi,
> >>
> >> im having a hard time while migrating from Axis 1.3 to 2. After
> >> struggling with some minor difficulties i came up with this one.
> >>
> >> Recieving a request with generated Adb-Code from the following
> >> Wsdl-portion i get only one element of Type01 instead of 20
> >> (which where serialized and definitely are in the envelope).
> >>
> >> I already searched through jira, but with no big success. Any
> >> ideas?
> >>
> >> ------------------------------
> >> <complexType name="Type01">
> >>   <all>
> >>     <element name="id01"     type="xsd:int"/>
> >>     <element name="id02"     type="xsd:int"/>
> >>     <element name="id03"      type="xsd:string"/>
> >>   </all>
> >> </complexType>
> >>
> >> <complexType name="Type01Array">
> >>   <sequence>
> >>     <element minOccurs="0" maxOccurs="unbounded"
> >> name="type01Arr" type="typens:Type01"/>
> >>   </sequence>
> >> </complexType>
> >>
> >> <complexType name="Request01">
> >>   <all>
> >>     <element name="param01"    type="xsd:string" />
> >>     <element name="param02"    type="typens:Type01Array" minOccurs="0" />
> >>   </all>
> >> </complexType>
> >>
> >> <element name="GetRequest01"   type="typens:Request01" />
> >> ------------------------------
> >>
> >> - Andreas
> >>
> >>
>
>
> AR> --
> AR> Ajith Ranabahu
>
>


--
Ajith Ranabahu