Hey all:

I keep getting this error:

org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement node
        at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at vivisimo.VivisimoVelocityQueryServiceStub.fromOM(VivisimoVelocityQueryServiceStub.java:5494) at vivisimo.VivisimoVelocityQueryServiceStub.Simple(VivisimoVelocityQueryServiceStub.java:194)
        at Main.main(Main.java:24)
Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement node at vivisimo.VivisimoVelocityQueryServiceStub$Vce$Factory.parse(VivisimoVelocityQueryServiceStub.java:2092) at vivisimo.VivisimoVelocityQueryServiceStub.fromOM(VivisimoVelocityQueryServiceStub.java:5488)
        ... 2 more
Caused by: org.apache.axis2.databinding.ADBException: Unexpected subelement node at vivisimo.VivisimoVelocityQueryServiceStub$Vce$Factory.parse(VivisimoVelocityQueryServiceStub.java:2086)


However, I took the schema from my WSDL and the XML returned over the wire, ran them through the W3 XML Validator [1], and it passed.

I added some extra prints to the generated code, and can see the following code path:

parsing a Vce
parsing a VceChoice
parsing a Tree_type0
parsing a Node_type0
parsing a NodeChoice
parsing a Node_type0
parsing a NodeChoice
parsing a Description

Which seems that it gets to vce/tree/node/node[1], but doesn't correctly see that vce/tree/node/node[2] should be in the array.

I have attached the WSDL, the SOAP response, a small test program, and a Wireshark dump of the traffic.

Any advice would be highly appreciated!

-Jake

[1] http://www.w3.org/2001/03/webdata/xsv
<?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>
    <vce xmlns="urn:/vivisimo/velocity">
      <tree>
	<node>
	  <node>
	    <description>Diary</description>
	  </node>
	  <node>
	    <description>Film</description>
	  </node>
	  <node>
	    <description>Interview, Asia</description>
	  </node>
	  <node>
	    <description>Transcript, YouTube</description>
	  </node>
	  <node>
	    <description>Snippet</description>
	  </node>
	  <node>
	    <description>Reporters</description>
	  </node>
	  <node>
	    <description>Pop forum</description>
	  </node>
	  <node>
	    <description>Reports</description>
	  </node>
	  <node>
	    <description>Student</description>
	  </node>
	  <node>
	    <description>Order, Oil</description>
	  </node>
	  <node />
	</node>
      </tree>
    </vce>
  </soap:Body>
</soap:Envelope>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<definitions xmlns:tns="urn:/vivisimo/velocity/query"
	     xmlns:types="urn:/vivisimo/velocity/query/types"
	     xmlns:sectypes="urn:/vivisimo/velocity/soap/security/types"
	     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
	     xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/";
	     xmlns="http://schemas.xmlsoap.org/wsdl/";
	     name="VivisimoVelocityQuery"
	     targetNamespace="urn:/vivisimo/velocity/query"
	     >
  <types>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
	       xmlns="urn:/vivisimo/velocity"
	       elementFormDefault="qualified"
	       targetNamespace="urn:/vivisimo/velocity"
	       >
      <xs:element name="vce">
	<xs:complexType>
	  <xs:sequence>
	    <xs:element minOccurs="0" maxOccurs="1" ref="tree" />
	  </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:choice minOccurs="0" maxOccurs="unbounded">
	    <xs:element minOccurs="0" maxOccurs="1" ref="description" />
	    <xs:element minOccurs="0" maxOccurs="unbounded" ref="node" />
	  </xs:choice>
	</xs:complexType>
      </xs:element>
      
      <xs:element name="description">
	<xs:complexType mixed="true" />
      </xs:element>
      
    </xs:schema>
    
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
	       xmlns="urn:/vivisimo/velocity/query/types" 
	       elementFormDefault="qualified"
	       targetNamespace="urn:/vivisimo/velocity/query/types"
	       >
      <xs:element name="Simple">
	<xs:complexType>
	  <xs:sequence>
	    <xs:element name="query" minOccurs="0" maxOccurs="1" type="xs:string" />
	  </xs:sequence>
	</xs:complexType>
      </xs:element>
    </xs:schema>
  </types>

  <message name="Simple">
    <part name="parameters" element="types:Simple" />
  </message>
  <message xmlns:ns1="urn:/vivisimo/velocity" name="SimpleResponse">
    <part name="vce" element="ns1:vce" />
  </message>

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

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

  <service name="VivisimoVelocityQueryService">
    <documentation />
    <port name="VivisimoVelocityQueryPort12" binding="tns:VivisimoVelocityQueryBinding12" >
      <soap12:address location="http://127.0.0.1/soap/soap.soapxml"; />
    </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 {

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

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

            qs.setQuery("hello world");

            VivisimoVelocityQueryServiceStub.Vce qr;
            qr = q.Simple(qs);

        } catch (AxisFault af) {
            System.out.println("An error occurred: [" + af.getFaultCode() + "]");
            System.out.println(af.getDetail());
            af.printStackTrace();
        }
    }
}

Attachment: bad-parsing.pcap
Description: Binary data

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to