axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olivier Lamiral (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (AXIS2-3252) Unexpected subelement
Date Thu, 29 Nov 2007 13:58:43 GMT

    [ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546721
] 

olivierll edited comment on AXIS2-3252 at 11/29/07 5:57 AM:
------------------------------------------------------------------

I am getting an Unexpected subelement exception too when the response is parsed by the generated
stub. I used the eclipse plugin to generate the client (WSDL2Java). 

The error occured at the following line (line 1601, in EnviaSolicitacaoNumeroV1Stub):

    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
-->        if (reader.isStartElement() 
-->                                && new javax.xml.namespace.QName("","auditoria").equals(reader.getName())){
            object.setAuditoria(Auditoria.Factory.parse(reader));
            reader.next();

Debugging the code, reader.getName() evaluates to something like namespaceURI = "br/com/indra/..../Auditoria"
and localName = "auditoria". As reader.getName() and the newly created QName are different,
the flow is redirected to the else section of the code, where the unexpected element exception
is thrown.

You may notice that in the response, the auditoria element contains the aud prefix (<aud:auditoria
...).
If the prefix is removed, this element is parsed correctly.

Another point is that I am not sure if the response is compliant with the definition contained
in the wsdl.

WSDL, source code and server response are attached.

Hope it helps, and let me know if you need more info.

Thank you in advance.

(I am using Axis2-1.3)

      was (Author: olivierll):
    I am getting an Unexpected subelement exception too when the response is parsed by the
generated stub. I used the eclipse plugin to generate the client (WSDL2Java). 

The error occured at the following line (line 1601, in EnviaSolicitacaoNumeroV1Stub):

    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
-->        if (reader.isStartElement() 
-->                                && new javax.xml.namespace.QName("","auditoria").equals(reader.getName())){
            object.setAuditoria(Auditoria.Factory.parse(reader));
            reader.next();

Debugging the code, reader.getName() evaluates to something like namespaceURI = "br/com/indra/..../Auditoria"
and localName = "auditoria". As reader.getName() and the newly created QName are different,
the flow is redirected to the else section of the code, where the unexpected element exception
is thrown.

You may notice that in the response, the auditoria element contains the aud prefix (<aud:auditoria
...).
If the prefix is removed, this element is parsed correctly.

Another point is that I am not sure if the response is compliant with the definition contained
in the wsdl.

WSDL, source code and server response are attached.

Hope it helps, and let me know if you need more info.

Thank you in advance.

(I am using Axis2-1.3, and debugged using Axis2-SNAPSHOT)
  
> Unexpected subelement 
> ----------------------
>
>                 Key: AXIS2-3252
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3252
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>    Affects Versions: 1.2
>            Reporter: adam
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>         Attachments: classes.rar, src.zip, the classes.rar
>
>
> Hi, 
> I try to make web service with eclipse and axis2 .. and i recieve the following exception
and i don't know what is the casue : 
> Exception *****************: 
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected
subelement medicineId
> 	at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> 	at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> 	at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> 	at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> 	at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> 	at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> 	... 2 more
> The class that i make from it the web service is : "MainClassForWS"  
> and my client test is : "WSClient" 
> All the class relative to this exception in the attachment file 
> i need to know from where this exception come and what causes it and what is the solution
for it .
> Thanks.
> M.adam

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message