diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParser.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParser.java index b12d6cb283..5d10f3ca4e 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParser.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,10 @@ public class WebServiceInboundGatewayParser extends AbstractInboundGatewayParser @Override protected boolean isEligibleAttribute(String attributeName) { - return !(attributeName.endsWith("marshaller")) && super.isEligibleAttribute(attributeName); + return !(attributeName.endsWith("marshaller")) && + !(attributeName.equals("mapped-reply-headers")) && + !(attributeName.equals("mapped-request-headers")) && + super.isEligibleAttribute(attributeName); } @Override diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParserTests-context.xml b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParserTests-context.xml index aebf275d39..7288eeee5c 100644 --- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParserTests-context.xml +++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParserTests-context.xml @@ -23,7 +23,9 @@ + marshaller="marshaller" unmarshaller="marshaller" + mapped-request-headers="testRequest" + mapped-reply-headers="testReply"/> diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParserTests.java b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParserTests.java index 549fd69680..213b3e2011 100644 --- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParserTests.java +++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package org.springframework.integration.ws.config; import java.util.Collections; +import java.util.List; import java.util.Map; import java.util.Properties; @@ -136,6 +137,14 @@ public class WebServiceInboundGatewayParserTests { assertThat( (MessageChannel) accessor.getPropertyValue("errorChannel"), is(customErrorChannel)); + @SuppressWarnings("unchecked") + List requestHeaders = TestUtils.getPropertyValue(marshallingGateway, "headerMapper.requestHeaderNames", List.class); + @SuppressWarnings("unchecked") + List replyHeaders = TestUtils.getPropertyValue(marshallingGateway, "headerMapper.replyHeaderNames", List.class); + assertEquals(1, requestHeaders.size()); + assertEquals(1, replyHeaders.size()); + assertTrue(requestHeaders.contains("testRequest")); + assertTrue(replyHeaders.contains("testReply")); } @Test diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceOutboundGatewayParserTests.java b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceOutboundGatewayParserTests.java index 60be266478..96d6d0dc41 100644 --- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceOutboundGatewayParserTests.java +++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceOutboundGatewayParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ package org.springframework.integration.ws.config; +import java.util.List; + import org.junit.Test; import org.springframework.beans.DirectFieldAccessor; @@ -38,11 +40,14 @@ import org.springframework.ws.client.core.WebServiceMessageCallback; import org.springframework.ws.client.support.interceptor.ClientInterceptor; import org.springframework.ws.transport.WebServiceMessageSender; -import static org.junit.Assert.assertEquals; +import static junit.framework.Assert.assertEquals; +import static junit.framework.Assert.assertTrue; + import static org.junit.Assert.assertNull; /** * @author Mark Fisher + * @author Oleg Zhurakousky */ public class WebServiceOutboundGatewayParserTests { @@ -57,6 +62,15 @@ public class WebServiceOutboundGatewayParserTests { DirectFieldAccessor accessor = new DirectFieldAccessor(gateway); Object expected = context.getBean("outputChannel"); assertEquals(expected, accessor.getPropertyValue("outputChannel")); + + @SuppressWarnings("unchecked") + List requestHeaders = TestUtils.getPropertyValue(endpoint, "handler.headerMapper.requestHeaderNames", List.class); + @SuppressWarnings("unchecked") + List replyHeaders = TestUtils.getPropertyValue(endpoint, "handler.headerMapper.replyHeaderNames", List.class); + assertEquals(1, requestHeaders.size()); + assertEquals(1, replyHeaders.size()); + assertTrue(requestHeaders.contains("testRequest")); + assertTrue(replyHeaders.contains("testReply")); } @Test diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/simpleWebServiceOutboundGatewayParserTests.xml b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/simpleWebServiceOutboundGatewayParserTests.xml index ce5176bcba..30c40de475 100644 --- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/simpleWebServiceOutboundGatewayParserTests.xml +++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/simpleWebServiceOutboundGatewayParserTests.xml @@ -26,7 +26,9 @@ + reply-channel="outputChannel" + mapped-request-headers="testRequest" + mapped-reply-headers="testReply"/>