4 Replies Latest reply on Sep 11, 2004 5:25 AM by thomas.diesler

    JBossWS with complex types and arrays and WSDL generation

    dpocock



      I've been able to get complex types working, but am having trouble with arrays. Could someone post a working example? I notice none of the samples or test cases in the source include arrays.

      I've also found that the current version of Axis' Java2WSDL is producing WSDL's that my JWSDP 1.4 based client doesn't like. However, if I use Sun's wscompile to generate my WSDL then JBoss' internal Axis doesn't like it.

      These are the general principals I am aiming for:
      - the EJB container is J2EE 1.4 compliant (eg JBoss 4)
      - the WSDL is to be generated automatically from a Java endpoint interface
      - the client is a Swing application running in Java Web Start, and can receive any necessary JAR files at deployment time. I don't mind how many JAR files there are, or how long the download takes, just as long as it all works.

      Specifically, can someone suggest,
      - am I correct in assuming that the SOAP implementation in the container is not something I can change on a per-application basis? In other words, if I use JBoss, I presume I am stuck with Axis on the server side for all my web services?
      - which tool should I use for WSDL generation - Axis or WScompile?
      - which library should I run on the client - JWSDP 1.4 components, Axis client or something else?

        • 1. Re: JBossWS with complex types and arrays and WSDL generatio
          thomas.diesler

           


          - the WSDL is to be generated automatically from a Java endpoint interface


          JBossWS simply feeds back the wsdl you supply at deploytime - no wsdl is generated.


          - am I correct in assuming that the SOAP implementation in the container is not something I can change on a per-application basis? In other words, if I use JBoss, I presume I am stuck with Axis on the server side for all my web services?


          If your SOAP implementation only requires a compliant servlet container, you should be able to use that if you like.


          - which tool should I use for WSDL generation - Axis or WScompile?


          I use the latest Axis.


          - which library should I run on the client - JWSDP 1.4 components, Axis client or something else?


          If you have the choice, use sthe same library on both sides. Intreoperability is an aim not a guaranty.

          • 2. Re: JBossWS with complex types and arrays and WSDL generatio
            thomas.diesler

            Additionally to the test cases you see, there are > 2300 tests from the Sun's Compatiblity Test Suite (CTS). Among them, many about arrays.

            What sort of array are you trying to serialize?

            • 3. Re: JBossWS with complex types and arrays and WSDL generatio
              dpocock


              This link is to an email describing the same problem:
              http://www.mail-archive.com/jboss-development@lists.sourceforge.net/msg47648.html//www.mail-archive.com/jboss-development@lists.sourceforge.net/msg47648.html

              Here is the function prototype in my application's endpoint interface:
              public CustomerDetails[] getCustomers(int person) throws RemoteException;

              The CustomerDetails object is a simple bean with public getters and setters, attributes are just ints and Strings.

              The object serializes properly when a function only returns a single object instance rather than an array.

              Here is the JBoss console output:
              Caused by: java.io.IOException: No serializer found for class com.uecommerce.telacct.ws.CustomerDetails in registry org.apache.axis.encoding.TypeMappingImpl@1247e6f
              at org.apache.axis.encoding.SerializationContextImpl.serializeActual(SerializationContextImpl.java:1461)
              at org.apache.axis.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java:880)
              at org.apache.axis.encoding.ser.ArraySerializer.serialize(ArraySerializer.java:410)
              at org.apache.axis.encoding.SerializationContextImpl.serializeActual(SerializationContextImpl.java:1430)
              at org.apache.axis.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java:880)
              at org.apache.axis.message.RPCParam.serialize(RPCParam.java:270)
              at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:447)
              at org.apache.axis.message.SOAPElementAxisImpl.output(SOAPElementAxisImpl.java:1478)
              at org.apache.axis.message.SOAPBodyAxisImpl.outputImpl(SOAPBodyAxisImpl.java:152)
              at org.apache.axis.message.SOAPEnvelopeAxisImpl.outputImpl(SOAPEnvelopeAxisImpl.java:604)
              at org.apache.axis.message.SOAPElementAxisImpl.output(SOAPElementAxisImpl.java:1478)
              at org.apache.axis.MessagePart.writeTo(MessagePart.java:294)
              ... 39 more

              • 4. Re: JBossWS with complex types and arrays and WSDL generatio
                thomas.diesler

                Please create an issue through the sourceforge bug interface ant attach the relevant files.

                cheers