ADBException: Unexpected subelement

"Unexpected subelement" means the message received by the receiver contained an XML element that the receiver wasn't expecting. "{schemaTargetNs}message" is the name of the unexpected element that it encountered. In other words, the sender sent an invalid message to the receiver.

  • The sender may have included an element which it wasn't supposed to.
  • The sender may have left out a mandatory element.
  • The sender may have put the elements in the wrong order.
  • The sender may have sent a completely incorrect message.

If the server issued the exception that you reported, then the client sent an invalid message to the server. If the client issued the exception, then the error was in the response from the server to the client.


if the xsd(wsdl) is correct with xml request o response is because the problem is the order of xml elements. One posible solution is generate your axis2 client with -Eosv option. that work for me.


The code generated by CodeGen (from WSDL) for the Java Object (bean) that I was using, expected a different namespace for the fields in the bean. Somehow an incorrect namespace was present in the code generated by Axis. I fixed the namespace to reflect what it should have been and everything worked fine. I can see people still answering this question so thought I would re-post my solution here (have already posted this in response to Kenster's solution). As none of the solutions posted before me finding the solution worked, I did not accept any answer.