INTSAMPLES-121: Upgrade to SI 3.0 and SPR 3.2.6

JIRA: https://jira.springsource.org/browse/INTSAMPLES-121
This commit is contained in:
Artem Bilan
2013-12-16 10:53:29 +02:00
parent ed736aa499
commit ddbfc4479c
53 changed files with 138 additions and 138 deletions

View File

@@ -9,17 +9,17 @@
xmlns:int-file="http://www.springframework.org/schema/integration/file"
xmlns:int-http="http://www.springframework.org/schema/integration/http">
<int-http:inbound-channel-adapter id="httpInboundAdapter"
channel="receiveChannel"
name="/inboundAdapter.htm"
<int-http:inbound-channel-adapter id="httpInboundAdapter"
channel="receiveChannel"
path="/inboundAdapter.htm"
supported-methods="GET, POST" />
<int:channel id="receiveChannel"/>
<int:service-activator id="multipartReceiver" input-channel="receiveChannel">
<bean class="org.springframework.integration.samples.multipart.MultipartReceiver"/>
</int:service-activator>
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>
</beans>

View File

@@ -32,7 +32,7 @@ import org.springframework.web.client.RestTemplate;
*
*/
public class MultipartRestClient {
private static Logger logger = Logger.getLogger(MultipartRestClient.class);
private static String uri = "http://localhost:8080/multipart-http/inboundAdapter.htm";
private static String resourcePath = "org/springframework/integration/samples/multipart/spring09_logo.png";
@@ -51,7 +51,7 @@ public class MultipartRestClient {
headers.setContentType(new MediaType("multipart", "form-data"));
HttpEntity<Object> request = new HttpEntity<Object>(multipartMap, headers);
logger.info("Posting request to: " + uri);
ResponseEntity<?> httpResponse = template.exchange(uri, HttpMethod.POST, request, null);
ResponseEntity<?> httpResponse = template.exchange(uri, HttpMethod.POST, request, Object.class);
if (!httpResponse.getStatusCode().equals(HttpStatus.OK)){
logger.error("Problems with the request. Http status: " + httpResponse.getStatusCode());
}