Results 1 to 3 of 3

Thread: full blown spring-web services tutorial

  1. #1

    Default full blown spring-web services tutorial

    could anyone please post a full blown step by step spring-web services tutorial - using Jax-rpc or any other (Hessian, Burlap)

    thx.

    lkj

  2. #2
    Join Date
    Dec 2004
    Posts
    23

    Default

    For HttpInvoker,

    At Server Side
    1. Put the following in web.xml
    Code:
    	<servlet>
    		<servlet-name>remoting</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    		<load-on-startup>3</load-on-startup>
    	</servlet>	
    	<servlet-mapping>
    		<servlet-name>remoting</servlet-name>
    		<url-pattern>/remoting/*</url-pattern>
    	</servlet-mapping>
    2. Create your service
    - create the interface (e.g. UserService)
    - create the implementing class (e.g. UserServiceImpl)

    3. Export your service (define it WEB-INF/remoting-servlet.xml)
    Code:
    	<!-- ******************************************** -->
    	<!-- User                                         -->
    	<!-- ******************************************** -->
    	<bean name="/UserService-httpinvoker" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
    		<property name="service"><ref bean="userService"/></property>
    		<property name="serviceInterface">
    			<value>com.wms.valueobjects.users.UserService</value>
    		</property>
    	</bean>
    At client side
    Code:
    	<bean id="userService" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
    		<property name="serviceUrl">
    			<value>https&#58;//localhost&#58;8443/wms/remoting/UserService-httpinvoker</value>
    		</property>
    		<property name="serviceInterface">
    			<value>com.wms.valueobjects.users.UserService</value>
    		</property>
    		<property name="httpInvokerRequestExecutor">
    			<bean class="org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor"/>
    		</property>			
    	</bean>
    To use simply
    Code:
    UserService service = &#40;UserService&#41;context.getBean&#40;"userService"&#41;;
    service.findUser&#40;new Integer&#40;5&#41;&#41;;
    ...
    cheers

  3. #3
    Join Date
    Sep 2004
    Posts
    12

    Default

    Hello,

    Can you post a code example where the client side does not use Spring?

    Thanks.

Similar Threads

  1. Replies: 13
    Last Post: Jan 5th, 2007, 11:22 PM
  2. Spring and Clustering Services don't mix?
    By twoencore in forum Architecture
    Replies: 9
    Last Post: Sep 28th, 2005, 06:04 PM
  3. Spring accessing other non Spring Web Services
    By aanecito in forum Architecture
    Replies: 1
    Last Post: Jun 17th, 2005, 04:42 AM
  4. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  5. Replies: 1
    Last Post: Dec 19th, 2004, 03:14 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
  •