Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 15359 invoked from network); 6 Nov 2007 03:09:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Nov 2007 03:09:24 -0000 Received: (qmail 30192 invoked by uid 500); 6 Nov 2007 03:09:12 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 30143 invoked by uid 500); 6 Nov 2007 03:09:11 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 30134 invoked by uid 99); 6 Nov 2007 03:09:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2007 19:09:11 -0800 X-ASF-Spam-Status: No, hits=-98.5 required=10.0 tests=ALL_TRUSTED,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Nov 2007 03:09:11 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 25BE11A9832; Mon, 5 Nov 2007 19:08:47 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r592234 - in /incubator/cxf/trunk: rt/frontend/jaxws/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ rt/frontend/simp... Date: Tue, 06 Nov 2007 03:08:45 -0000 To: cxf-commits@incubator.apache.org From: mmao@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071106030848.25BE11A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mmao Date: Mon Nov 5 19:08:43 2007 New Revision: 592234 URL: http://svn.apache.org/viewvc?rev=592234&view=rev Log: CXF-1172 JAX-WS support * AddressingFeature support both at the client side and server side Added: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HelloWsa.java incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/AddNumberImpl.java incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/AddNumbersException.java incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/Server.java incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/WSAClientServerTest.java incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureTest.java - copied, changed from r591891, incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureTest.java incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureXmlTest.java - copied, changed from r591891, incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureXmlTest.java incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/spring.xml - copied unchanged from r591891, incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/spring.xml incubator/cxf/trunk/systests/src/test/resources/wsdl/add_numbers.wsdl Removed: incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/ Modified: incubator/cxf/trunk/rt/frontend/jaxws/pom.xml incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/EndpointImplTest.java incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java incubator/cxf/trunk/rt/ws/addr/pom.xml incubator/cxf/trunk/systests/pom.xml incubator/cxf/trunk/systests/src/test/resources/wsdl/mtom.wsdl Modified: incubator/cxf/trunk/rt/frontend/jaxws/pom.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/pom.xml?rev=592234&r1=592233&r2=592234&view=diff ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/pom.xml (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/pom.xml Mon Nov 5 19:08:43 2007 @@ -96,6 +96,13 @@ ${project.version} true + + + org.apache.cxf + cxf-rt-ws-addr + ${project.version} + + javax.xml.soap saaj-api Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java?rev=592234&r1=592233&r2=592234&view=diff ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java Mon Nov 5 19:08:43 2007 @@ -24,12 +24,15 @@ import java.util.List; import java.util.Map; import java.util.concurrent.Executor; + import javax.xml.namespace.QName; import javax.xml.transform.Source; import javax.xml.ws.Binding; import javax.xml.ws.EndpointReference; import javax.xml.ws.WebServiceFeature; import javax.xml.ws.WebServicePermission; +import javax.xml.ws.soap.Addressing; +import javax.xml.ws.soap.AddressingFeature; import javax.xml.ws.soap.MTOM; import javax.xml.ws.soap.MTOMFeature; @@ -52,7 +55,6 @@ import org.apache.cxf.service.Service; import org.apache.cxf.service.invoker.Invoker; - public class EndpointImpl extends javax.xml.ws.Endpoint implements InterceptorProvider, Configurable { /** @@ -99,6 +101,7 @@ this.bus = b; this.serverFactory = sf; this.implementor = implementor; + loadWSFeatureAnnotation(); } /** @@ -129,11 +132,16 @@ private void loadWSFeatureAnnotation() { List wsFeatures = new ArrayList(); MTOM mtom = implementor.getClass().getAnnotation(MTOM.class); - if (mtom != null) { + if (mtom != null) { wsFeatures.add(new MTOMFeature(mtom.enabled(), mtom.threshold())); } - ((JaxWsServiceFactoryBean) serverFactory.getServiceFactory()).setWsFeatures(wsFeatures); - } + + Addressing addressing = implementor.getClass().getAnnotation(Addressing.class); + if (addressing != null) { + wsFeatures.add(new AddressingFeature(addressing.enabled(), addressing.required())); + } + ((JaxWsServiceFactoryBean) serverFactory.getServiceFactory()).setWsFeatures(wsFeatures); + } public Binding getBinding() { return ((JaxWsEndpointImpl) getEndpoint()).getJaxwsBinding(); @@ -276,7 +284,7 @@ serverFactory.setEndpointName(endpointName); serverFactory.setServiceBean(implementor); serverFactory.setBus(bus); - serverFactory.setFeatures(features); + serverFactory.setFeatures(getFeatures()); serverFactory.setInvoker(invoker); serverFactory.setSchemaLocations(schemaLocations); Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java?rev=592234&r1=592233&r2=592234&view=diff ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java Mon Nov 5 19:08:43 2007 @@ -23,6 +23,7 @@ import javax.xml.ws.Binding; import javax.xml.ws.WebServiceFeature; +import javax.xml.ws.soap.AddressingFeature; import javax.xml.ws.soap.MTOMFeature; import javax.xml.ws.soap.SOAPBinding; @@ -31,6 +32,7 @@ import org.apache.cxf.binding.xml.XMLBinding; import org.apache.cxf.endpoint.EndpointException; import org.apache.cxf.endpoint.EndpointImpl; +import org.apache.cxf.feature.AbstractFeature; import org.apache.cxf.interceptor.Interceptor; import org.apache.cxf.jaxws.binding.BindingImpl; import org.apache.cxf.jaxws.binding.http.HTTPBindingImpl; @@ -53,6 +55,7 @@ import org.apache.cxf.phase.Phase; import org.apache.cxf.service.Service; import org.apache.cxf.service.model.EndpointInfo; +import org.apache.cxf.ws.addressing.WSAddressingFeature; /** * A JAX-WS specific implementation of the CXF {@link org.apache.cxf.endpoint.Endpoint} interface. @@ -67,18 +70,21 @@ private Binding jaxwsBinding; private JaxWsImplementorInfo implInfo; private List wsFeatures; + private List features; public JaxWsEndpointImpl(Bus bus, Service s, EndpointInfo ei) throws EndpointException { - this(bus, s, ei, null, null); + this(bus, s, ei, null, null, null); } public JaxWsEndpointImpl(Bus bus, Service s, EndpointInfo ei, JaxWsImplementorInfo implementorInfo, - List features) + List wf, List af) throws EndpointException { super(bus, s, ei); this.implInfo = implementorInfo; - this.wsFeatures = features; + this.wsFeatures = wf; + this.features = af; + resolveFeatures(); createJaxwsBinding(); List in = super.getInInterceptors(); @@ -135,6 +141,57 @@ public Binding getJaxwsBinding() { return jaxwsBinding; } + + private AddressingFeature getAddressingFeature() { + if (wsFeatures == null) { + return null; + } + for (WebServiceFeature feature : wsFeatures) { + if (feature instanceof AddressingFeature) { + return (AddressingFeature)feature; + } + } + return null; + } + + public final void resolveFeatures() { + AddressingFeature addressing = getAddressingFeature(); + if (addressing == null) { + return; + } + if (addressing.isEnabled()) { + addAddressingFeature(new WSAddressingFeature()); + } else { + removeAddressingFeature(); + } + } + + private AbstractFeature getWSAddressingFeature() { + if (features == null) { + return null; + } + AbstractFeature addressing = null; + for (AbstractFeature f : features) { + if (f instanceof WSAddressingFeature) { + addressing = f; + } + } + return addressing; + } + + private void addAddressingFeature(AbstractFeature a) { + AbstractFeature f = getWSAddressingFeature(); + if (f == null) { + features.add(a); + } + } + + private void removeAddressingFeature() { + AbstractFeature f = getWSAddressingFeature(); + if (f != null) { + features.remove(f); + } + } private MTOMFeature getMTOMFeature() { if (wsFeatures == null) { Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?rev=592234&r1=592233&r2=592234&view=diff ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java Mon Nov 5 19:08:43 2007 @@ -134,7 +134,7 @@ @Override public Endpoint createEndpoint(EndpointInfo ei) throws EndpointException { - return new JaxWsEndpointImpl(getBus(), getService(), ei, implInfo, wsFeatures); + return new JaxWsEndpointImpl(getBus(), getService(), ei, implInfo, wsFeatures, this.getFeatures()); } @Override Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/EndpointImplTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/EndpointImplTest.java?rev=592234&r1=592233&r2=592234&view=diff ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/EndpointImplTest.java (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/EndpointImplTest.java Mon Nov 5 19:08:43 2007 @@ -22,7 +22,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; - import javax.xml.ws.WebServiceContext; import org.apache.cxf.Bus; @@ -34,6 +33,7 @@ import org.apache.cxf.service.invoker.BeanInvoker; import org.apache.cxf.transport.Conduit; import org.apache.cxf.transport.MessageObserver; +import org.apache.cxf.ws.addressing.WSAddressingFeature; import org.apache.hello_world_soap_http.GreeterImpl; import org.apache.hello_world_soap_http.HelloImpl; import org.apache.hello_world_soap_http.HelloWrongAnnotation; @@ -172,6 +172,52 @@ } ep.publish("local://localhost:9090/hello"); + } + + @Test + public void testAddWSAFeature() throws Exception { + GreeterImpl greeter = new GreeterImpl(); + JaxWsServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean(); + serviceFactory.setBus(getBus()); + serviceFactory.setInvoker(new BeanInvoker(greeter)); + serviceFactory.setServiceClass(GreeterImpl.class); + + EndpointImpl endpoint = new EndpointImpl(getBus(), greeter, + new JaxWsServerFactoryBean(serviceFactory)); + + endpoint.getFeatures().add(new WSAddressingFeature()); + try { + String address = "http://localhost:8080/test"; + endpoint.publish(address); + } catch (IllegalArgumentException ex) { + assertTrue(ex.getCause() instanceof BusException); + assertEquals("BINDING_INCOMPATIBLE_ADDRESS_EXC", ((BusException)ex.getCause()).getCode()); + } + + assertTrue(serviceFactory.getFeatures().size() == 1); + assertTrue(serviceFactory.getFeatures().get(0) instanceof WSAddressingFeature); + } + + @Test + public void testJaxWsaFeature() throws Exception { + HelloWsa greeter = new HelloWsa(); + JaxWsServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean(); + serviceFactory.setBus(getBus()); + serviceFactory.setInvoker(new BeanInvoker(greeter)); + serviceFactory.setServiceClass(HelloWsa.class); + + EndpointImpl endpoint = new EndpointImpl(getBus(), greeter, + new JaxWsServerFactoryBean(serviceFactory)); + try { + String address = "http://localhost:8080/test"; + endpoint.publish(address); + } catch (IllegalArgumentException ex) { + assertTrue(ex.getCause() instanceof BusException); + assertEquals("BINDING_INCOMPATIBLE_ADDRESS_EXC", ((BusException)ex.getCause()).getCode()); + } + + assertTrue(serviceFactory.getFeatures().size() == 1); + assertTrue(serviceFactory.getFeatures().get(0) instanceof WSAddressingFeature); } static class EchoObserver implements MessageObserver { Added: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HelloWsa.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HelloWsa.java?rev=592234&view=auto ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HelloWsa.java (added) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HelloWsa.java Mon Nov 5 19:08:43 2007 @@ -0,0 +1,31 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.jaxws; + +import javax.jws.WebService; +import javax.xml.ws.soap.Addressing; + +@Addressing +@WebService +public class HelloWsa { + public int add(int arg0, int arg1) { + return arg0 + arg1; + } +} Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java?rev=592234&r1=592233&r2=592234&view=diff ============================================================================== --- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java (original) +++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java Mon Nov 5 19:08:43 2007 @@ -59,6 +59,8 @@ } protected Endpoint createEndpoint() throws BusException, EndpointException { + serviceFactory.setFeatures(getFeatures()); + if (serviceName != null) { serviceFactory.setServiceName(serviceName); } @@ -322,6 +324,4 @@ public void setWsdlURL(String wsdlURL) { getServiceFactory().setWsdlURL(wsdlURL); } - - } Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java?rev=592234&r1=592233&r2=592234&view=diff ============================================================================== --- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java (original) +++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java Mon Nov 5 19:08:43 2007 @@ -55,7 +55,7 @@ private String password; private Map properties; private Bus bus; - private List features; + private List features = new ArrayList(); private DataBinding dataBinding; public ClientProxyFactoryBean() { @@ -232,16 +232,13 @@ } public List getFeatures() { - if (features == null) { - features = new ArrayList(); - } return features; } - public void setFeatures(List features) { - this.features = features; + public void setFeatures(List f) { + this.features = f; } - + public DataBinding getDataBinding() { return dataBinding; } Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=592234&r1=592233&r2=592234&view=diff ============================================================================== --- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java (original) +++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Mon Nov 5 19:08:43 2007 @@ -54,6 +54,7 @@ import org.apache.cxf.endpoint.Endpoint; import org.apache.cxf.endpoint.EndpointException; import org.apache.cxf.endpoint.EndpointImpl; +import org.apache.cxf.feature.AbstractFeature; import org.apache.cxf.frontend.FaultInfoException; import org.apache.cxf.frontend.MethodDispatcher; import org.apache.cxf.frontend.SimpleMethodDispatcher; @@ -135,7 +136,8 @@ private boolean populateFromClass; private boolean anonymousWrappers; private boolean qualifiedSchemas = true; - + + private List features; public ReflectionServiceFactoryBean() { getServiceConfigurations().add(0, new DefaultServiceConfiguration()); @@ -1685,4 +1687,11 @@ this.ignoredMethods = ignoredMethods; } + public List getFeatures() { + return features; + } + + public void setFeatures(List f) { + this.features = f; + } } Modified: incubator/cxf/trunk/rt/ws/addr/pom.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/pom.xml?rev=592234&r1=592233&r2=592234&view=diff ============================================================================== --- incubator/cxf/trunk/rt/ws/addr/pom.xml (original) +++ incubator/cxf/trunk/rt/ws/addr/pom.xml Mon Nov 5 19:08:43 2007 @@ -72,13 +72,6 @@ org.apache.cxf - cxf-rt-frontend-jaxws - ${project.version} - test - - - - org.apache.cxf cxf-rt-transports-http-jetty ${project.version} test Modified: incubator/cxf/trunk/systests/pom.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/pom.xml?rev=592234&r1=592233&r2=592234&view=diff ============================================================================== --- incubator/cxf/trunk/systests/pom.xml (original) +++ incubator/cxf/trunk/systests/pom.xml Mon Nov 5 19:08:43 2007 @@ -83,6 +83,10 @@ ${basedir}/src/test/resources/wsdl/mtom.wsdl + + ${basedir}/src/test/resources/wsdl/add_numbers.wsdl + + Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/AddNumberImpl.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/AddNumberImpl.java?rev=592234&view=auto ============================================================================== --- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/AddNumberImpl.java (added) +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/AddNumberImpl.java Mon Nov 5 19:08:43 2007 @@ -0,0 +1,33 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.systest.ws.addr_feature; + +import javax.jws.WebService; +import javax.xml.ws.soap.Addressing; + +// Jax-WS 2.1 WS-Addressing FromJava + +@Addressing +@WebService +public class AddNumberImpl implements AddNumbersPortType { + public int addNumbers(int number1, int number2) { + return number1 + number2; + } +} Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/AddNumbersException.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/AddNumbersException.java?rev=592234&view=auto ============================================================================== --- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/AddNumbersException.java (added) +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/AddNumbersException.java Mon Nov 5 19:08:43 2007 @@ -0,0 +1,33 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.systest.ws.addr_feature; + +public class AddNumbersException extends Exception { + String detail; + + public AddNumbersException(String message, String detail) { + super(message); + this.detail = detail; + } + + public String getDetail() { + return detail; + } +} Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/Server.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/Server.java?rev=592234&view=auto ============================================================================== --- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/Server.java (added) +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/Server.java Mon Nov 5 19:08:43 2007 @@ -0,0 +1,51 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.systest.ws.addr_feature; + +import javax.xml.ws.Endpoint; + +import org.apache.cxf.jaxws.EndpointImpl; +import org.apache.cxf.testutil.common.AbstractBusTestServerBase; +import org.apache.cxf.ws.addressing.WSAddressingFeature; + +public class Server extends AbstractBusTestServerBase { + + protected void run() { + Object implementor = new AddNumberImpl(); + String address = "http://localhost:9091/jaxws/add"; + //Endpoint.publish(address, implementor); + + EndpointImpl ep = (EndpointImpl) Endpoint.create(implementor); + ep.getFeatures().add(new WSAddressingFeature()); + ep.publish(address); + } + + public static void main(String[] args) { + try { + Server s = new Server(); + s.start(); + } catch (Exception ex) { + ex.printStackTrace(); + System.exit(-1); + } finally { + System.out.println("done!"); + } + } +} Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/WSAClientServerTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/WSAClientServerTest.java?rev=592234&view=auto ============================================================================== --- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/WSAClientServerTest.java (added) +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/WSAClientServerTest.java Mon Nov 5 19:08:43 2007 @@ -0,0 +1,59 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.systest.ws.addr_feature; + +import java.net.URL; +import javax.xml.namespace.QName; +import javax.xml.ws.soap.AddressingFeature; + +import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase; +import org.junit.BeforeClass; +import org.junit.Test; + +public class WSAClientServerTest extends AbstractBusClientServerTestBase { + + private final QName serviceName = new QName("http://apache.org/cxf/systest/ws/addr_feature/", + "AddNumbersService"); + @BeforeClass + public static void startServers() throws Exception { + assertTrue("server did not launch correctly", launchServer(Server.class)); + } + + @Test + public void testDetail() throws Exception { + AddNumbersPortType port = getPort(); + + // JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); + // factory.setServiceClass(AddNumbersPortType.class); + // factory.setAddress("http://localhost:9090/jaxws/add"); + // factory.getFeatures().add(new WSAddressingFeature()); + // AddNumbersPortType port = (AddNumbersPortType) factory.create(); + assertEquals(3, port.addNumbers(1, 2)); + } + + private AddNumbersPortType getPort() { + URL wsdl = getClass().getResource("/wsdl/add_numbers.wsdl"); + assertNotNull("WSDL is null", wsdl); + + AddNumbersService service = new AddNumbersService(wsdl, serviceName); + assertNotNull("Service is null ", service); + return service.getAddNumbersPort(new AddressingFeature()); + } +} Copied: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureTest.java (from r591891, incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureTest.java) URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureTest.java?p2=incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureTest.java&p1=incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureTest.java&r1=591891&r2=592234&rev=592234&view=diff ============================================================================== --- incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureTest.java (original) +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureTest.java Mon Nov 5 19:08:43 2007 @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.cxf.ws.addressing.spring; +package org.apache.cxf.systest.ws.addressing.spring; import java.util.List; Copied: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureXmlTest.java (from r591891, incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureXmlTest.java) URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureXmlTest.java?p2=incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureXmlTest.java&p1=incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureXmlTest.java&r1=591891&r2=592234&rev=592234&view=diff ============================================================================== --- incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/spring/WSAFeatureXmlTest.java (original) +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureXmlTest.java Mon Nov 5 19:08:43 2007 @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.cxf.ws.addressing.spring; +package org.apache.cxf.systest.ws.addressing.spring; import java.util.List; @@ -42,7 +42,7 @@ @Override protected Bus createBus() throws BusException { - return new SpringBusFactory().createBus("/org/apache/cxf/ws/addressing/spring/spring.xml"); + return new SpringBusFactory().createBus("/org/apache/cxf/systest/ws/addressing/spring/spring.xml"); } @Test Added: incubator/cxf/trunk/systests/src/test/resources/wsdl/add_numbers.wsdl URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/resources/wsdl/add_numbers.wsdl?rev=592234&view=auto ============================================================================== --- incubator/cxf/trunk/systests/src/test/resources/wsdl/add_numbers.wsdl (added) +++ incubator/cxf/trunk/systests/src/test/resources/wsdl/add_numbers.wsdl Mon Nov 5 19:08:43 2007 @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Modified: incubator/cxf/trunk/systests/src/test/resources/wsdl/mtom.wsdl URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/resources/wsdl/mtom.wsdl?rev=592234&r1=592233&r2=592234&view=diff ============================================================================== --- incubator/cxf/trunk/systests/src/test/resources/wsdl/mtom.wsdl (original) +++ incubator/cxf/trunk/systests/src/test/resources/wsdl/mtom.wsdl Mon Nov 5 19:08:43 2007 @@ -1,4 +1,22 @@ +