Hey all:

I am trying to figure out my other problems, and I ran into this:

org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement Body
        at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
        at vivisimo.ServiceStub.fromOM(ServiceStub.java:2346)
        at vivisimo.ServiceStub.Simple(ServiceStub.java:194)
        at Main.main(Main.java:24)
Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement Body
        at vivisimo.ServiceStub$Tree$Factory.parse(ServiceStub.java:878)
        at vivisimo.ServiceStub.fromOM(ServiceStub.java:2340)
        ... 2 more
Caused by: org.apache.axis2.databinding.ADBException: Unexpected subelement Body
        at vivisimo.ServiceStub$Tree$Factory.parse(ServiceStub.java:864)
        ... 3 more

I have narrowed down my schema, WSDL, and java file to the attached.

I have 2 nodes, <tree> and <node>. Tree has exactly one <node> child, and <node> can have 0-unbounded <node> children. I think the schema is correctly specifying this.

However it looks like axis incorrectly exits out of the node, and then reports that the *containing* element is an "unexpected subelement".

Boiled down, my example says:

soap:body
  tree
    node

Any help on this would be great. Thanks!

-Jake
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
	       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
	       xmlns:xsd="http://www.w3.org/2001/XMLSchema";
	       >
  <soap:Body>
    <tree xmlns="urn:/vivisimo/velocity">
      <node>
	<node>
	  <description>Diary</description>
	</node>
      </node>
    </tree>
  </soap:Body>
</soap:Envelope>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<definitions xmlns:tns="urn:/vivisimo"
	     xmlns:types="urn:/vivisimo/types"
	     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
	     xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/";
	     xmlns="http://schemas.xmlsoap.org/wsdl/"; name="Simple"
	     targetNamespace="urn:/vivisimo"
	     >
  <types>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns="urn:/vivisimo/types" elementFormDefault="qualified" targetNamespace="urn:/vivisimo/types" >

      <xs:element name="Simple">
	<xs:complexType>
	  <xs:sequence>
	    <xs:element minOccurs="0" maxOccurs="1" name="query" type="xs:string" />
	  </xs:sequence>
	</xs:complexType>
      </xs:element>

      <xs:element name="tree">
	<xs:complexType>
	  <xs:sequence>
	    <xs:element minOccurs="1" maxOccurs="1" ref="node" />
	  </xs:sequence>
	</xs:complexType>
      </xs:element>

      <xs:element name="node">
	<xs:complexType>
	  <xs:sequence>
	    <xs:element minOccurs="0" maxOccurs="unbounded" ref="node" />
	  </xs:sequence>
	</xs:complexType>
      </xs:element>

    </xs:schema>
  </types>

  <message name="Simple">
    <part name="parameters" element="types:Simple" />
  </message>
  <message name="SimpleResponse">
    <part name="tree" element="types:tree" />
  </message>

  <portType name="Port">
    <operation name="Simple">
      <input message="tns:Simple" />
      <output message="tns:SimpleResponse" />
    </operation>
  </portType>

  <binding name="Binding12" type="tns:Port" >
    <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"; />
    <operation name="Simple">
      <soap12:operation soapAction="simple" />
      <input>
	<soap12:body use="literal" />
      </input>
      <output>
	<soap12:body use="literal" />
      </output>
    </operation>
  </binding>

  <service name="Service">
    <documentation />
    <port name="Port12" binding="tns:Binding12" >
      <soap12:address location="http://127.0.0.1/soap/soap.xml"; />
    </port>
  </service>

</definitions>
import javax.xml.namespace.*;
import org.apache.axiom.om.*;
import org.apache.axis2.*;
import org.apache.axis2.transport.http.*;
import org.apache.axis2.databinding.types.*;
import vivisimo.*;

class Main {

    public static void main(String []args) throws Exception {

        try {

            ServiceStub q;
            q = new ServiceStub();
            q._getServiceClient().getOptions().setProperty(HTTPConstants.CHUNKED, false); 

            ServiceStub.Simple qs;
            qs = new ServiceStub.Simple();

            qs.setQuery("hello world");

            ServiceStub.Tree qr;
            qr = q.Simple(qs);

        } catch (AxisFault af) {
            System.out.println("An error occurred: [" + af.getFaultCode() + "]");
            System.out.println(af.getDetail());
            af.printStackTrace();
        }
    }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to