svn commit: r941042 - in /axis/axis2/java/core/trunk/modules: jaxws-integration/ jaxws-integration/test/org/apache/axis2/jaxws/jaxb/string/ jaxws/src/org/apache/axis2/datasource/jaxb/ jaxws/src/org/ap
Author: scheu Date: Tue May 4 21:00:24 2010 New Revision: 941042 URL: http://svn.apache.org/viewvc?rev=941042&view=rev Log: AXIS2-4702 Contributor:Rich Scheuerle Kudos to Tom Link for informing of this problem. Added code to properly set and reset the JAXB_ENCODING. Added a test case to validate the code. Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/string/JAXBStringUTF8Tests.java axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBDSContext.java axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtils.java Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml?rev=941042&r1=941041&r2=941042&view=diff == --- axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml (original) +++ axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml Tue May 4 21:00:24 2010 @@ -1410,6 +1410,8 @@ **/SOAP12DispatchTest.java **/OMElementDispatchTest.java **/JAXBContextTest.java +**/JAXBStringUTF16Tests.java +**/JAXBStringUTF8Tests.java **/StringProviderTests.java **/SOAPFaultProviderTests.java Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/string/JAXBStringUTF8Tests.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/string/JAXBStringUTF8Tests.java?rev=941042&r1=941041&r2=941042&view=diff == --- axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/string/JAXBStringUTF8Tests.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/string/JAXBStringUTF8Tests.java Tue May 4 21:00:24 2010 @@ -27,6 +27,16 @@ public class JAXBStringUTF8Tests extends runTest("a simple string"); } +public void testSimpleStringSwitchEncoding() throws Exception { +String input = "a simple string"; +String output = "a simple string"; + +// Run with different encodings to verify proper processing. +runTestWithEncoding(input, output, null); // no encoding means to use default, UTF-8 +runTestWithEncoding(input, output, "UTF-16"); // Make a call with UTF-16 +runTestWithEncoding(input, output, null); // now try again...using default, UTF-8 +} + public void testStringWithApostrophes() throws Exception { runTest("this isn't a simple string"); } @@ -74,16 +84,20 @@ public class JAXBStringUTF8Tests extends } private void runTestWithUTF8(String input, String output) { -runTestWithEncoding(input, output); +runTestWithEncoding(input, output, null); // no encoding means to use default, UTF-8 } -private void runTestWithEncoding(String input, String output) { +private void runTestWithEncoding(String input, String output, String encoding) { TestLogger.logger.debug("Test : " + getName()); try { JAXBStringPortType myPort = (new JAXBStringService()).getJAXBStringPort(); BindingProvider p = (BindingProvider) myPort; p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint); +if (encoding != null) { + p.getRequestContext().put(org.apache.axis2.Constants.Configuration.CHARACTER_SET_ENCODING, encoding); +} + Echo request = new Echo(); request.setArg(input); EchoResponse response = myPort.echoString(request); @@ -94,4 +108,5 @@ public class JAXBStringUTF8Tests extends fail(); } } + } Modified: axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBDSContext.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBDSContext.java?rev=941042&r1=941041&r2=941042&view=diff == --- axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBDSContext.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBDSContext.java Tue May 4 21:00:24 2010 @@ -371,12 +371,33 @@ public class JAXBDSContext { Marshaller m = JAXBUtils.getJAXBMarshaller(jbc); if (writer instanceof MTOMXMLStreamWriter && ((MTOMXMLStreamWriter) writer).getO
svn commit: r941108 - in /axis/axis2/java/core/trunk/modules/jaxws: src/org/apache/axis2/jaxws/client/config/ src/org/apache/axis2/jaxws/client/proxy/ test/org/apache/axis2/jaxws/client/proxy/
Author: barrettj Date: Tue May 4 23:44:34 2010 New Revision: 941108 URL: http://svn.apache.org/viewvc?rev=941108&view=rev Log: Add client-side enablement for AddressingFeature.required set via AddressingFeature on the factory methods or via metadata. Update associated tests. Modified: axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/client/config/AddressingConfigurator.java axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/client/proxy/ProxyAddressingFeatureTest.java axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/client/proxy/ProxyAddressingMetadataTest.java 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=941108&r1=941107&r2=941108&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 Tue May 4 23:44:34 2010 @@ -60,6 +60,7 @@ public class AddressingConfigurator impl String addressingNamespace = bnd.getAddressingNamespace(); Boolean disableAddressing = (Boolean) messageContext.getProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES); +String addressingRequired = AddressingConstants.ADDRESSING_UNSPECIFIED; //Figure out which WS-Addressing feature was specified causing this configurator to run. if (addressingFeature != null && submissionAddressingFeature != null) { @@ -75,6 +76,9 @@ public class AddressingConfigurator impl addressingNamespace = Final.WSA_NAMESPACE; disableAddressing = Boolean.FALSE; +if (addressingFeature.isRequired() || submissionAddressingFeature.isRequired()) { +addressingRequired = AddressingConstants.ADDRESSING_REQUIRED; +} } else if (w3cAddressingEnabled) { //Enable only 2005/08 addressing @@ -85,6 +89,9 @@ public class AddressingConfigurator impl } addressingNamespace = Final.WSA_NAMESPACE; disableAddressing = Boolean.FALSE; +if (addressingFeature.isRequired()) { +addressingRequired = AddressingConstants.ADDRESSING_REQUIRED; +} } else if (submissionAddressingEnabled) { //Enable only 2004/08 addressing @@ -95,6 +102,9 @@ public class AddressingConfigurator impl } addressingNamespace = Submission.WSA_NAMESPACE; disableAddressing = Boolean.FALSE; +if (submissionAddressingFeature.isRequired()) { +addressingRequired = AddressingConstants.ADDRESSING_REQUIRED; +} } else { //Disable 2005/08 and 2004/08 addressing @@ -114,6 +124,9 @@ public class AddressingConfigurator impl } addressingNamespace = Final.WSA_NAMESPACE; disableAddressing = Boolean.FALSE; +if (addressingFeature.isRequired()) { +addressingRequired = AddressingConstants.ADDRESSING_REQUIRED; +} } else { //Disable 2005/08 addressing @@ -133,6 +146,9 @@ public class AddressingConfigurator impl } addressingNamespace = Submission.WSA_NAMESPACE; disableAddressing = Boolean.FALSE; +if (submissionAddressingFeature.isRequired()) { +addressingRequired = AddressingConstants.ADDRESSING_REQUIRED; +} } else { //Disable 2004/08 addressing @@ -167,6 +183,7 @@ public class AddressingConfigurator impl messageContext.setProperty(AddressingConstants.WS_ADDRESSING_VERSION, addressingNamespace); messageContext.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, disableAddressing); + messageContext.setProperty(AddressingConstants.ADDRESSING_REQUIREMENT_PARAMETER, addressingRequired); // If the Addressing feature was specified, then get the responses value from it and map to the value // the addressing handler expects Modified: axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java URL: http://svn.apache.org/viewvc/axi