You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by ga...@jpmorgan.com on 2004/05/04 22:23:03 UTC

Bean having an Arry of Beans in it


Hello,

i am trying to build axis client using WSDL2Java etc and in 1 call I am
returning a Bean1 which has an Array of Beans2 in it. This throws an
exception. Do I need to build using -W option etc .

the stack trace is

- Exception:
org.xml.sax.SAXException: Invalid element in
to.testaxisws.rx.jpmorgan.com.EmailTO - EmailTO
      at
org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:260)
      at
org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:963)
      at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198)
      at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:722)
      at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:323)
      at org.apache.axis.message.RPCElement.getParams(RPCElement.java:347)
      at org.apache.axis.client.Call.invoke(Call.java:2272)
      at org.apache.axis.client.Call.invoke(Call.java:2171)
      at org.apache.axis.client.Call.invoke(Call.java:1691)
      at
org.tempuri.TestAxisWSPortSoapBindingStub.getAddressWithEmails(TestAxisWSPortSoapBindingStub.java:209)
      at
com.jpmorgan.rx.testws.testclient.TestAxisWSClient.getAddressWithEmails(TestAxisWSClient.java:183)
      at
com.jpmorgan.rx.testws.testclient.TestAxisWSClient.main(TestAxisWSClient.java:227)
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: org.xml.sax.SAXException: Invalid element in
to.testaxisws.rx.jpmorgan.com.EmailTO - EmailTO
 faultActor:
 faultNode:
 faultDetail:
      {http://xml.apache.org/axis/}stackTrace: org.xml.sax.SAXException:
Invalid element in to.testaxisws.rx.jpmorgan.com.EmailTO - EmailTO
      at
org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:260)
      at
org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:963)
      at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198)
      at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:722)
      at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:323)
      at org.apache.axis.message.RPCElement.getParams(RPCElement.java:347)
      at org.apache.axis.client.Call.invoke(Call.java:2272)

The WSDL file looks like this

