6 Replies Latest reply on Jan 4, 2006 9:23 AM by thomas.diesler

    Array of boolean problem

    giscard_aioba

      Hi guys, I think I got a BIG problem using Web Service in JBoss, I create a simple interface:

      public void testArrayOfBoolean(boolean[] responses) throws RemoteException;
      


      a simple implementation for this interface
      public void testArrayOfBoolean(boolean[] responses){
       for(int i = 0; i < responses.length; i++)
       System.out.println("RESPONSE[" + i + "]: " + responses);
      }//end testArrayOfBoolean() method
      


      this is the generated wsdl
      <?xml version="1.0" encoding="UTF-8"?>
      <definitions name="RfidManagerInterface" targetNamespace="http://www.nec.co.jp/xmlnec/rfidmgr" xmlns:tns="http://www.nec.co.jp/xmlnec/rfidmgr" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns2="http://www.nec.co.jp/xmlnec/rfidmgr/types/arrays/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
       <types>
       <schema targetNamespace="http://www.nec.co.jp/xmlnec/rfidmgr/types/arrays/" xmlns:tns="http://www.nec.co.jp/xmlnec/rfidmgr/types/arrays/" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://www.w3.org/2001/XMLSchema">
       <complexType name="booleanArray">
       <sequence>
       <element name="value" type="boolean" minOccurs="0" maxOccurs="unbounded"/></sequence></complexType></schema></types>
       <message name="RfidManagerInterfaceSEI_testArrayOfBoolean">
       <part name="arrayOfboolean_1" type="ns2:booleanArray"/></message>
       <message name="RfidManagerInterfaceSEI_testArrayOfBooleanResponse"/>
       <portType name="RfidManagerInterfaceSEI">
       <operation name="testArrayOfBoolean" parameterOrder="arrayOfboolean_1">
       <input message="tns:RfidManagerInterfaceSEI_testArrayOfBoolean"/>
       <output message="tns:RfidManagerInterfaceSEI_testArrayOfBooleanResponse"/></operation></portType>
       <binding name="RfidManagerInterfaceSEIBinding" type="tns:RfidManagerInterfaceSEI">
       <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
       <operation name="testArrayOfBoolean">
       <soap:operation soapAction=""/>
       <input>
       <soap:body use="literal" namespace="http://www.nec.co.jp/xmlnec/rfidmgr"/></input>
       <output>
       <soap:body use="literal" namespace="http://www.nec.co.jp/xmlnec/rfidmgr"/></output></operation></binding>
       <service name="RfidManagerInterface">
       <port name="RfidManagerInterfaceSEIPort" binding="tns:RfidManagerInterfaceSEIBinding">
       <soap:address location="REPLACE_WITH_ACTUAL_URL"/></port></service></definitions>
      


      this is the deployed wsdl on JBoss
      <?xml version="1.0" encoding="UTF-8" ?>
      - <definitions name="RfidManagerInterface" targetNamespace="http://www.nec.co.jp/xmlnec/rfidmgr" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns2="http://www.nec.co.jp/xmlnec/rfidmgr/types/arrays/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.nec.co.jp/xmlnec/rfidmgr" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      - <types>
      - <schema targetNamespace="http://www.nec.co.jp/xmlnec/rfidmgr/types/arrays/" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.nec.co.jp/xmlnec/rfidmgr/types/arrays/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      - <complexType name="booleanArray">
      - <sequence>
       <element maxOccurs="unbounded" minOccurs="0" name="value" type="boolean" />
       </sequence>
       </complexType>
       </schema>
       </types>
       <message name="RfidManagerInterfaceSEI_testArrayOfBooleanResponse" />
      - <message name="RfidManagerInterfaceSEI_testArrayOfBoolean">
       <part name="arrayOfboolean_1" type="ns2:booleanArray" />
       </message>
      - <portType name="RfidManagerInterfaceSEI">
      - <operation name="testArrayOfBoolean" parameterOrder="arrayOfboolean_1">
       <input message="tns:RfidManagerInterfaceSEI_testArrayOfBoolean" />
       <output message="tns:RfidManagerInterfaceSEI_testArrayOfBooleanResponse" />
       </operation>
       </portType>
      - <binding name="RfidManagerInterfaceSEIBinding" type="tns:RfidManagerInterfaceSEI">
       <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
      - <operation name="testArrayOfBoolean">
       <soap:operation soapAction="" />
      - <input>
       <soap:body namespace="http://www.nec.co.jp/xmlnec/rfidmgr" use="literal" />
       </input>
      - <output>
       <soap:body namespace="http://www.nec.co.jp/xmlnec/rfidmgr" use="literal" />
       </output>
       </operation>
       </binding>
      - <service name="RfidManagerInterface">
      - <port binding="tns:RfidManagerInterfaceSEIBinding" name="RfidManagerInterfaceSEIPort">
       <soap:address location="http://BRB42603NS:8080/WebServiceInterface/RfidManagerInterface" />
       </port>
       </service>
       </definitions>
      


      This is the error I gotted when try to call the function:

      2005-12-12 10:56:43,281 ERROR [org.jboss.axis.providers.java.RPCInvocation] org.xml.sax.SAXException: Deserializing parameter 'arrayOfboolean_1': could not find deserializer for type {http://www.nec.co.jp/xmlnec/rfidmgr/types/arrays/}booleanArray
      org.xml.sax.SAXException: Deserializing parameter 'arrayOfboolean_1': could not find deserializer for type {http://www.nec.co.jp/xmlnec/rfidmgr/types/arrays/}booleanArray
      at org.jboss.axis.message.RPCHandler.onStartChild(RPCHandler.java:326)
      at org.jboss.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:1168)
      at org.jboss.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:244)
      at org.jboss.axis.message.SOAPElementAxisImpl.publishToHandler(SOAPElementAxisImpl.java:1389)
      at org.jboss.axis.message.RPCElement.deserialize(RPCElement.java:262)
      at org.jboss.axis.message.RPCElement.getParams(RPCElement.java:396)
      at org.jboss.axis.providers.java.RPCInvocation.prepareFromRequestEnvelope(RPCInvocation.java:235)
      at org.jboss.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:103)
      at org.jboss.axis.providers.java.JavaProvider.invoke(JavaProvider.java:358)
      at org.jboss.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
      at org.jboss.axis.SimpleChain.doVisiting(SimpleChain.java:160)
      at org.jboss.axis.SimpleChain.invoke(SimpleChain.java:123)
      at org.jboss.axis.handlers.soap.SOAPService.invoke(SOAPService.java:560)
      at org.jboss.webservice.server.ServerEngine.invokeInternal(ServerEngine.java:200)
      at org.jboss.webservice.server.ServerEngine.invoke(ServerEngine.java:89)
      at org.jboss.axis.transport.http.AxisServlet.doPost(AxisServlet.java:911)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)
      2005-12-12 10:56:43,296 ERROR [org.jboss.webservice.server.ServerEngine] Server error: AxisFault
      faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
      faultSubcode:
      faultString: Deserializing parameter 'arrayOfboolean_1': could not find deserializer for type {http://www.nec.co.jp/xmlnec/rfidmgr/types/arrays/}booleanArray
      faultActor:
      faultNode:
      faultDetail:
      {http://xml.apache.org/axis/}stackTrace: org.xml.sax.SAXException: Deserializing parameter 'arrayOfboolean_1': could not find deserializer for type {http://www.nec.co.jp/xmlnec/rfidmgr/types/arrays/}booleanArray
      at org.jboss.axis.message.RPCHandler.onStartChild(RPCHandler.java:326)
      at org.jboss.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:1168)
      at org.jboss.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:244)
      at org.jboss.axis.message.SOAPElementAxisImpl.publishToHandler(SOAPElementAxisImpl.java:1389)
      at org.jboss.axis.message.RPCElement.deserialize(RPCElement.java:262)
      at org.jboss.axis.message.RPCElement.getParams(RPCElement.java:396)
      at org.jboss.axis.providers.java.RPCInvocation.prepareFromRequestEnvelope(RPCInvocation.java:235)
      at org.jboss.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:103)
      at org.jboss.axis.providers.java.JavaProvider.invoke(JavaProvider.java:358)
      at org.jboss.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
      at org.jboss.axis.SimpleChain.doVisiting(SimpleChain.java:160)
      at org.jboss.axis.SimpleChain.invoke(SimpleChain.java:123)
      at org.jboss.axis.handlers.soap.SOAPService.invoke(SOAPService.java:560)
      at org.jboss.webservice.server.ServerEngine.invokeInternal(ServerEngine.java:200)
      at org.jboss.webservice.server.ServerEngine.invoke(ServerEngine.java:89)
      at org.jboss.axis.transport.http.AxisServlet.doPost(AxisServlet.java:911)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)

      {http://xml.apache.org/axis/}isRuntimeException: true


        • 1. Re: Array of boolean problem
          luigi.tascapani

          Hi, i've got the same problem with String[]. The simplest way (not the best) is to create a class BooleanArr, that extends Serializable.
          Add to the class a field:

          private boolean[] values;

          and getter & setter method for the property values.
          Your method now will be:

          public void testArrayOfBoolean(BooleanArr responses) throws RemoteException;

          It should work
          Bye

          • 2. Re: Array of boolean problem
            thomas.diesler

            The array wrapper beans are created for you using the -keep option with wscompile. Also make sure the schema type is properly mapped in jaxrpc-mapping.xml.

            • 3. Re: Array of boolean problem
              anders.hedstrom

              The way I like to handle this issue is the following:

              First I've the defined method in the interface:

              public void testArrayOfBoolean(boolean[] responses) throws RemoteException;


              With this I run wscompile to generate the wsdl.

              Then I delete my interface and run wscompile again using the wsdl to generate all needed artifacts. wscompile will create the following method signature in the interface:

              public void testArrayOfBoolean(BooleanArray responses) throws RemoteException;


              There should be no need to edit the mapping file.

              Cheers




              • 4. Re: Array of boolean problem
                giscard_aioba

                Hi guys, very thanks for the help it works using the wscompile and -keep command line option. But I had one more question....

                If a don't wanna use the wscompile but the wsdl2java instead?!!? How can I handle it... Because at first time I was using the wsdl2java to generate the client side and the wscompile to generate the server wsdl side.

                The BIG problem here is: "My WS interface MUST be invoked by a third part software and this software use the AXIS wsdl2java tool".

                How can I create all the wrappers using the wsdl2java tool?!?!!?

                Thanks

                • 5. Re: Array of boolean problem
                  thomas.diesler

                  The client should be no concern to you. It maybe C++, Perl, Java (Axis), whatever. As long as the client creates messages that conform to the abstract contract you publish in the wsdl, all will be fine.

                  • 6. Re: Array of boolean problem
                    thomas.diesler