Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Spring and the fly likes Spring Integration Http Adapter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring Integration Http Adapter" Watch "Spring Integration Http Adapter" New topic
Author

Spring Integration Http Adapter

Shriram Gopalakrishnan
Ranch Hand

Joined: Feb 20, 2007
Posts: 44
I am trying to pull an page using Spring integration http outbound gateway, basically I want to just pull the page for the given URL say http://yahoo.com and transform it and pass it other layers or activators. Given below is my integration configuration, the problem is everything is configured without any errors but do not get the expected sysout message.


<bean id="httpServiceActivator" class="com.macys.ie.HttpServiceActivator" />
<bean id="httpClientParams" class="org.apache.commons.httpclient.params.HttpClientParams">
<property name="connectionManagerClass" value="org.apache.commons.httpclient.MultiThreadedHttpConnectionManager"/>
</bean>

<bean id="httpClient" class="org.apache.commons.httpclient.HttpClient">
<constructor-arg ref="httpClientParams"/>
</bean>
<bean id="httpClientFactory" class="org.springframework.http.client.CommonsClientHttpRequestFactory">
<constructor-arg ref="httpClient"/>
</bean>
<int:channel id="requestChannel"/>
<int-httputbound-gateway request-channel="requestChannel"
url="http://yahoo.com"
http-method="GET"
request-factory="httpClientFactory"
expected-response-type="java.lang.String" auto-startup="true"
reply-channel="httpResponseChannel" />
<int:channel id="httpResponseChannel" datatype="java.lang.String" />
<int:service-activator input-channel="httpResponseChannel" ref="httpServiceActivator"/>


public class HttpServiceActivator {
/**
* @param msg
*/
@ServiceActivator
public void handleHttpMessage(Message<?> msg){
System.out.println(msg);
}
}

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Spring Integration Http Adapter
 
Similar Threads
java.lang.NoClassDefFoundError: java/util/concurrent/ConcurrentSkipListMap
Acegi Configuration
Spring Mvc 404 error
problens in spring CustomDataEditor!
Bean Initialization fails... Why?