Results 1 to 5 of 5

Thread: More convenient way to consume JAX-RPC services?

  1. #1
    Join Date
    Sep 2004
    Posts
    127

    Default More convenient way to consume JAX-RPC services?

    Hi,

    My spring app consumes many JAX-RPC services, and I'm wondering wether my setup could be improved.

    Currently, for each new service to be consumed, I'm doing the following:
    * Generate the portInterface (and required classes) from the service's WSDL using Axis' wsdl2java tool
    * Hand-craft the serviceInterface (aka buisness interface) that mirrors the portInterface but does not declare RemoteExceptions
    * Add JaxRpcPortProxyFactoryBean to my applicationContext

    The first two steps of this routine are dumb and repetitive, so I have the gut feeling that someone smarter than I has already come up with a more convenient way to do this. Anyone?

    On a sidenote, the services I'm consuming are generated using gsoap2 to interface with a C++ app and are out of my control. The code I'm generating with wsdl2java is butt-ugly, mostly because the C++ people prefix their variable names with characters indicating the type. This means I end up with accessors like getSName() or getIAmount() and so on. I really don't want to expose those ugly interfaces to my app, so I'm thinking about writing adapters for each service - which would be another repetitive step I'd rather spare myself. How does everyone else handle this?

    Thanks in advance,
    Dan

  2. #2
    Join Date
    Feb 2005
    Posts
    8

    Default web services with spring

    Hi ,
    I have integrated apache axis in the Spring framework without using
    JAXRpcProxyFactoryBean.I will thanlful to you if you kindly show some light on how to use JAXRpcProxyFactoryBean.A sample will be very helpful
    With regards,
    Ajit

  3. #3
    Join Date
    Sep 2004
    Posts
    127

    Default

    Sorry to disappoint you,

    but I recently ran into problems with Axis ignoring my deserializers for custom types (see http://forum.springframework.org/viewtopic.php?t=3556 ), and now I'm also back to using plain Axis - and I'm quite unhappy with this.

    For a sample, check out the latest beta of Spring from CVS, it contains additional documentation regarding JAX-RPC/Axis.

    BTW, I ended up building adapters for most of the services I consume, just so I could clean up the interface and translate error codes into proper exceptions, and so on.

    Regards,
    dan

  4. #4
    Join Date
    Feb 2005
    Posts
    5

    Default

    With respect to hand-crafting your wrapper I would suggest creating a custom XDoclet plugin to do that for you. You could even go so far as to give it a properties file (or similar) to map the ugly names to nicer ones.

    If you haven't written an XDoclet plugin it can be a bit intimidating at first but once you're over the hurdle it has tremendous power.

  5. #5
    Join Date
    Sep 2004
    Posts
    127

    Default

    I guess that XDoclet could improve the situation, but it would also further complicate the build process.

    Since I have to hand-craft those wrappers anyway, e.g. to map error codes to exceptions, I decided to do the clean-up manually, too.

    Creating the new names programmatically seems like it's not an option (it would result in some different but still ugly names), so even if I used XDoclet, I would have to specify the name mapping explicitly.

    But thanks for your suggestion!

Similar Threads

  1. ACEGI Security and Web Services
    By bbailey in forum Security
    Replies: 5
    Last Post: Dec 22nd, 2005, 03:11 PM
  2. Securing Spring-based services with Acegi
    By Andrei Lissovski in forum Security
    Replies: 3
    Last Post: Sep 23rd, 2005, 06:56 PM
  3. Exposing Services in a JMS based application
    By rsheldon in forum Architecture
    Replies: 1
    Last Post: Sep 21st, 2005, 12:56 AM
  4. Replies: 1
    Last Post: Sep 21st, 2005, 12:56 AM
  5. planning major migration to spring
    By wexwarez in forum Architecture
    Replies: 21
    Last Post: May 23rd, 2005, 01:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •