This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Web Services and the fly likes Unexpected subelement, Axis ADB Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Web Services
Bookmark "Unexpected subelement, Axis ADB Error" Watch "Unexpected subelement, Axis ADB Error" New topic

Unexpected subelement, Axis ADB Error

Chris Stabler

Joined: Oct 22, 2009
Posts: 13
I have a problem with Axis 2 that I have been unable to resolve.

I am using Eclipse Galileo, Apache/Tomcat 6.0, Mac OSX 10.6.2, and deploying the web service as Axis 2.

Basically I have a java file with a simple set of functions that i want to make a web service out of.

I create a dynamic web project in eclipse, create a java package, then create the java class file. then i do Web Service->Create Web Service and select bottom down web service. Then i export the project out as a .WAR file.

I then move the WAR file into my webapps folder in my apache/tomcat directory and start up the server. I can access the wsdl in a brower(and i am able to look at the wsdl in XML format which is expected).

As a side note, when i try to run the non-web service functionality as a standalone everything works fine.

Anyway, i create a Web Service Client now based on the wsdl that is in the WAR file which creates for me a Server Stub. Then i create a java main class file.

//generic piece of code that i perform in main class.

all my types are complex types that i want to return, Arrays, etc etc.

anyway i get the following error:

Exception in thread "main" org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement description
at org.apache.axis2.AxisFault.makeFault(
at com.server.DssServerStub.fromOM(
at com.server.DssServerStub.getScenariosForEngine(
at com.client.Dss5Client.main(
Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement description
at com.server.DssServerStub$InputParameter$Factory.parse(
at com.server.DssServerStub$ScenarioInfo$Factory.parse(
at com.server.DssServerStub$GetScenariosForEngineResponse$Factory.parse(
at com.server.DssServerStub.fromOM(
... 2 more
Caused by: org.apache.axis2.databinding.ADBException: Unexpected subelement description
at com.server.DssServerStub$InputParameter$Factory.parse(
... 5 more

I can post the WSDL XML output i suppose but wanted to get any idea of what causes this error. How can i not get any compile errors or run time errors and then somehow it doesnt know what an element is when i deploy the service? Is there something going on with Axis2 and ADB with Eclipse? I read people suggesting to use XMLBeans but i am unfamiliar with it. Let me know your thoughts and any help is appreciated. THANKS!
shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
The request envelope which you are creating at run time is having some sub element which doesn't match with the wsdl schema. Post your wsdl and you request envelope for further help.

SCJP 1.5(97%) My Blog
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Unexpected subelement, Axis ADB Error
It's not a secret anymore!