Author: barrettj Date: Wed Apr 28 14:37:43 2010 New Revision: 938986 URL: http://svn.apache.org/viewvc?rev=938986&view=rev Log: Add support for JAXWS 2.2 Addressing.responses on client side.
Modified: axis/axis2/java/core/trunk/modules/jaxws/pom.xml axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/client/config/AddressingConfigurator.java axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/client/dispatch/DispatchAddressingFeatureTest.java axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/client/proxy/ProxyAddressingFeatureTest.java axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/server/config/AddressingConfigurator.java Modified: axis/axis2/java/core/trunk/modules/jaxws/pom.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/pom.xml?rev=938986&r1=938985&r2=938986&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws/pom.xml (original) +++ axis/axis2/java/core/trunk/modules/jaxws/pom.xml Wed Apr 28 14:37:43 2010 @@ -37,6 +37,10 @@ <artifactId>geronimo-annotation_1.0_spec</artifactId> </dependency> <dependency> + <groupId>org.apache.geronimo.specs</groupId> + <artifactId>geronimo-jaxws_2.2_spec</artifactId> + </dependency> + <dependency> <groupId>org.apache.axis2</groupId> <artifactId>axis2-kernel</artifactId> <version>${version}</version> @@ -150,6 +154,38 @@ </executions> </plugin> <plugin> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <phase>generate-sources</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>javax.xml.bind</groupId> + <artifactId>jaxb-api</artifactId> + <type>jar</type> + </artifactItem> + <artifactItem> + <groupId>org.apache.geronimo.specs</groupId> + <artifactId>geronimo-saaj_1.3_spec</artifactId> + <type>jar</type> + </artifactItem> + <artifactItem> + <groupId>org.apache.geronimo.specs</groupId> + <artifactId>geronimo-jaxws_2.2_spec</artifactId> + </artifactItem> + </artifactItems> + <overWrite>true</overWrite> + <outputDirectory>${project.build.directory}/endorsed</outputDirectory> + <stripVersion>true</stripVersion> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> @@ -162,7 +198,7 @@ <inherited>true</inherited> <configuration> <compilerArgument> - -Xbootclasspath/p:${basedir}/../jaxws-api/target/classes${path.separator}${basedir}/../jws-api/target/classes + -Xbootclasspath/p:${project.build.directory}/endorsed/geronimo-jaxws_2.2_spec.jar${path.separator}${basedir}/../jaxws-api/target/classes${path.separator}${basedir}/../jws-api/target/classes </compilerArgument> <compilerVersion>1.5</compilerVersion> <source>1.5</source> @@ -282,7 +318,7 @@ <inherited>true</inherited> <configuration> <forkMode>once</forkMode> - <argLine>-Xms256m -Xmx512m</argLine> + <argLine>-Xms256m -Xmx512m -Xbootclasspath/p:${project.build.directory}/endorsed/jaxb-api.jar${path.separator}${project.build.directory}/endorsed/geronimo-saaj_1.3_spec.jar${path.separator}${project.build.directory}/endorsed/geronimo-jaxws_2.2_spec.jar</argLine> <!-- Enable the next 2 lines if you want to attach a debugger <argLine>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006</argLine>--> <includes> Modified: axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/client/config/AddressingConfigurator.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/client/config/AddressingConfigurator.java?rev=938986&r1=938985&r2=938986&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/client/config/AddressingConfigurator.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/client/config/AddressingConfigurator.java Wed Apr 28 14:37:43 2010 @@ -167,6 +167,13 @@ public class AddressingConfigurator impl messageContext.setProperty(AddressingConstants.WS_ADDRESSING_VERSION, addressingNamespace); messageContext.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, disableAddressing); + + // If the Addressing feature was specified, then get the responses value from it and map to the value + // the addressing handler expects + if (addressingFeature != null) { + messageContext.setProperty(AddressingConstants.WSAM_INVOCATION_PATTERN_PARAMETER_NAME, + org.apache.axis2.jaxws.server.config.AddressingConfigurator.mapResponseAttributeToAddressing(addressingFeature.getResponses())); + } } /* Modified: axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/client/dispatch/DispatchAddressingFeatureTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/client/dispatch/DispatchAddressingFeatureTest.java?rev=938986&r1=938985&r2=938986&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/client/dispatch/DispatchAddressingFeatureTest.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/client/dispatch/DispatchAddressingFeatureTest.java Wed Apr 28 14:37:43 2010 @@ -87,9 +87,11 @@ public class DispatchAddressingFeatureTe String version = (String) request.getProperty(AddressingConstants.WS_ADDRESSING_VERSION); Boolean disabled = (Boolean) request.getProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES); + String responses = (String) request.getProperty(AddressingConstants.WSAM_INVOCATION_PATTERN_PARAMETER_NAME); assertNull(version); assertTrue(disabled); + assertNull(responses); org.apache.axis2.context.MessageContext axis2Request = request.getAxisMessageContext(); @@ -118,9 +120,11 @@ public class DispatchAddressingFeatureTe String version = (String) request.getProperty(AddressingConstants.WS_ADDRESSING_VERSION); Boolean disabled = (Boolean) request.getProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES); + String responses = (String) request.getProperty(AddressingConstants.WSAM_INVOCATION_PATTERN_PARAMETER_NAME); assertEquals(Final.WSA_NAMESPACE, version); assertFalse(disabled); + assertEquals("Wrong default responses", AddressingConstants.WSAM_INVOCATION_PATTERN_BOTH, responses); org.apache.axis2.context.MessageContext axis2Request = request.getAxisMessageContext(); Modified: axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/client/proxy/ProxyAddressingFeatureTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/client/proxy/ProxyAddressingFeatureTest.java?rev=938986&r1=938985&r2=938986&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/client/proxy/ProxyAddressingFeatureTest.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/client/proxy/ProxyAddressingFeatureTest.java Wed Apr 28 14:37:43 2010 @@ -85,9 +85,11 @@ public class ProxyAddressingFeatureTest String version = (String) request.getProperty(AddressingConstants.WS_ADDRESSING_VERSION); Boolean disabled = (Boolean) request.getProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES); + String responses = (String) request.getProperty(AddressingConstants.WSAM_INVOCATION_PATTERN_PARAMETER_NAME); assertNull(version); assertTrue(disabled); + assertNull(responses); org.apache.axis2.context.MessageContext axis2Request = request.getAxisMessageContext(); @@ -116,9 +118,11 @@ public class ProxyAddressingFeatureTest String version = (String) request.getProperty(AddressingConstants.WS_ADDRESSING_VERSION); Boolean disabled = (Boolean) request.getProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES); + String responses = (String) request.getProperty(AddressingConstants.WSAM_INVOCATION_PATTERN_PARAMETER_NAME); assertEquals(Final.WSA_NAMESPACE, version); assertFalse(disabled); + assertEquals("Wrong default responses", AddressingConstants.WSAM_INVOCATION_PATTERN_BOTH, responses); org.apache.axis2.context.MessageContext axis2Request = request.getAxisMessageContext(); Modified: axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/server/config/AddressingConfigurator.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/server/config/AddressingConfigurator.java?rev=938986&r1=938985&r2=938986&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/server/config/AddressingConfigurator.java (original) +++ axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/server/config/AddressingConfigurator.java Wed Apr 28 14:37:43 2010 @@ -166,7 +166,7 @@ public class AddressingConfigurator impl * @param responses Enum value from the Addressing.responses annotation attribute * @return String from AddressingContstants corresponding to the responses value. */ - static private String mapResponseAttributeToAddressing(Responses responses) { + static public String mapResponseAttributeToAddressing(Responses responses) { String addressingType = null; switch (responses) { case ALL: