Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 36339 invoked from network); 16 Jul 2009 16:27:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Jul 2009 16:27:38 -0000 Received: (qmail 57955 invoked by uid 500); 16 Jul 2009 16:28:43 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 57849 invoked by uid 500); 16 Jul 2009 16:28:43 -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 57840 invoked by uid 99); 16 Jul 2009 16:28:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jul 2009 16:28:43 +0000 X-ASF-Spam-Status: No, hits=-1998.5 required=10.0 tests=ALL_TRUSTED,WEIRD_PORT 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, 16 Jul 2009 16:28:34 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8B81C2388982; Thu, 16 Jul 2009 16:28:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r794735 - in /cxf/branches/2.2.x-fixes: ./ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ rt/core/src/main/java/org/apache/cxf/interceptor/ rt/core/src/mai... Date: Thu, 16 Jul 2009 16:28:13 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090716162814.8B81C2388982@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Thu Jul 16 16:28:13 2009 New Revision: 794735 URL: http://svn.apache.org/viewvc?rev=794735&view=rev Log: Merged revisions 794728 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r794728 | dkulp | 2009-07-16 12:02:40 -0400 (Thu, 16 Jul 2009) | 5 lines [CXF-2336] Fix issues with SOAP 1.1/1.2 mixed cases. 1) Soap 1.2 message sent to Soap 1.1 only endpoint should result in VersionMismatch 2) Soap 1.1 message sent to Soap 1.2 should process, but return as Soap 1.1 ........ Added: cxf/branches/2.2.x-fixes/testutils/src/main/java/org/apache/hello_world_soap_http/BaseGreeterImpl.java - copied unchanged from r794728, cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/BaseGreeterImpl.java Modified: cxf/branches/2.2.x-fixes/ (props changed) cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Messages.properties cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultInInterceptor.java cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java cxf/branches/2.2.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java cxf/branches/2.2.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/Server.java cxf/branches/2.2.x-fixes/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java Propchange: cxf/branches/2.2.x-fixes/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Jul 16 16:28:13 2009 @@ -1 +1 @@ -/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786395,786512,786514,786582-786583,786638,786647,786850,787200,787269,787277-787279,787290-787291,787305,787323,787366,787849,788030,788060,788187,788444,788451,788703,788752,788774,788819-788820,789013,789371,789387,789420,789527-789530,789704-789705,789788,789811,789896-789901,790074,790094,790134,790188,790294,790553,790637-790644,790868,791301,791354,791538,791753,791947,792007,792096,792183,792261-792265,792271,792604,792683-792685,792975,792985,793059,793570,794297,794396,794680 +/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786395,786512,786514,786582-786583,786638,786647,786850,787200,787269,787277-787279,787290-787291,787305,787323,787366,787849,788030,788060,788187,788444,788451,788703,788752,788774,788819-788820,789013,789371,789387,789420,789527-789530,789704-789705,789788,789811,789896-789901,790074,790094,790134,790188,790294,790553,790637-790644,790868,791301,791354,791538,791753,791947,792007,792096,792183,792261-792265,792271,792604,792683-792685,792975,792985,793059,793570,794297,794396,794680,794728 Propchange: cxf/branches/2.2.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java?rev=794735&r1=794734&r2=794735&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java (original) +++ cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java Thu Jul 16 16:28:13 2009 @@ -57,10 +57,18 @@ public Message createMessage(Message m) { SoapMessage soapMessage = new SoapMessage(m); - soapMessage.setVersion(version); + if (m.getExchange() != null) { + if (m.getExchange().getInMessage() instanceof SoapMessage) { + soapMessage.setVersion(((SoapMessage)m.getExchange().getInMessage()).getVersion()); + } else { + soapMessage.setVersion(version); + } + } else { + soapMessage.setVersion(version); + } if (!soapMessage.containsKey(Message.CONTENT_TYPE)) { - soapMessage.put(Message.CONTENT_TYPE, version.getContentType()); + soapMessage.put(Message.CONTENT_TYPE, soapMessage.getVersion().getContentType()); } return soapMessage; Modified: cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?rev=794735&r1=794734&r2=794735&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java (original) +++ cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java Thu Jul 16 16:28:13 2009 @@ -382,7 +382,7 @@ } sb.getInInterceptors().add(new SoapHeaderInterceptor()); - sb.getInInterceptors().add(new ReadHeadersInterceptor(getBus())); + sb.getInInterceptors().add(new ReadHeadersInterceptor(getBus(), version)); sb.getInInterceptors().add(new CheckFaultInterceptor()); sb.getInInterceptors().add(new MustUnderstandInterceptor()); sb.getOutInterceptors().add(new SoapPreProtocolOutInterceptor()); @@ -809,7 +809,8 @@ // This will not work if we one of the endpoints disables message // processing. But, if you've disabled message processing, you // probably aren't going to use this feature. - newMO.getBindingInterceptors().add(new ReadHeadersInterceptor(getBus())); + + newMO.getBindingInterceptors().add(new ReadHeadersInterceptor(getBus(), (SoapVersion)null)); newMO.getBindingInterceptors().add(new CheckFaultInterceptor()); // Add in a default selection interceptor Modified: cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Messages.properties URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Messages.properties?rev=794735&r1=794734&r2=794735&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Messages.properties (original) +++ cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Messages.properties Thu Jul 16 16:28:13 2009 @@ -26,6 +26,7 @@ NO_OPERATION=No such operation: {0} ATTACHMENT_IO=Attachment IO Exception: {0} INVALID_VERSION="{0}", the namespace on the "{1}" element, is not a valid SOAP version. +INVALID_11_VERSION=A SOAP 1.2 message is not valid when sent to a SOAP 1.1 only endpoint. NO_NAMESPACE=No namespace on "{0}" element. BP_2211_RPCLIT_CANNOT_BE_NULL=Cannot write part {0}. RPC/Literal parts cannot be null. (WS-I BP R2211) UNKNOWN_RPC_LIT_PART=Found element {0} but could not find matching RPC/Literal part \ No newline at end of file Modified: cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java?rev=794735&r1=794734&r2=794735&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java (original) +++ cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java Thu Jul 16 16:28:13 2009 @@ -37,6 +37,7 @@ import org.apache.cxf.Bus; import org.apache.cxf.binding.soap.Soap11; +import org.apache.cxf.binding.soap.Soap12; import org.apache.cxf.binding.soap.SoapFault; import org.apache.cxf.binding.soap.SoapHeader; import org.apache.cxf.binding.soap.SoapMessage; @@ -58,10 +59,16 @@ private static final Logger LOG = LogUtils.getL7dLogger(ReadHeadersInterceptor.class); private Bus bus; + private SoapVersion version; public ReadHeadersInterceptor(Bus b) { super(Phase.READ); bus = b; } + public ReadHeadersInterceptor(Bus b, SoapVersion v) { + super(Phase.READ); + version = v; + bus = b; + } public ReadHeadersInterceptor(Bus b, String phase) { super(phase); bus = b; @@ -95,6 +102,11 @@ throw new SoapFault(new Message("INVALID_VERSION", LOG, ns, xmlReader.getLocalName()), Soap11.getInstance().getVersionMismatch()); } + if (soapVersion == Soap12.getInstance() + && version == Soap11.getInstance()) { + throw new SoapFault(new Message("INVALID_11_VERSION", LOG, ns, xmlReader.getLocalName()), + Soap11.getInstance().getVersionMismatch()); + } message.setVersion(soapVersion); XMLStreamReader filteredReader = new PartialXMLStreamReader(xmlReader, message.getVersion() Modified: cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultInInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultInInterceptor.java?rev=794735&r1=794734&r2=794735&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultInInterceptor.java (original) +++ cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultInInterceptor.java Thu Jul 16 16:28:13 2009 @@ -31,6 +31,7 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; +import org.apache.cxf.binding.soap.Soap11; import org.apache.cxf.binding.soap.Soap12; import org.apache.cxf.binding.soap.SoapFault; import org.apache.cxf.binding.soap.SoapMessage; @@ -50,6 +51,10 @@ } public void handleMessage(SoapMessage message) throws Fault { + if (message.getVersion() == Soap11.getInstance()) { + new Soap11FaultInInterceptor().handleMessage(message); + return; + } XMLStreamReader reader = message.getContent(XMLStreamReader.class); message.setContent(Exception.class, unmarshalFault(message, reader)); } Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java?rev=794735&r1=794734&r2=794735&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java (original) +++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java Thu Jul 16 16:28:13 2009 @@ -27,6 +27,7 @@ import org.apache.cxf.endpoint.Endpoint; import org.apache.cxf.message.Exchange; import org.apache.cxf.message.Message; +import org.apache.cxf.message.MessageImpl; import org.apache.cxf.phase.AbstractPhaseInterceptor; import org.apache.cxf.phase.Phase; import org.apache.cxf.transport.Conduit; @@ -97,7 +98,9 @@ Endpoint ep = exchange.get(Endpoint.class); Message msg = null; if (ep != null) { - msg = ep.getBinding().createMessage(); + msg = new MessageImpl(); + msg.setExchange(exchange); + msg = ep.getBinding().createMessage(msg); } return msg; } Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java?rev=794735&r1=794734&r2=794735&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java (original) +++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java Thu Jul 16 16:28:13 2009 @@ -28,6 +28,7 @@ import org.apache.cxf.message.Exchange; import org.apache.cxf.message.Message; import org.apache.cxf.message.MessageContentsList; +import org.apache.cxf.message.MessageImpl; import org.apache.cxf.phase.AbstractPhaseInterceptor; import org.apache.cxf.phase.Phase; import org.apache.cxf.service.Service; @@ -60,7 +61,9 @@ Message outMessage = runableEx.getOutMessage(); if (outMessage == null) { - outMessage = ep.getBinding().createMessage(); + outMessage = new MessageImpl(); + outMessage.setExchange(exchange); + outMessage = ep.getBinding().createMessage(outMessage); exchange.setOutMessage(outMessage); } copyJaxwsProperties(message, outMessage); Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java?rev=794735&r1=794734&r2=794735&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java (original) +++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java Thu Jul 16 16:28:13 2009 @@ -70,8 +70,8 @@ Exchange exchange = message.getExchange(); if (exchange == null) { exchange = new ExchangeImpl(); - exchange.setInMessage(message); } + exchange.setInMessage(message); setExchangeProperties(exchange, message); // setup chain Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java?rev=794735&r1=794734&r2=794735&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java (original) +++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java Thu Jul 16 16:28:13 2009 @@ -28,7 +28,9 @@ import java.util.concurrent.Future; import java.util.logging.Logger; +import javax.xml.soap.SOAPConstants; import javax.xml.soap.SOAPException; +import javax.xml.soap.SOAPFactory; import javax.xml.soap.SOAPFault; import javax.xml.ws.AsyncHandler; import javax.xml.ws.Binding; @@ -189,6 +191,16 @@ } if (ex instanceof SoapFault) { + if (!soapFault.getNamespaceURI().equals(((SoapFault)ex).getFaultCode().getNamespaceURI()) + && SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE + .equals(((SoapFault)ex).getFaultCode().getNamespaceURI())) { + //change to 1.1 + try { + soapFault = SOAPFactory.newInstance().createFault(); + } catch (Throwable t) { + //ignore + } + } soapFault.setFaultString(((SoapFault)ex).getReason()); soapFault.setFaultCode(((SoapFault)ex).getFaultCode()); soapFault.setFaultActor(((SoapFault)ex).getRole()); Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java?rev=794735&r1=794734&r2=794735&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java (original) +++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java Thu Jul 16 16:28:13 2009 @@ -276,7 +276,9 @@ } if (m == null) { Endpoint ep = exchange.get(Endpoint.class); - m = ep.getBinding().createMessage(); + m = new org.apache.cxf.message.MessageImpl(); + m.setExchange(exchange); + m = ep.getBinding().createMessage(m); exchange.setInMessage(m); } } else { Modified: cxf/branches/2.2.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?rev=794735&r1=794734&r2=794735&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java (original) +++ cxf/branches/2.2.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java Thu Jul 16 16:28:13 2009 @@ -45,6 +45,7 @@ import org.apache.cxf.interceptor.OutgoingChainInterceptor; import org.apache.cxf.message.Exchange; import org.apache.cxf.message.Message; +import org.apache.cxf.message.MessageImpl; import org.apache.cxf.service.model.BindingFaultInfo; import org.apache.cxf.service.model.BindingOperationInfo; import org.apache.cxf.service.model.Extensible; @@ -380,16 +381,17 @@ new PreexistingConduitSelector(backChannel, exchange.get(Endpoint.class))); - if (!partialResponse.getInterceptorChain().doIntercept(partialResponse) - && partialResponse.getContent(Exception.class) != null) { + if (chain != null && !chain.doIntercept(partialResponse) + && partialResponse.getContent(Exception.class) != null) { if (partialResponse.getContent(Exception.class) instanceof Fault) { throw (Fault)partialResponse.getContent(Exception.class); } else { throw new Fault(partialResponse.getContent(Exception.class)); } } - - partialResponse.getInterceptorChain().reset(); + if (chain != null) { + chain.reset(); + } exchange.put(ConduitSelector.class, new NullConduitSelector()); if (fullResponse != null) { exchange.setOutMessage(fullResponse); @@ -825,7 +827,11 @@ Endpoint ep = exchange.get(Endpoint.class); Message msg = null; if (ep != null) { - msg = ep.getBinding().createMessage(); + msg = new MessageImpl(); + msg.setExchange(exchange); + if (ep.getBinding() != null) { + msg = ep.getBinding().createMessage(msg); + } } return msg; } Modified: cxf/branches/2.2.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java?rev=794735&r1=794734&r2=794735&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java (original) +++ cxf/branches/2.2.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java Thu Jul 16 16:28:13 2009 @@ -29,16 +29,21 @@ import javax.xml.namespace.QName; import javax.xml.ws.RequestWrapper; import javax.xml.ws.ResponseWrapper; + //import javax.xml.ws.RequestWrapper; //import javax.xml.ws.ResponseWrapper; +import org.apache.cxf.Bus; import org.apache.cxf.binding.Binding; import org.apache.cxf.binding.soap.SoapFault; import org.apache.cxf.endpoint.Endpoint; import org.apache.cxf.message.Exchange; import org.apache.cxf.message.Message; import org.apache.cxf.message.MessageImpl; +import org.apache.cxf.phase.PhaseManager; +import org.apache.cxf.phase.PhaseManagerImpl; +import org.apache.cxf.service.Service; import org.apache.cxf.service.model.BindingInfo; import org.apache.cxf.service.model.BindingMessageInfo; import org.apache.cxf.service.model.BindingOperationInfo; @@ -425,6 +430,17 @@ decoupled, zeroLengthAction, fault); + + Endpoint endpoint = control.createMock(Endpoint.class); + endpoint.getOutInterceptors(); + EasyMock.expectLastCall().andReturn(new ArrayList()).anyTimes(); + Service serv = control.createMock(Service.class); + endpoint.getService(); + EasyMock.expectLastCall().andReturn(serv).anyTimes(); + serv.getOutInterceptors(); + EasyMock.expectLastCall().andReturn(new ArrayList()).anyTimes(); + exchange.get(Endpoint.class); + EasyMock.expectLastCall().andReturn(endpoint).anyTimes(); } control.replay(); return message; @@ -435,6 +451,9 @@ boolean usingAddressing) { setUpMessageExchange(message, exchange); Endpoint endpoint = control.createMock(Endpoint.class); + endpoint.getOutInterceptors(); + EasyMock.expectLastCall().andReturn(new ArrayList()).anyTimes(); + setUpExchangeGet(exchange, Endpoint.class, endpoint); EndpointInfo endpointInfo = control.createMock(EndpointInfo.class); endpoint.getEndpointInfo(); @@ -445,7 +464,7 @@ EasyMock.expectLastCall().andReturn(endpointExts); BindingInfo bindingInfo = control.createMock(BindingInfo.class); endpointInfo.getBinding(); - EasyMock.expectLastCall().andReturn(bindingInfo).times(2); + EasyMock.expectLastCall().andReturn(bindingInfo).anyTimes(); bindingInfo.getExtensors(EasyMock.eq(ExtensibilityElement.class)); EasyMock.expectLastCall().andReturn(Collections.EMPTY_LIST); ServiceInfo serviceInfo = control.createMock(ServiceInfo.class); @@ -592,9 +611,9 @@ EasyMock.expectLastCall().andReturn(endpoint); Binding binding = control.createMock(Binding.class); endpoint.getBinding(); - EasyMock.expectLastCall().andReturn(binding); + EasyMock.expectLastCall().andReturn(binding).anyTimes(); Message partialResponse = getMessage(); - binding.createMessage(); + binding.createMessage(EasyMock.isA(Message.class)); EasyMock.expectLastCall().andReturn(partialResponse); Destination target = control.createMock(Destination.class); @@ -656,7 +675,13 @@ } private Exchange getExchange() { + Bus bus = control.createMock(Bus.class); + bus.getExtension(PhaseManager.class); + EasyMock.expectLastCall().andReturn(new PhaseManagerImpl()).anyTimes(); + Exchange exchange = control.createMock(Exchange.class); + exchange.get(Bus.class); + EasyMock.expectLastCall().andReturn(bus).anyTimes(); //Exchange exchange = new ExchangeImpl(); return exchange; } Modified: cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/Server.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/Server.java?rev=794735&r1=794734&r2=794735&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/Server.java (original) +++ cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/Server.java Thu Jul 16 16:28:13 2009 @@ -26,6 +26,7 @@ import org.apache.cxf.jaxws.EndpointImpl; import org.apache.cxf.testutil.common.AbstractBusTestServerBase; +import org.apache.hello_world_soap_http.BaseGreeterImpl; import org.apache.hello_world_soap_http.DocLitBareGreeterImpl; import org.apache.hello_world_soap_http.GreeterImpl; @@ -38,7 +39,6 @@ } Object implementor; String address; - implementor = new GreeterImplMultiPort(); address = "http://localhost:9020/MultiPort/GreeterPort"; Endpoint.publish(address, implementor); @@ -47,15 +47,16 @@ address = "http://localhost:9021/MultiPort/DocBarePort"; Endpoint.publish(address, implementor); - implementor = new GreeterImpl(); address = "http://localhost:9000/SoapContext/SoapPort"; Endpoint.publish(address, implementor); //publish port with soap12 binding address = "http://localhost:9009/SoapContext/SoapPort"; + + EndpointImpl e = (EndpointImpl) Endpoint.create(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING, - implementor); + new Greeter12Impl()); e.publish(address); implementor = new DocLitBareGreeterImpl(); @@ -66,10 +67,13 @@ implementor = new GreeterImplBogus(); address = "http://localhost:9015/SoapContext/SoapPort"; Endpoint.publish(address, implementor); - - } - + @WebService(endpointInterface = "org.apache.hello_world_soap_http.Greeter", + targetNamespace = "http://apache.org/hello_world_soap_http") + public class Greeter12Impl extends BaseGreeterImpl { + } + + public static void main(String[] args) { try { Server s = new Server(); Modified: cxf/branches/2.2.x-fixes/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java?rev=794735&r1=794734&r2=794735&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java (original) +++ cxf/branches/2.2.x-fixes/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java Thu Jul 16 16:28:13 2009 @@ -19,222 +19,14 @@ package org.apache.hello_world_soap_http; - -import java.io.IOException; -import java.util.concurrent.Future; -import java.util.logging.Logger; - -import javax.annotation.Resource; - -import javax.jws.WebMethod; import javax.jws.WebService; -import javax.xml.ws.AsyncHandler; -import javax.xml.ws.BindingProvider; -import javax.xml.ws.Response; -import javax.xml.ws.WebServiceContext; -import javax.xml.ws.handler.MessageContext; - -import org.apache.hello_world_soap_http.types.BareDocumentResponse; -import org.apache.hello_world_soap_http.types.ErrorCode; -import org.apache.hello_world_soap_http.types.GreetMeLaterResponse; -import org.apache.hello_world_soap_http.types.GreetMeResponse; -import org.apache.hello_world_soap_http.types.GreetMeSometimeResponse; -import org.apache.hello_world_soap_http.types.NoSuchCodeLit; -import org.apache.hello_world_soap_http.types.SayHiResponse; -import org.apache.hello_world_soap_http.types.TestDocLitFaultResponse; -import org.apache.hello_world_soap_http.types.TestNillableResponse; @WebService(serviceName = "SOAPService", portName = "SoapPort", endpointInterface = "org.apache.hello_world_soap_http.Greeter", targetNamespace = "http://apache.org/hello_world_soap_http", wsdlLocation = "testutils/hello_world.wsdl") -public class GreeterImpl implements Greeter { - - private static final Logger LOG = Logger.getLogger(GreeterImpl.class.getName()); - - @Resource - private WebServiceContext context; - - private String prefix = ""; - - private int invocationCount; - - public WebServiceContext getContext() { - return context; - } - - public void setPrefix(String p) { - prefix = p; - } - - public String getPrefix() { - return prefix; - } - public String greetMe(String me) { - if ("secure".equals(me)) { - MessageContext ctx = getContext().getMessageContext(); - return "Hello " + ctx.get(BindingProvider.USERNAME_PROPERTY); - } - if ("principal".equals(me)) { - return "Hello " + getContext().getUserPrincipal().getName(); - } - - - LOG.info("Invoking greetMe " + prefix + me); - invocationCount++; - return "Hello " + me; - } - - public String greetMeLater(long delay) { - LOG.info("Invoking greetMeLater " + delay); - if (delay > 0) { - try { - Thread.sleep(delay); - } catch (InterruptedException ex) { - /// ignore - } - } - return "Hello, finally!"; - } - - public String sayHi() { - LOG.info("Invoking sayHi"); - invocationCount++; - return "Bonjour"; - } - - public void testDocLitFault(String faultType) throws BadRecordLitFault, NoSuchCodeLitFault { - LOG.info("Invoking testDocLitFault"); - invocationCount++; - if (faultType.equals(BadRecordLitFault.class.getSimpleName())) { - throw new BadRecordLitFault("TestBadRecordLit", "BadRecordLitFault"); - } - if (faultType.equals(NoSuchCodeLitFault.class.getSimpleName())) { - ErrorCode ec = new ErrorCode(); - ec.setMajor((short)1); - ec.setMinor((short)1); - NoSuchCodeLit nscl = new NoSuchCodeLit(); - nscl.setCode(ec); - throw new NoSuchCodeLitFault("TestNoSuchCodeLit", nscl); - } - throw new RuntimeException("Unknown source", new IOException("dummy io exception")); - } - - public void greetMeOneWay(String requestType) { - invocationCount++; - //System.out.println("********* greetMeOneWay: " + requestType); - } - - public String greetMeSometime(String me) { - invocationCount++; - //System.err.println("In greetMeSometime: " + me); - return "How are you " + me; - } - - @WebMethod - public BareDocumentResponse testDocLitBare(String in) { - invocationCount++; - BareDocumentResponse res = new BareDocumentResponse(); - res.setCompany("CXF"); - res.setId(1); - return res; - } - - public Future greetMeSometimeAsync(String requestType, - AsyncHandler asyncHandler) { - invocationCount++; - System.err.println("In greetMeSometimeAsync 1"); - return null; - /*not called */ - } - - public Response greetMeSometimeAsync(String requestType) { - invocationCount++; - System.err.println("In greetMeSometimeAsync 2"); - return null; - /*not called */ - } - - public Response testDocLitFaultAsync(String faultType) { - invocationCount++; - System.err.println("In testDocLitFaultAsync 1"); - return null; - /*not called */ - } - - public Future testDocLitFaultAsync(String faultType, AsyncHandler ah) { - invocationCount++; - System.err.println("In testDocLitFaultAsync 2"); - return null; - /*not called */ - } - - public Future testDocLitBareAsync(String bare, AsyncHandler ah) { - invocationCount++; - return null; - /* not called */ - } - - public Response testDocLitBareAsync(String bare) { - invocationCount++; - return null; - /* not called */ - } - - public Future greetMeAsync(String requestType, AsyncHandler asyncHandler) { - invocationCount++; - return null; - /*not called */ - } - - public Response greetMeAsync(String requestType) { - invocationCount++; - return null; - /*not called */ - } - - public Future greetMeLaterAsync(long requestType, AsyncHandler asyncHandler) { - return null; - /*not called */ - } - - public Response greetMeLaterAsync(long requestType) { - return null; - /*not called */ - } - - public Future sayHiAsync(AsyncHandler asyncHandler) { - invocationCount++; - return null; - /*not called */ - } - - public Response sayHiAsync() { - invocationCount++; - return null; - /*not called */ - } - - public int getInvocationCount() { - return invocationCount; - } - - public String testNillable(String nillElem, int intElem) { - System.out.println("the testNillable is invoked"); - return nillElem; - } +public class GreeterImpl extends BaseGreeterImpl { - public Response testNillableAsync(String nillElem, - int intElem) { - return null; - } - - public Future testNillableAsync(String nillElem, - int intElem, - AsyncHandler asyncHandler) { - return null; - } - }