1 Reply Latest reply on Jan 5, 2007 4:45 AM by Maxime Jeanmart

    ws can't map ArrayList to xsd:boolean

    Maxime Jeanmart Newbie

      I have an EJB with the following method exposed as a web service:

      public Collection getStatus(Ear data) throws OspMethodException, RemoteException;

      I generated the wsdl using wstools. I have the following response generated:

      ...
      <message name="EarAccessService_getStatusResponse">
      <part name="result" type="ns1:Collection"/>
      </message>
      ...
      <operation name="getStatus" parameterOrder="Ear_1">
      <input message="tns:EarAccessService_getStatus"/>
      <output message="tns:EarAccessService_getStatusResponse"/>
      <fault message="tns:OspMethodException" name="OspMethodException"/>
      </operation>
      ...
      


      Now when I trigger the web service, the EJB method is correctly executed but the soap response creation fails with this error:

      
      10:00:33 ERROR .71-8080-1 [server.StandardEndpointServlet] Error processing web service request
      javax.xml.rpc.JAXRPCException: org.jboss.xb.binding.JBossXBValueFormatException: Java value for XSD boolean type expected to be an instance of java.lang.Boolean or java.lang.Number. But the value is of type java.util.ArrayList
       at org.jboss.ws.soap.SOAPContentElement.write(SOAPContentElement.java:986)
       at org.jboss.ws.soap.SAAJElementWriter.writeElement(SAAJElementWriter.java:171)
       at org.jboss.ws.soap.SAAJElementWriter.writeElement(SAAJElementWriter.java:184)
       at org.jboss.ws.soap.SAAJElementWriter.writeElement(SAAJElementWriter.java:184)
       at org.jboss.ws.soap.SAAJElementWriter.writeElement(SAAJElementWriter.java:184)
       at org.jboss.ws.soap.SAAJElementWriter.printInternal(SAAJElementWriter.java:163)
       at org.jboss.ws.soap.SAAJElementWriter.print(SAAJElementWriter.java:142)
       at org.jboss.ws.soap.SOAPMessageImpl.writeTo(SOAPMessageImpl.java:266)
       at org.jboss.ws.server.ServiceEndpointManager.sendResponse(ServiceEndpointManager.java:409)
      


      It seems it tries to map my ArrayList (a Collection of Strings to return) to a boolean. How is that possible? Is there something I missed?