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 Sridhar Kotagiri <sr...@mphasis.com> on 2003/10/17 22:46:28 UTC

Unable to Deserialize complex object

Hi,
    I am new to web services concept.I need to invoke a web service .The  WSDL is developed using  weblogic..I am using  apache axis to generate the client side stubs.I have been receiving a SAXException I think it is unable to Deserialize the response object.

1)Previously the response object used to return an array of MyContcat
MyContcatTo
  {
        String lastName
         String link;
  }
Here I didn't have any problem.My code was working fine.
2)Now array of MyContact is wrapped in MyContactWrapper object and the model of MyContact is changed

       1)MyContactWrapper{
                  MyContact[] temp;
                  String errorMsg;
              }
       2)MyContact{
               String lastName;
               RxClientData link
          }
     3)RxClientData{
            String[] nameList;
            String valueList;
            String url;
         }


- <xsd:complexType name="MyContactTOWrapper">
- <xsd:sequence>
      <xsd:element name="myContacts" maxOccurs="1" type="stns:ArrayOfMyContactTO" minOccurs="1" nillable="true" />
      <xsd:element name="itemNumber" maxOccurs="1" type="xsd:long" minOccurs="1" />
    <xsd:element name="requestId" maxOccurs="1" type="xsd:string" minOccurs="1" nillable="true" />
      <xsd:element name="totalItems" maxOccurs="1" type="xsd:long" minOccurs="1" />
</xsd:sequence>
</xsd:complexType>


<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema <http://www.w3.org/2001/XMLSchema> " xmlns:stns="java:com.jpmorgan.rx.service.to" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="java:com.jpmorgan.rx.service.to">
  <xsd:import namespace="java:language_builtins.lang" />
  <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/ <http://schemas.xmlsoap.org/soap/encoding/> " />
- <xsd:complexType name="MyContactTO">
-      <xsd:sequence>
           <xsd:element name="rowId" maxOccurs="1" type="xsd:string" minOccurs="1" nillable="true" />
           <xsd:element name="viewPortfolioLink" maxOccurs="1" type="stns:RxClientData" minOccurs="1" nillable="true" />
      <xsd:element name="nameLink" maxOccurs="1" type="stns:RxClientData" minOccurs="1" nillable="true" />
           <xsd:element name="workPhone" maxOccurs="1" type="xsd:string" minOccurs="1" nillable="true" />
          <xsd:element name="email" maxOccurs="1" type="xsd:string" minOccurs="1" nillable="true" />
         <xsd:element name="addLink" maxOccurs="1" type="stns:RxClientData" minOccurs="1" nillable="true" />
         <xsd:element name="firstName" maxOccurs="1" type="xsd:string" minOccurs="1" nillable="true" />
          <xsd:element name="lastName" maxOccurs="1" type="xsd:string" minOccurs="1" nillable="true" />
  </xsd:sequence>
</xsd:complexType>


- <xsd:complexType name="RxClientData">
- <xsd:sequence>
          <xsd:element xmlns:tp="java:language_builtins.lang" name="valueList" maxOccurs="1" type="tp:ArrayOfString" minOccurs="1" nillable="true" />
          <xsd:element name="clientUrl" maxOccurs="1" type="xsd:string" minOccurs="1" nillable="true" />
         <xsd:element xmlns:tp="java:language_builtins.lang" name="nameList" maxOccurs="1" type="tp:ArrayOfString" minOccurs="1" nillable="true" />
</xsd:sequence>
</xsd:complexType


         Now I get an SAXException.Do we need to write our own deserialized class or we need to use ArrayDeserializer instead of BeanDeserializer.Any help regarding this is appreciated.



       

[ERROR] Call - -Exception: <org.xml.sax.SAXException: Invalid element in com.jpmc.ibportal.rxcc.integration.lob.rx.MyContactTO - MyContactTO>org.xml.sax.SAXException: Invalid element in com.jpmc.ibportal.rxcc.integration.lob.rx.MyContactTO - MyContactTO

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:233)

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 com.jpmc.ibportal.rxcc.integration.lob.rx.Rx_businessServicePortSoapBindingStub.getMyContacts(Rx_businessServicePortSoapBindingStub.java:377)

at com.jpmc.ibportal.rxcc.integration.lob.rx.Rx_businessServiceTestCase.test1EventDeskGetEvents(Rx_businessServiceTestCase.java:36)

at com.jpmc.ibportal.rxcc.integration.lob.rx.Rx_businessServiceTestCase.main(Rx_businessServiceTestCase.java:50)

junit.framework.AssertionFailedError: Remote Exception caught: org.xml.sax.SAXException: Invalid element in com.jpmc.ibportal.rxcc.integration.lob.rx.MyContactTO - MyContactTO

at com.jpmc.ibportal.rxcc.integration.lob.rx.Rx_businessServiceTestCase.test1EventDeskGetEvents(Rx_businessServiceTestCase.java:43)

at com.jpmc.ibportal.rxcc.integration.lob.rx.Rx_businessServiceTestCase.main(Rx_businessServiceTestCase.java:50)

Exception in thread "main"





   Thanks!
Sridhar