axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Narayanan Nachiappan <reachna...@yahoo.com>
Subject SimpleDeserializer encountered a child element, which is NOT expected - AXIS Client
Date Wed, 04 Jan 2006 06:42:18 GMT
  I have created a Webservice (Axis 1.2.1 implementation) of type DOCUMENT Wrapped Style.
   
  There are no issues from the server side.  Through TCP-Mon I’m able to view the response
sent back by the Webservice.
   
  But, Axis Client is unable to parse the SOAP response.
   
  I’m getting the following error:
   
  ERROR [org.apache.axis.client.Call] Exception:
  org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected,
in something it was trying to deserialize.
        at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
        at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
        at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
        at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
        at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:345)
        at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
        at org.apache.axis.client.Call.invoke(Call.java:2448)
        at org.apache.axis.client.Call.invoke(Call.java:2347)
        at org.apache.axis.client.Call.invoke(Call.java:1804)
        at com.xyz.test.TestService.main(TestService.java:153)
  DEBUG [org.apache.axis.utils.NSStack] NSPush (32)
  DEBUG [org.apache.axis.i18n.ProjectResourceBundle] org.apache.axis.i18n.resource::handleGetObject(empty00)
  DEBUG [org.apache.axis.utils.NSStack] NSPop (empty)
  DEBUG [org.apache.axis.utils.NSStack] NSPush (32)
  DEBUG [org.apache.axis.i18n.ProjectResourceBundle] org.apache.axis.i18n.resource::handleGetObject(empty00)
  DEBUG [org.apache.axis.utils.NSStack] NSPop (empty)
  AxisFault
   faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
   faultSubcode: 
   faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a child element,
which is NOT expected, in something it was trying to deserialize.
   faultActor: 
   faultNode: 
   faultDetail: 
        {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: SimpleDeserializer
encountered a child element, which is NOT expected, in something it was trying to deserialize.
        at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
        at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
        at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
        at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
        at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:345)
        at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
        at org.apache.axis.client.Call.invoke(Call.java:2448)
        at org.apache.axis.client.Call.invoke(Call.java:2347)
        at org.apache.axis.client.Call.invoke(Call.java:1804)
        at com.xyz.test.TestService.main(TestService.java:153)
   
        {http://xml.apache.org/axis/}hostname:CDC1-02-534
   
  org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected,
in something it was trying to deserialize.
        at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
        at org.apache.axis.client.Call.invoke(Call.java:2451)
        at org.apache.axis.client.Call.invoke(Call.java:2347)
        at org.apache.axis.client.Call.invoke(Call.java:1804)
        at com.xyz.test.TestService.main(TestService.java:153)
  Caused by: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which
is NOT expected, in something it was trying to deserialize.
        at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
        at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
        at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
        at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
        at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:345)
        at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
        at org.apache.axis.client.Call.invoke(Call.java:2448)
        ... 3 more
   
   
  Here is the background information about the Webservice which I have created.
   
  Deploy.wsdd is as follows:
   
  <deployment     name="LocatePharmacy" xmlns="http://xml.apache.org/axis/wsdd/"
                                      xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
   
  <service name="LocatePharmacyService" provider="java:RPC" style="wrapped" use="literal">
              
              <parameter name="className" value="com.xyz.service.LocatePharmacyService"
/>
              <parameter name="allowedMethods" value="locateByAddress, locateByNABPNumber,
getVersion, validateRequest" />
              <beanMapping qname="ns:LocatePharmacyRequest" xmlns:ns="LocatePharmacyService"
languageSpecificType="java:com.xyz.data.LocatePharmacyRequest"/>
              <beanMapping qname="ns:Pharmacy" xmlns:ns="LocatePharmacyService" languageSpecificType="java:com.xyz.data.Pharmacy"/>
              <beanMapping qname="ns:MemberDetails" xmlns:ns="LocatePharmacyService" languageSpecificType="java:com.xyz.data.MemberDetails"/>
   
  //Other bean mappings
  .
  .
  .
  .
              
   
  </service>
   
  </deployment>
   
   
  Client code is as follows:
   
                         Service  service = new Service();
                         Call     call    = (Call) service.createCall();
   
                          QName    qn      = new QName( "LocatePharmacyService", "LocatePharmacyRequest"
);
   
                          call.registerTypeMapping(com.xyz.data.LocatePharmacyRequest.class,
qn,
                                        org.apache.axis.encoding.ser.BeanSerializerFactory.class,
                                        org.apache.axis.encoding.ser.BeanDeserializerFactory.class);
   
                          qn = new QName("LocatePharmacyService", "Pharmacy");
                          call.registerTypeMapping(com.xyz.data.Pharmacy.class, qn,
                                                  org.apache.axis.encoding.ser.BeanSerializerFactory.class,
                                                  org.apache.axis.encoding.ser.BeanDeserializerFactory.class);
   
                            //REGISTER ALL BEAN SERIALIZERS with respect to deploy.wsdd
   
              call.setTargetEndpointAddress( new java.net.URL(endpoint) );
                         call.setOperationName(new QName("LocatePharmacyService", "locateByNABPNumber"));
   
                          // CONSTRUCT the request object
   
                         LocatePharmacyResponse ret = (LocatePharmacyResponse) call.invoke(
new Object[] { request } );
   
                         System.out.println("Response = " + ret);               
   
  Webservice Details:
   
              I’m passing a user-defined Object (LocatePharmacyRequest).  It returns a user-defined
object (LocatePharmacyResponse).  This user-defined object (LocatePharmacyResponse) in turn
encapsulates a user-defined object(array).
   
              public LocatePharmacyResponse locateByNABPNumber(
                                      LocatePharmacyRequest locatorPharmacyRequest) {
                          ErrorList errorList = new ErrorList();
                          return component.locateByNABPNumber(locatorPharmacyRequest,errorList);
              }
   
   
  Can anyone please help me out in resolving this issue?
   
   
  Looking forward for your great help.
   
  Thanks & Regards,
  Nachiappan.N



		
---------------------------------
 Yahoo! DSL Something to write home about. Just $16.99/mo. or less
Mime
View raw message