<?xml version="1.0" encoding="utf-8" ?>
    - <definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="
    http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="
    http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="
    http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="
    http://tempuri.org/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    targetNamespace="http://tempuri.org/" xmlns="
    http://schemas.xmlsoap.org/wsdl/">
      - <types>
        - <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:stns="java:com.jpmorgan.rx.testaxisws.to"
        attributeFormDefault="qualified" elementFormDefault="qualified"
        targetNamespace="java:com.jpmorgan.rx.testaxisws.to">
            <xsd:import namespace="
          http://schemas.xmlsoap.org/soap/encoding/" />
          - <xsd:complexType name="AddressTO">
            - <xsd:sequence>
                <xsd:element name="postalCode" maxOccurs="1" type="
              xsd:string" minOccurs="1" nillable="true" />
                <xsd:element name="address2" maxOccurs="1" type="xsd:string
              " minOccurs="1" nillable="true" />
                <xsd:element name="address1" maxOccurs="1" type="xsd:string
              " minOccurs="1" nillable="true" />
                <xsd:element name="country" maxOccurs="1" type="xsd:string"
              minOccurs="1" nillable="true" />
                <xsd:element name="emailTO" maxOccurs="1" type="
              stns:EmailTO" minOccurs="1" nillable="true" />
                <xsd:element name="city" maxOccurs="1" type="xsd:string"
              minOccurs="1" nillable="true" />
                <xsd:element name="rowID" maxOccurs="1" type="xsd:string"
              minOccurs="1" nillable="true" />
                <xsd:element name="emailArray" maxOccurs="1" type="
              stns:ArrayOfEmailTO" minOccurs="1" nillable="true" />
                <xsd:element name="stateOrProvince" maxOccurs="1" type="
              xsd:string" minOccurs="1" nillable="true" />
            </xsd:sequence>
          </xsd:complexType>
          - <xsd:complexType name="EmailTO">
            - <xsd:sequence>
                <xsd:element name="research" maxOccurs="1" type="
              xsd:boolean" minOccurs="1" />
                <xsd:element name="FType" maxOccurs="1" type="xsd:string"
              minOccurs="1" nillable="true" />
                <xsd:element name="emailType" maxOccurs="1" type="
              xsd:string" minOccurs="1" nillable="true" />
                <xsd:element name="emailAddress" maxOccurs="1" type="
              xsd:string" minOccurs="1" nillable="true" />
            </xsd:sequence>
          </xsd:complexType>
          - <xsd:complexType name="AddressTOWrapper">
            - <xsd:sequence>
                <xsd:element name="totalNumPages" maxOccurs="1" type="
              xsd:int" minOccurs="1" />
                <xsd:element name="addressTOList" maxOccurs="1" type="
              stns:ArrayOfAddressTO" minOccurs="1" nillable="true" />
            </xsd:sequence>
          </xsd:complexType>
          - <xsd:complexType name="ArrayOfEmailTO">
            - <xsd:complexContent>
              - <xsd:restriction xmlns:soapenc="
              http://schemas.xmlsoap.org/soap/encoding/" base="
              soapenc:Array">
                  <xsd:attribute xmlns:wsdl="
                http://schemas.xmlsoap.org/wsdl/" ref="soapenc:arrayType"
                wsdl:arrayType="stns:EmailTO[]" />
              </xsd:restriction>
            </xsd:complexContent>
          </xsd:complexType>
          - <xsd:complexType name="ArrayOfAddressTO">
            - <xsd:complexContent>
              - <xsd:restriction xmlns:soapenc="
              http://schemas.xmlsoap.org/soap/encoding/" base="
              soapenc:Array">
                  <xsd:attribute xmlns:wsdl="
                http://schemas.xmlsoap.org/wsdl/" ref="soapenc:arrayType"
                wsdl:arrayType="stns:AddressTO[]" />
              </xsd:restriction>
            </xsd:complexContent>
          </xsd:complexType>
        </xsd:schema>
      </types>
        <message name="getAddressWithEmails" />
      - <message name="getAddressWithEmailsResponse">
          <part name="result" xmlns:partns="
        java:com.jpmorgan.rx.testaxisws.to" type="partns:AddressTO" />
      </message>
        <message name="getAddressWrapperWithAddresses" />
      - <message name="getAddressWrapperWithAddressesResponse">
          <part name="result" xmlns:partns="
        java:com.jpmorgan.rx.testaxisws.to" type="partns:AddressTOWrapper"
        />
      </message>
        <message name="getDefaultEMail" />
      - <message name="getDefaultEMailResponse">
          <part name="result" xmlns:partns="
        java:com.jpmorgan.rx.testaxisws.to" type="partns:EmailTO" />
      </message>
        <message name="getDefaultAddress" />
      - <message name="getDefaultAddressResponse">
          <part name="result" xmlns:partns="
        java:com.jpmorgan.rx.testaxisws.to" type="partns:AddressTO" />
      </message>
        <message name="getAddressWrapper" />
      - <message name="getAddressWrapperResponse">
          <part name="result" xmlns:partns="
        java:com.jpmorgan.rx.testaxisws.to" type="partns:AddressTOWrapper"
        />
      </message>
      - <message name="getEmailArray">
          <part name="index" xmlns:partns="http://www.w3.org/2001/XMLSchema
        " type="partns:int" />
      </message>
      - <message name="getEmailArrayResponse">
          <part name="result" xmlns:partns="
        java:com.jpmorgan.rx.testaxisws.to" type="partns:ArrayOfEmailTO" />
      </message>
      - <portType name="TestAxisWSPort">
        - <operation name="getAddressWithEmails">
            <input message="tns:getAddressWithEmails" />
            <output message="tns:getAddressWithEmailsResponse" />
        </operation>
        - <operation name="getAddressWrapperWithAddresses">
            <input message="tns:getAddressWrapperWithAddresses" />
            <output message="tns:getAddressWrapperWithAddressesResponse" />
        </operation>
        - <operation name="getDefaultEMail">
            <input message="tns:getDefaultEMail" />
            <output message="tns:getDefaultEMailResponse" />
        </operation>
        - <operation name="getDefaultAddress">
            <input message="tns:getDefaultAddress" />
            <output message="tns:getDefaultAddressResponse" />
        </operation>
        - <operation name="getAddressWrapper">
            <input message="tns:getAddressWrapper" />
            <output message="tns:getAddressWrapperResponse" />
        </operation>
        - <operation name="getEmailArray">
            <input message="tns:getEmailArray" />
            <output message="tns:getEmailArrayResponse" />
        </operation>
      </portType>
      - <binding name="TestAxisWSPortSoapBinding" type="tns:TestAxisWSPort
      ">
          <soap:binding style="rpc" transport="
        http://schemas.xmlsoap.org/soap/http" />
        - <operation name="getAddressWithEmails">
            <soap:operation soapAction="" style="rpc" />
          - <input>
              <soap:body use="encoded" namespace="http://tempuri.org/"
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
          </input>
          - <output>
              <soap:body use="encoded" namespace="http://tempuri.org/"
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
          </output>
        </operation>
        - <operation name="getAddressWrapperWithAddresses">
            <soap:operation soapAction="" style="rpc" />
          - <input>
              <soap:body use="encoded" namespace="http://tempuri.org/"
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
          </input>
          - <output>
              <soap:body use="encoded" namespace="http://tempuri.org/"
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
          </output>
        </operation>
        - <operation name="getDefaultEMail">
            <soap:operation soapAction="" style="rpc" />
          - <input>
              <soap:body use="encoded" namespace="http://tempuri.org/"
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
          </input>
          - <output>
              <soap:body use="encoded" namespace="http://tempuri.org/"
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
          </output>
        </operation>
        - <operation name="getDefaultAddress">
            <soap:operation soapAction="" style="rpc" />
          - <input>
              <soap:body use="encoded" namespace="http://tempuri.org/"
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
          </input>
          - <output>
              <soap:body use="encoded" namespace="http://tempuri.org/"
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
          </output>
        </operation>
        - <operation name="getAddressWrapper">
            <soap:operation soapAction="" style="rpc" />
          - <input>
              <soap:body use="encoded" namespace="http://tempuri.org/"
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
          </input>
          - <output>
              <soap:body use="encoded" namespace="http://tempuri.org/"
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
          </output>
        </operation>
        - <operation name="getEmailArray">
            <soap:operation soapAction="" style="rpc" />
          - <input>
              <soap:body use="encoded" namespace="http://tempuri.org/"
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
          </input>
          - <output>
              <soap:body use="encoded" namespace="http://tempuri.org/"
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
          </output>
        </operation>
      </binding>
      - <service name="TestAxisWS">
          <documentation>todo: add your documentation here</documentation>
        - <port name="TestAxisWSPort" binding="
        tns:TestAxisWSPortSoapBinding">
            <soap:address location="
          http://localhost:11001/testaxisws/TestAxisWS" />
        </port>
      </service>
    </definitions>


===
Gary Grewal





This communication is for informational purposes only.  It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data 
and other information are not warranted as to completeness or accuracy and 
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan Chase & Co., its
subsidiaries and affiliates.