Announcement Announcement Module
Collapse
No announcement yet.
Converting from HessianServlet to Http Invoker method? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Converting from HessianServlet to Http Invoker method?

    Hi,
    I have some HessianServlet services that directly inherit from HessianServlet (not using Spring framework) and I want to convert them to use HTTP Invoker remoting. Is there a similar servlet class I can inherit from to do this or must I use the spring framework and xml delcaration to expose my service using this technique?

    Thanks,
    mynzai

  • #2
    Config it using spring is quite a simple job.
    No much work needed. I suggest u have a try.

    Comment


    • #3
      Why extend a servlet, when you can simply configure it via IoC with a ProxyFactory? It's more elegant to use decoration, which is much of the point of AOP. :-)

      Comment


      • #4
        Indeed - one of the advantages of using http-invoker is that there is no need to extend a Servlet. To expose a service using HttpInvoker, you can use the exporter and simply inject the service, such as:

        Code:
        <beans>
        
           <bean name="/myService.html" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
              <property name="service" ref="myService"/>
              <property name="serviceInterface" value="x.y.MyService"/>
           </bean>
        
           <bean id="urlMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
        
           <bean id="myService" class="x.y.MyServiceImpl"/>
        
        </beans>
        Also, the configuration is almost identical for exposing via Hessian or Burlap (only requires changing the class attribute of the bean).

        Comment


        • #5
          Hi Mark,

          I am sorry if I am a newbie to this, but could you please provide me a more-detailed simple examples? Because I am currently stuck with HessianServlet, which always converts the objects that I pass from Client (outside Spring DM) to the service into HashMap type. Please help me on this. Thanks.

          Originally posted by Mark Fisher View Post
          Indeed - one of the advantages of using http-invoker is that there is no need to extend a Servlet. To expose a service using HttpInvoker, you can use the exporter and simply inject the service, such as:

          Code:
          <beans>
          
             <bean name="/myService.html" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
                <property name="service" ref="myService"/>
                <property name="serviceInterface" value="x.y.MyService"/>
             </bean>
          
             <bean id="urlMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
          
             <bean id="myService" class="x.y.MyServiceImpl"/>
          
          </beans>
          Also, the configuration is almost identical for exposing via Hessian or Burlap (only requires changing the class attribute of the bean).

          Comment


          • #6
            <beans>

            <bean name="/myService.html" class="org.springframework.remoting.httpinvoker.Ht tpInvokerServiceExporter">
            <property name="service" ref="myService"/>
            <property name="serviceInterface" value="x.y.MyService"/>
            </bean>

            <bean id="urlMapping" class="org.springframework.web.servlet.handler.Bea nNameUrlHandlerMapping"/>

            <bean id="myService" class="x.y.MyServiceImpl"/>

            </beans>

            Colon-cleanse

            Comment

            Working...
            X