Web Services in J2EE with complex types


XML & Web services: Web Services in J2EE with complex types

  1. Web Services in J2EE with complex types (3 messages)

    We have our business methods exposed as StatlessSession Beans. With out changing any of the existing code, I am planning to expose the same methods as WebServices.

     I have done some R&D on Axis(Apache Soap 3.0) and it looks like a good candidate mainly becoz its open source and not tighed to any specific J2EE container.

     The challenge I am facing is currently our statless session beans return and take different types of complex objects [ HashMap,List and custom Java Objects ]. And most of these do not adhere to JavaBeans[setXXX,getXXX etc].

     Can someone help with some ideas as to how to go about this particular situation. I am ready to add a few wrappers but am not willng to change any existing interfaces of the Stateless Session Beans.

  2. Well, I guess its time to reply to my own question :)

    Good news is, I am able to expose my SLSBs as web services using Apache Axis inside Weblogic6.1

    All I had to do was ..
    1) Write a WebService Deployment descriptor [.wsdd ] file.
    2) In the .wsdd file, mention the location of my enterprise bean with home and remote interfaces
    3) In the .wsdd file, mention the bean mappings for all the complex types used by your bean

    Once you deploy the service, you can use autogenered .wsdl file to access the webservice from local/remote clients.

    Its amazing to see how a few tools like XMLSpy, CapeClear etc. understand the wsdl and expose the business methods to the clients which they can use to make soap calls with out building clients from scratch
  3. Dear Kiran,

    I am planning to build an OC4J based Web Services, but the remote interface of session EJB only accepts complex data type (ex. Vector). It's also hard for me to choose between wrapping the interface or finding a more simple way.

    I think your method is very helpful for me, would you mind giving more detail about how to write those complex data type in WSDL? Many thanks! ^_^

    Sincerely yours,

  4. I have similar questions, refer to: