Announcement Announcement Module
Collapse
No announcement yet.
bean exposure as web service Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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.

      Comment


      • #4
        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.

        Comment


        • #5
          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

          Comment


          • #6
            Re: interesting link

            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.

            Comment


            • #7
              already implemented

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

              Comment

              Working...
              X