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> ...
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)
The following topic says we should not use collections, but arrays instead:
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=98061
Is changing the method signature the only way to solve this problem?