Results 1 to 7 of 7

Thread: bean exposure as web service

  1. #1

    Default bean exposure as web service

    I'm just looking at web services (seriously) for the first time. Is there a way, like the spring jmx support, that you could expose a bean in spring as a webservice without any extra work?

    For example, this is how I expose some beans currently,
    <pre>
    <bean id="jmxAdapter"
    class="org.springframework.jmx.JmxMBeanAdapter">
    <property name="beans">
    <map>
    <entry key="myDomain:Name=myBean">
    <ref bean="myBeanRef" />
    </entry>
    </map>
    </property>
    </bean>
    </pre>

    Could something similar be written to expose that bean as a service? Am I barking up the wrong tree completely?

  2. #2
    Join Date
    Sep 2004
    Location
    Copenhagen, Denmark
    Posts
    113

    Default

    I haven't seen this in Spring where you could expose it in the XML file.

    However Axis integration is pretty easy as your exposed bean can be delegated from a class that extends ServletEndpointSupport.

    But I guess there is a JIRA somewhere where someone has posted a solution or request for this feature in the Spring core.

    Let us know if you find such a JIRA and post the link here.
    /Claus

  3. #3
    Join Date
    Nov 2004
    Location
    St. Louis, Missouri USA
    Posts
    33

    Default

    what are your service clients like? Are they running in the same jvm, are they running remotely ... are they written in different language?

    I've had success implementing PHP, PEAR, and XML_RPC as a client-side consumer, using the Apache XML-RPC library on the server side, mapping all /xmlrpc/* requests through the DispatcherServlet to my XmlRpcServer extension. This way any Bean or Service I want to expose through Spring is available.

  4. #4

    Default xfire

    My clients will be running remotely, ideally i'd like to have the same kind of entry in the xml file and perhaps use xfire to expose the bean. I'm thinkng out loud here, but I'll take a look over the weekend and see it it is possible to repeat the JMX pattern.

  5. #5

    Default interesting link

    Not quite what i had in mind - but this shows how easy it is using the current method

    http://www.wrytradesman.com/blog/archives/000030.html

  6. #6
    Join Date
    Sep 2004
    Location
    Copenhagen, Denmark
    Posts
    113

    Default Re: interesting link

    Quote Originally Posted by analogueboy
    Not quite what i had in mind - but this shows how easy it is using the current method

    http://www.wrytradesman.com/blog/archives/000030.html
    Isn't the example in the Spring reference .pdf more simple? Just extending a special support class and you'll have access to Spring Bean Factory? Of course the Axis integration is the same as the link above where you can register the class using server-deploy.wsdd.

    I'm using this approach at a project at work. Both exposing a service and consuming a service. All using Spring and Axis in two seperate apps. One in Tomcat and one as a standalone java main app.
    /Claus

  7. #7

    Default already implemented

    For the sake of completeness, this has been included in 1.2RC1, not sure who implemented it tho...

Similar Threads

  1. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  2. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  3. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  4. could not satisfy dependencies
    By springuser in forum Container
    Replies: 4
    Last Post: Apr 26th, 2005, 01:15 PM
  5. Replies: 1
    Last Post: Apr 25th, 2005, 07:37 PM

Posting Permissions

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