Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 13566 invoked from network); 25 Feb 2010 16:11:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Feb 2010 16:11:54 -0000 Received: (qmail 83199 invoked by uid 500); 25 Feb 2010 16:11:54 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 83146 invoked by uid 500); 25 Feb 2010 16:11:54 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 83139 invoked by uid 99); 25 Feb 2010 16:11:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Feb 2010 16:11:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Feb 2010 16:11:52 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8130723889EB; Thu, 25 Feb 2010 16:11:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r916335 [2/2] - in /cxf/branches/2.2.x-fixes: ./ api/src/main/java/org/apache/cxf/endpoint/ api/src/main/java/org/apache/cxf/message/ api/src/main/java/org/apache/cxf/service/model/ common/common/src/main/java/org/apache/cxf/common/util/ rt... Date: Thu, 25 Feb 2010 16:11:31 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100225161132.8130723889EB@eris.apache.org> Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/HandlerChainInvokerTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/HandlerChainInvokerTest.java?rev=916335&r1=916334&r2=916335&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/HandlerChainInvokerTest.java (original) +++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/HandlerChainInvokerTest.java Thu Feb 25 16:11:29 2010 @@ -252,6 +252,10 @@ @Test public void testHandleMessageThrowsProtocolExceptionOutbound() { + message = new SoapMessage(message); + lmc = new LogicalMessageContextImpl(message); + pmc = new WrappedMessageContext(message); + ProtocolException pe = new ProtocolException("banzai"); protocolHandlers[2].setException(pe); @@ -265,7 +269,7 @@ //create an empty SOAP body for testing try { - pmc = new SOAPMessageContextImpl(new SoapMessage(message)); + pmc = new SOAPMessageContextImpl(message); MessageFactory factory = MessageFactory.newInstance(); SOAPMessage soapMessage = factory.createMessage(); ((SOAPMessageContext)pmc).setMessage(soapMessage); Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptorTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptorTest.java?rev=916335&r1=916334&r2=916335&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptorTest.java (original) +++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptorTest.java Thu Feb 25 16:11:29 2010 @@ -30,6 +30,7 @@ import javax.xml.ws.handler.LogicalMessageContext; import javax.xml.ws.handler.MessageContext; +import org.apache.cxf.helpers.CastUtils; import org.apache.cxf.interceptor.InterceptorChain; import org.apache.cxf.jaxws.handler.logical.LogicalHandlerInInterceptor; import org.apache.cxf.message.Exchange; @@ -85,6 +86,8 @@ return true; } }); + List hList = CastUtils.cast(list); + expect(binding.getHandlerChain()).andReturn(hList).anyTimes(); expect(invoker.getLogicalHandlers()).andReturn(list); expect(message.getExchange()).andReturn(exchange).anyTimes(); expect(message.get(Message.REQUESTOR_ROLE)).andReturn(Boolean.TRUE).anyTimes(); @@ -127,6 +130,8 @@ IMocksControl control1 = createNiceControl(); Binding binding1 = control1.createMock(Binding.class); + List hList = CastUtils.cast(list); + expect(binding1.getHandlerChain()).andReturn(hList).anyTimes(); Exchange exchange1 = control1.createMock(Exchange.class); expect(exchange1.get(HandlerChainInvoker.class)).andReturn(invoker1).anyTimes(); Message outMessage = new MessageImpl(); Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java?rev=916335&r1=916334&r2=916335&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java (original) +++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java Thu Feb 25 16:11:29 2010 @@ -124,6 +124,7 @@ IMocksControl control = createNiceControl(); Binding binding = control.createMock(Binding.class); + expect(binding.getHandlerChain()).andReturn(list).anyTimes(); Exchange exchange = control.createMock(Exchange.class); expect(exchange.get(HandlerChainInvoker.class)).andReturn(invoker).anyTimes(); SoapMessage message = new SoapMessage(new MessageImpl()); @@ -227,6 +228,7 @@ IMocksControl control = createNiceControl(); Binding binding = control.createMock(Binding.class); + expect(binding.getHandlerChain()).andReturn(list).anyTimes(); Exchange exchange = control.createMock(Exchange.class); expect(exchange.get(HandlerChainInvoker.class)).andReturn(invoker).anyTimes(); // This is to set direction to inbound @@ -326,6 +328,7 @@ IMocksControl control = createNiceControl(); Binding binding = control.createMock(Binding.class); + expect(binding.getHandlerChain()).andReturn(list).anyTimes(); Exchange exchange = control.createMock(Exchange.class); expect(exchange.get(HandlerChainInvoker.class)).andReturn(invoker).anyTimes(); SoapMessage message = new SoapMessage(new MessageImpl()); @@ -410,6 +413,7 @@ IMocksControl control = createNiceControl(); Binding binding = control.createMock(Binding.class); Exchange exchange = control.createMock(Exchange.class); + expect(binding.getHandlerChain()).andReturn(list).anyTimes(); expect(exchange.get(HandlerChainInvoker.class)).andReturn(invoker).anyTimes(); // This is to set direction to inbound expect(exchange.getOutMessage()).andReturn(null); @@ -461,9 +465,9 @@ IMocksControl control = createNiceControl(); Binding binding = control.createMock(Binding.class); + expect(binding.getHandlerChain()).andReturn(list).anyTimes(); SoapMessage message = control.createMock(SoapMessage.class); Exchange exchange = control.createMock(Exchange.class); - expect(binding.getHandlerChain()).andReturn(list); expect(message.getExchange()).andReturn(exchange).anyTimes(); expect(message.keySet()).andReturn(new HashSet()); expect(exchange.get(HandlerChainInvoker.class)).andReturn(invoker); Modified: cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java?rev=916335&r1=916334&r2=916335&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java (original) +++ cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java Thu Feb 25 16:11:29 2010 @@ -20,7 +20,6 @@ package org.apache.cxf.transport.http; import java.io.IOException; -import java.net.MalformedURLException; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; @@ -248,12 +247,8 @@ HttpURLConnectionFactory fac = null; boolean useHttps = false; - try { - if (address == null) { - address = configuredConduit.getAddress(); - } - } catch (MalformedURLException e) { - //ignore, just use info based on Tls + if (address == null) { + address = configuredConduit.getAddress(); } if (address != null && address.startsWith(HttpsURLConnectionFactory.HTTPS_URL_PROTOCOL_ID + ":/")) { Modified: cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=916335&r1=916334&r2=916335&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java (original) +++ cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java Thu Feb 25 16:11:29 2010 @@ -205,6 +205,7 @@ * is created on demand. */ private URL defaultEndpointURL; + private String defaultEndpointURLString; private boolean fromEndpointReferenceType; private Destination decoupledDestination; @@ -424,7 +425,7 @@ // Get the correct URLConnection factory based on the // configuration. - retrieveConnectionFactory(); + retrieveConnectionFactory(getAddress()); // We have finalized the configuration. Any configurable entity // set now, must make changes dynamically. @@ -450,7 +451,7 @@ * Factory get altered. */ protected synchronized void retrieveConnectionFactory() { - connectionFactory = AbstractHTTPTransportFactory.getConnectionFactory(this); + connectionFactory = AbstractHTTPTransportFactory.getConnectionFactory(this, getAddress()); } protected synchronized void retrieveConnectionFactory(String url) { connectionFactory = AbstractHTTPTransportFactory.getConnectionFactory(this, url); @@ -493,16 +494,15 @@ // protocol from the default set in EndpointInfo that is associated // with the Conduit. URL currentURL = setupURL(message); - + // The need to cache the request is off by default boolean needToCacheRequest = false; HTTPClientPolicy csPolicy = getClient(message); - HttpURLConnection connection = getConnectionFactory(currentURL) - .createConnection(getProxy(csPolicy), currentURL); + + HttpURLConnectionFactory f = getConnectionFactory(currentURL); + HttpURLConnection connection = f.createConnection(getProxy(csPolicy), currentURL); connection.setDoOutput(true); - - //TODO using Message context to decided HTTP send properties long timeout = csPolicy.getConnectionTimeout(); if (timeout > Integer.MAX_VALUE) { @@ -529,7 +529,7 @@ } else { connection.setRequestMethod("POST"); } - + boolean isChunking = false; int chunkThreshold = 0; // We must cache the request if we have basic auth supplier @@ -569,8 +569,7 @@ connection.setChunkedStreamingMode(-1); } } - - + //Do we need to maintain a session? maintainSession = Boolean.TRUE.equals((Boolean)message.get(Message.MAINTAIN_SESSION)); @@ -610,15 +609,14 @@ // Set the headers on the message according to configured // client side policy. setHeadersByPolicy(message, currentURL, headers); - - message.setContent(OutputStream.class, - new WrappedOutputStream( - message, connection, - needToCacheRequest, - isChunking, - chunkThreshold)); - + + message.setContent(OutputStream.class, + new WrappedOutputStream( + message, connection, + needToCacheRequest, + isChunking, + chunkThreshold)); // We are now "ready" to "send" the message. } @@ -658,11 +656,8 @@ * established by the configured MessageTrustDecider. * @see MessageTrustDecider */ - private void makeTrustDecision(Message message) + private void makeTrustDecision(Message message, HttpURLConnection connection) throws IOException { - - HttpURLConnection connection = - (HttpURLConnection) message.get(KEY_HTTP_CONNECTION); MessageTrustDecider decider2 = message.get(MessageTrustDecider.class); if (trustDecider != null || decider2 != null) { @@ -744,7 +739,7 @@ if (result == null) { if (pathInfo == null && queryString == null) { URL url = getURL(); - message.put(Message.ENDPOINT_ADDRESS, url.toString()); + message.put(Message.ENDPOINT_ADDRESS, defaultEndpointURLString); return url; } result = getURL().toString(); @@ -803,9 +798,9 @@ /** * @return the default target address */ - protected String getAddress() throws MalformedURLException { + protected String getAddress() { if (defaultEndpointURL != null) { - return defaultEndpointURL.toExternalForm(); + return defaultEndpointURLString; } else if (fromEndpointReferenceType) { return getTarget().getAddress().getValue(); } @@ -815,8 +810,11 @@ /** * @return the default target URL */ - protected synchronized URL getURL() throws MalformedURLException { - return getURL(true); + protected URL getURL() throws MalformedURLException { + if (defaultEndpointURL == null) { + return getURL(true); + } + return defaultEndpointURL; } /** @@ -828,12 +826,14 @@ if (defaultEndpointURL == null && createOnDemand) { if (fromEndpointReferenceType && getTarget().getAddress().getValue() != null) { defaultEndpointURL = new URL(this.getTarget().getAddress().getValue()); + defaultEndpointURLString = defaultEndpointURL.toExternalForm(); return defaultEndpointURL; } if (endpointInfo.getAddress() == null) { throw new MalformedURLException("Invalid address. Endpoint address cannot be null."); } defaultEndpointURL = new URL(endpointInfo.getAddress()); + defaultEndpointURLString = defaultEndpointURL.toExternalForm(); } return defaultEndpointURL; } @@ -927,9 +927,9 @@ HttpURLConnection connection = (HttpURLConnection)message.get(KEY_HTTP_CONNECTION); - String ct = (String) message.get(Message.CONTENT_TYPE); - String enc = (String) message.get(Message.ENCODING); - + String ct = (String)message.get(Message.CONTENT_TYPE); + String enc = (String)message.get(Message.ENCODING); + if (null != ct) { if (enc != null && ct.indexOf("charset=") == -1 @@ -1399,7 +1399,7 @@ // If this is called after the HTTPTransportFactory called // finalizeConfig, we need to update the connection factory. if (configFinalized) { - retrieveConnectionFactory(); + retrieveConnectionFactory(getAddress()); } } @@ -1715,7 +1715,7 @@ // makeTrustDecision needs to make a connect() call to // make sure the proper information is available. // - makeTrustDecision(message); + makeTrustDecision(message, connection); // If this is a GET method we must not touch the output // stream as this automagically turns the request into a POST. @@ -1929,7 +1929,7 @@ // makeTrustDecision needs to make a connect() call to // make sure the proper information is available. // - makeTrustDecision(outMessage); + makeTrustDecision(outMessage, connection); // Trust is okay, set up for writing the request. @@ -1975,10 +1975,10 @@ if (!written) { handleHeadersTrustCaching(); } - super.flush(); if (!cachingForRetransmission) { super.close(); } else if (cachedStream != null) { + super.flush(); cachedStream.getOut().close(); cachedStream.closeFlowthroughStream(); } @@ -2151,9 +2151,10 @@ } } protected void handleResponseInternal() throws IOException { + Exchange exchange = outMessage.getExchange(); int responseCode = connection.getResponseCode(); - if ((outMessage != null) && (outMessage.getExchange() != null)) { - outMessage.getExchange().put(Message.RESPONSE_CODE, responseCode); + if (outMessage != null && exchange != null) { + exchange.put(Message.RESPONSE_CODE, responseCode); } if (LOG.isLoggable(Level.FINE)) { @@ -2176,7 +2177,6 @@ LOG.fine(buf.toString()); } } - if (responseCode == HttpURLConnection.HTTP_NOT_FOUND && !MessageUtils.isTrue(outMessage.getContextualProperty( @@ -2186,7 +2186,6 @@ } - Exchange exchange = outMessage.getExchange(); InputStream in = null; if (isOneway(exchange) || isDecoupled()) { @@ -2209,13 +2208,13 @@ Message inMessage = new MessageImpl(); inMessage.setExchange(exchange); - + Map> origHeaders = connection.getHeaderFields(); Map> headers = new HashMap>(); for (String key : connection.getHeaderFields().keySet()) { if (key != null) { headers.put(HttpHeaderHelper.getHeaderKey(key), - connection.getHeaderFields().get(key)); + origHeaders.get(key)); } } @@ -2231,8 +2230,7 @@ LOG.log(Level.WARNING, m); throw new IOException(m); } - - inMessage.put(Message.ENCODING, normalizedEncoding); + inMessage.put(Message.ENCODING, normalizedEncoding); if (maintainSession) { List cookies = connection.getHeaderFields().get("Set-Cookie"); @@ -2245,7 +2243,6 @@ : connection.getErrorStream() : in; } - // if (in == null) : it's perfectly ok for non-soap http services // have no response body : those interceptors which do need it will check anyway inMessage.setContent(InputStream.class, in); @@ -2255,7 +2252,6 @@ } - } /** @@ -2297,7 +2293,6 @@ } catch (IOException e) { e.printStackTrace(); } - } } Modified: cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java?rev=916335&r1=916334&r2=916335&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java (original) +++ cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java Thu Feb 25 16:11:29 2010 @@ -77,8 +77,8 @@ if (pol != null) { return intersect(pol, confPolicy); } - AssertionInfoMap amap = message.get(AssertionInfoMap.class); - if (null == amap) { + AssertionInfoMap amap = message.get(AssertionInfoMap.class); + if (null == amap || amap.isEmpty()) { return confPolicy; } Collection ais = amap.get(HTTPCLIENTPOLICY_ASSERTION_QNAME); Modified: cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java?rev=916335&r1=916334&r2=916335&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java (original) +++ cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java Thu Feb 25 16:11:29 2010 @@ -146,6 +146,8 @@ } message.getExchange().get(Endpoint.class).put(SecurityConstants.TOKEN_ID, tok.getId()); + message.getExchange().put(SecurityConstants.TOKEN_ID, + tok.getId()); getTokenStore(message).add(tok); } } else { Modified: cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java (original) +++ cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java Thu Feb 25 16:11:29 2010 @@ -233,6 +233,7 @@ policy, null); endpoint.getEndpointInfo().setProperty(TokenStore.class.getName(), store); + message.getExchange().put(TokenStore.class.getName(), store); EndpointPolicy ep = pe.getServerEndpointPolicy(endpoint.getEndpointInfo(), destination); List interceptors = ep.getInterceptors(); Modified: cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationOutInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationOutInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationOutInterceptor.java (original) +++ cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationOutInterceptor.java Thu Feb 25 16:11:29 2010 @@ -75,6 +75,8 @@ } message.getExchange().get(Endpoint.class).put(SecurityConstants.TOKEN_ID, tok.getId()); + message.getExchange().put(SecurityConstants.TOKEN_ID, + tok.getId()); SecureConversationTokenInterceptorProvider.getTokenStore(message).add(tok); } Modified: cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java?rev=916335&r1=916334&r2=916335&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java (original) +++ cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java Thu Feb 25 16:11:29 2010 @@ -107,6 +107,7 @@ tokenStore = new MemoryTokenStore(); message.getExchange().get(Endpoint.class).getEndpointInfo() .setProperty(TokenStore.class.getName(), tokenStore); + message.getExchange().put(TokenStore.class.getName(), tokenStore); } return tokenStore; } Modified: cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java?rev=916335&r1=916334&r2=916335&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java (original) +++ cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java Thu Feb 25 16:11:29 2010 @@ -569,6 +569,7 @@ ptoken.setToken(sct); SignedEncryptedParts parts = new SignedEncryptedParts(true); + parts.setOptional(true); parts.setBody(true); parts.addHeader(new Header("To", addressingNamespace)); parts.addHeader(new Header("From", addressingNamespace)); Modified: cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java?rev=916335&r1=916334&r2=916335&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java (original) +++ cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java Thu Feb 25 16:11:29 2010 @@ -332,6 +332,9 @@ synchronized (info) { TokenStore tokenStore = (TokenStore)message.getContextualProperty(TokenStore.class.getName()); if (tokenStore == null) { + tokenStore = (TokenStore)info.getProperty(TokenStore.class.getName()); + } + if (tokenStore == null) { tokenStore = new MemoryTokenStore(); info.setProperty(TokenStore.class.getName(), tokenStore); } Modified: cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/DispatchHandlerInvocationTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/DispatchHandlerInvocationTest.java?rev=916335&r1=916334&r2=916335&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/DispatchHandlerInvocationTest.java (original) +++ cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/DispatchHandlerInvocationTest.java Thu Feb 25 16:11:29 2010 @@ -207,8 +207,7 @@ Dispatch disp = service.createDispatch(portNameXML, DOMSource.class, Mode.MESSAGE); TestHandlerXMLBinding handler = new TestHandlerXMLBinding(); - TestSOAPHandler soapHandler = new TestSOAPHandler(); - addHandlersProgrammatically(disp, handler, soapHandler); + addHandlersProgrammatically(disp, handler); InputStream is = getClass().getResourceAsStream("/messages/XML_GreetMeDocLiteralReq.xml"); MessageFactory factory = MessageFactory.newInstance(); @@ -230,8 +229,7 @@ Dispatch disp = service.createDispatch(portNameXML, DOMSource.class, Mode.PAYLOAD); TestHandlerXMLBinding handler = new TestHandlerXMLBinding(); - TestSOAPHandler soapHandler = new TestSOAPHandler(); - addHandlersProgrammatically(disp, handler, soapHandler); + addHandlersProgrammatically(disp, handler); InputStream is = getClass().getResourceAsStream("/messages/XML_GreetMeDocLiteralReq.xml"); MessageFactory factory = MessageFactory.newInstance(); @@ -253,8 +251,7 @@ Dispatch disp = service.createDispatch(portNameXML, DataSource.class, Mode.MESSAGE); TestHandlerXMLBinding handler = new TestHandlerXMLBinding(); - TestSOAPHandler soapHandler = new TestSOAPHandler(); - addHandlersProgrammatically(disp, handler, soapHandler); + addHandlersProgrammatically(disp, handler); URL is = getClass().getResource("/messages/XML_GreetMeDocLiteralReq.xml"); DataSource ds = new URLDataSource(is); @@ -278,8 +275,7 @@ Dispatch disp = service.createDispatch(portNameXML, DataSource.class, Mode.PAYLOAD); TestHandlerXMLBinding handler = new TestHandlerXMLBinding(); - TestSOAPHandler soapHandler = new TestSOAPHandler(); - addHandlersProgrammatically(disp, handler, soapHandler); + addHandlersProgrammatically(disp, handler); URL is = getClass().getResource("/messages/XML_GreetMeDocLiteralReq.xml"); DataSource ds = new URLDataSource(is); @@ -305,8 +301,7 @@ Dispatch disp = service.createDispatch(portNameXML, jc, Mode.MESSAGE); TestHandlerXMLBinding handler = new TestHandlerXMLBinding(); - TestSOAPHandler soapHandler = new TestSOAPHandler(); - addHandlersProgrammatically(disp, handler, soapHandler); + addHandlersProgrammatically(disp, handler); org.apache.hello_world_xml_http.wrapped.types.GreetMe req = new org.apache.hello_world_xml_http.wrapped.types.GreetMe(); @@ -331,8 +326,7 @@ Dispatch disp = service.createDispatch(portNameXML, jc, Mode.PAYLOAD); TestHandlerXMLBinding handler = new TestHandlerXMLBinding(); - TestSOAPHandler soapHandler = new TestSOAPHandler(); - addHandlersProgrammatically(disp, handler, soapHandler); + addHandlersProgrammatically(disp, handler); org.apache.hello_world_xml_http.wrapped.types.GreetMe req = new org.apache.hello_world_xml_http.wrapped.types.GreetMe(); @@ -351,6 +345,7 @@ for (Handler h : handlers) { handlerChain.add(h); } + bp.getBinding().setHandlerChain(handlerChain); } class TestHandler implements LogicalHandler { Modified: cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java?rev=916335&r1=916334&r2=916335&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java (original) +++ cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java Thu Feb 25 16:11:29 2010 @@ -1187,6 +1187,7 @@ for (Handler h : handlers) { handlerChain.add(h); } + bp.getBinding().setHandlerChain(handlerChain); } List getHandlerNames(SOAPBody soapBody) throws Exception { Modified: cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationUsingAddNumbersTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationUsingAddNumbersTest.java?rev=916335&r1=916334&r2=916335&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationUsingAddNumbersTest.java (original) +++ cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationUsingAddNumbersTest.java Thu Feb 25 16:11:29 2010 @@ -168,7 +168,8 @@ assertNotNull(handlerChain); for (Handler h : handlers) { handlerChain.add(h); - } + } + bp.getBinding().setHandlerChain(handlerChain); } } Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java?rev=916335&r1=916334&r2=916335&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java (original) +++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java Thu Feb 25 16:11:29 2010 @@ -361,7 +361,8 @@ // REVISIT: why doesn't the generic (i.e. non-Port-specific) // Service.getPort() load the configuration? greeter = cs.getReplicatedPortA(); - assertTrue("unexpected conduit slector", + assertTrue("unexpected conduit selector: " + + ClientProxy.getClient(greeter).getConduitSelector().getClass().getName(), ClientProxy.getClient(greeter).getConduitSelector() instanceof FailoverTargetSelector); } Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java?rev=916335&r1=916334&r2=916335&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java (original) +++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java Thu Feb 25 16:11:29 2010 @@ -193,7 +193,7 @@ Service service = serviceFactory.create(); EndpointInfo ei = service.getEndpointInfo(portName); JaxWsEndpointImpl jaxwsEndpoint = new JaxWsEndpointImpl(bus, service, ei); - SOAPBinding jaxWsSoapBinding = new SOAPBindingImpl(ei.getBinding()); + SOAPBinding jaxWsSoapBinding = new SOAPBindingImpl(ei.getBinding(), jaxwsEndpoint); jaxWsSoapBinding.setMTOMEnabled(enableMTOM); if (installInterceptors) { Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopWithJMSTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopWithJMSTest.java?rev=916335&r1=916334&r2=916335&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopWithJMSTest.java (original) +++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopWithJMSTest.java Thu Feb 25 16:11:29 2010 @@ -126,7 +126,7 @@ Service service = serviceFactory.create(); EndpointInfo ei = service.getEndpointInfo(portName); JaxWsEndpointImpl jaxwsEndpoint = new JaxWsEndpointImpl(bus, service, ei); - SOAPBinding jaxWsSoapBinding = new SOAPBindingImpl(ei.getBinding()); + SOAPBinding jaxWsSoapBinding = new SOAPBindingImpl(ei.getBinding(), jaxwsEndpoint); jaxWsSoapBinding.setMTOMEnabled(enableMTOM); jaxwsEndpoint.getBinding().getInInterceptors().add(new TestMultipartMessageInterceptor());