Announcement Announcement Module
Collapse
No announcement yet.
HessianServiceExporter Example Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • HessianServiceExporter Example

    I'm stuck trying to follow http://static.springframework.org/sp...ucho-protocols, to create a SOAP service.

    Here are my files:

    web.xml
    Code:
    <web-app>
      <servlet>
        <servlet-name>myapp-soap</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>
    
      <servlet-mapping>
        <servlet-name>myapp-soap</servlet-name>
        <url-pattern>/soap/*</url-pattern>
      </servlet-mapping>
    </web-app>
    myapp-soap-servlet.xml
    Code:
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
           
        <bean name="/MyApp" class="org.springframework.remoting.caucho.HessianServiceExporter">
            <property name="service">
                <ref bean="myAppService" />
            </property>
            <property name="serviceInterface" value="com.name.myapp.remote.service.MyAppRemoteService" />
        </bean>
        <!-- yes, this bean's class implements com.name.myapp.remote.service.MyAppRemoteService -->
        <bean id="myAppService" class="com.name.myapp.service.impl.MyAppServiceImpl">
            <property name="dao">
                <!-- wiring in my DAO here -->
            </property>
        </bean> 
    </beans>
    When I load this up, and goto the following URL (note it's loaded in the document root '/myapp/'):
    Code:
    http://localhost/myapp/soap/MyApp?WSDL
    ...I get the error:
    Code:
    Status 405 - HessianServiceExporter only supports POST requests
    Fair enough. So I do the following from the command prompt:
    Code:
    wget --post-data="test" http://localhost/myapp/soap/MyApp?WSDL
    ...and I get the following in the logs:
    Code:
    org.springframework.web.servlet.PageNotFound  - No mapping found for HTTP request with URI [/myapp/soap/MyApp/] in DispatcherServlet with name 'myapp-soap'
    Should "http://localhost/myapp/soap/MyApp?WSDL" (either POST or GET) work in getting the WSDL? If it should, what is going wrong here? If not, what is the proper way to get the WSDL?
    Last edited by Temujin_12; May 11th, 2009, 04:19 PM.

  • #2
    Hmmm... on further reading, I think I'm confused as to what Hessian even is (ie: it's not a SOAP implementation).

    If I wire up a client as follows:
    Code:
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
           
           <bean name="serviceLoader" class="com.name.myapp.remote.test.ServiceLoader">
                <property name="service" ref="service"/>
           </bean>
    
            <bean id="service" class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
    		    <property name="serviceUrl" value="http://localhost/myapp/soap/MyApp"/>
    		    <property name="serviceInterface" value="com.name.myapp.remote.service.MyAppRemoteService"/>
    		</bean>
           
    </beans>
    ...and make a remote call through the serviceLoader bean (ie: serviceLoader.getService().serviceMethod()) I get the following error:
    Code:
    com.caucho.hessian.io.HessianProtocolException: expected string at 0x6d
    ...which is a known issue with Spring using Hessian 3.2.1 (see http://jira.springframework.org/browse/SPR-5469).

    Is there a way to wire up a SOAP service that's as easy as wiring up Hessian via some kind of service exporter?

    Comment


    • #3
      Temujin_12 ,

      What about org.springframework.remoting.jaxws.SimpleJaxWsServ iceExporter in Spring 2.5.x? I think it's a SOAP service exporter.

      Hope that helps,

      Comment

      Working...
      X