< Prev - Documentation - Next >

Spring HTTP-Remoting Connector Builder

This Connector Builder generates Spring HTTP-Remoting classes. Spring HTTP-Remoting is uses to call PL/SQL stored procedures tunneled by a HTTP webserver. This is required if no direct access to the Oracle database is allowed or wanted. The implementation is very stable and allows running different versions JRE (up from Java 1.5) on server and client. The complete code and configuration is generated.

Generated Code

Dependencies

Manual Configuration

Example web.xml

The configuration sections listener, servlet and servlet-mapping requires configuration as any other Spring configuration.
XML-File : web.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="WebApp_ID" version="3.0" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
  <display-name>service</display-name>
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/serviceDataSource-ds.xml /WEB-INF/service-servlet.xml</param-value>
  </context-param>
  <servlet>
    <servlet-name>service</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>service</servlet-name>
    <url-pattern>/service/*</url-pattern>
  </servlet-mapping>
</web-app>

Example Spring DataSource Bean

This example demonstrates the use of a Spring Datasource configured bean with the PropertyPlaceholderConfigurer. Be sure to configure the 'bean id'-name identical to the setting of PL/SQL Connector Builder.
XML-File : springremoting_int_double-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
  http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
  http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="location">
      <value>classpath:dbw_test.properties</value>
    </property>
  </bean>
  
  <bean id="springremotingIntDoubleDataSource" 
      class="org.springframework.jdbc.datasource.DriverManagerDataSource">
      <property name="driverClassName" value="oracle.jdbc.OracleDriver"/>
      <property name="url" value="${jdbc.url}"/>
      <property name="username" value="${jdbc.user}"/>
      <property name="password" value="${jdbc.password}"/>
   </bean>
</beans>

Example Client Calling Context Configuration

The client factory loads the client calling context and the spring remote http-invoker configuration then getting a remote call proxy. Four parameter must be set. All parameters starts with the name of the <servlet/service>.server.<parameter>.
  • springremoting_int_double.server.address : The server name or IP address.
  • springremoting_int_double.server.port : The configured port.
  • springremoting_int_double.server.webapp : Web-Application there the servlet/service runs in.
  • springremoting_int_double.server.context : The servlet/service-name
XML-File : springremoting_int_double-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<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.xsd">
	<bean id="propertyConfigurer"
		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">

		<property name="properties">
		<value>
	springremoting_int_double.server.address=localhost
	springremoting_int_double.server.port=9090
	springremoting_int_double.server.webapp=embeddedTomcat
	springremoting_int_double.server.context=springremoting_int_double
		</value>
		</property>
	</bean>
</beans>

Spring Remoting Example Download

To get more detailed information, have a look at the runnable example. Download Example Page >>>

UI Configuration

< Prev - Documentation - Next >