axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b_tho <>
Subject Re: Unexpected subelement
Date Fri, 15 Jun 2007 23:22:37 GMT


I get the "java.lang.RuntimeException: Unexpected subelement" problem too.
Here is my situation.

I have a simple pojo (a transfer object) which is
'com...transferobject.AttachmentDetail'. I have my service class which is
'com...webservices.AttachmentService'. In the service class, I have a
service method declared  as:

   public AttachmentDetail getAttachmentDetail(long attachmentId) {..}

Problem 1: When I deployed my services, the auto generated wsdl put
AttachmentDetail with '' namespace. 

Next I generated client classes with adb databinding option. 

Then I ran a test using the client classes and checked the response coming
from the getAttachmentDetail using soap monitor. The response xml puts
AttachmentDetail in '' namespace.

I kind of figured the difference in the name spaces is causing the
unexpected subelement error on the client.

I am doing something wrong? 

I tried to edit the generated wsdl to make target namespace for
AttachmentDetail type as 'http://webservices....'. This produced unexpected
compilation errors in the generated client classes. 

Problem 2: The autogenerated wsdl puts 'xs:sequence' tags around the
attributes in the AttachmentDetail class. The xml seen through the soap
monitor unfortunately does not have the attributes in the same sequence.
This again causes the same error. I got around this by editing the wsdl to
use xs:all instead. That seems to have solved that problem.

Is there a way I can avoid editing the wsdl? Is there a way I can have xml
generated in sequence or make wsdl use xs:all?

I am newbie and cant find a solution. I would appreciate if anybody can
help. I am just trying to get pojos transferred back and forth to the
client. If anybody has a good other way please let me know.

Thank you!


Anne Thomas Manes wrote:
> If you know the message structure that the device returns, I suggest
> you modify the WSDL so that it describes the expected result message.
> Anne
> On 5/16/07, Bernhard Breinbauer <> wrote:
>> Hi!
>> I'm having a similar problem as described in the thread: working in .NET,
>> but "Unexpected subelement return" when I try to run as axis2 client
>> My scenario:
>> I have to use a webservice on a proprietary embedded device, therefore i
>> can't
>> change it. Unfortunately the response messages are not composed as
>> described
>> in the wsdl file. One response type in the wsdl has a base type which
>> contains index and name values. The problem ist that the webservice
>> appends
>> them to the end of of the response message instead of to the front.
>> Therefore
>> the sequence of values gets mixed up.
>> My axis2 client bails out when parsing this response message with
>> an "Unexpected subelement" error.
>> I know it is not axis2's fault, but is there a possibility to work around
>> this
>> bug? As mentioned above it is not possible to change the webservice
>> implementation and I don't fancy the option to change the wsdl very much.
>> So does someone has an tip, advice,...?
>> best regards,
>> bernhard
>> PS: I almost forgot: This bug is related to the above mentioned thread
>> because
>> a .Net based client is working. Apparently the .net implementation is
>> more
>> tolerant in this case. (May be a bug in .net :-)
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View this message in context:
Sent from the Axis - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message