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 @@
<version>${project.version}</version>
<optional>true</optional>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-ws-addr</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
<dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>saaj-api</artifactId>
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<WebServiceFeature> wsFeatures = new
ArrayList<WebServiceFeature>();
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 [EMAIL PROTECTED]
org.apache.cxf.endpoint.Endpoint} interface.
@@ -67,18 +70,21 @@
private Binding jaxwsBinding;
private JaxWsImplementorInfo implInfo;
private List<WebServiceFeature> wsFeatures;
+ private List<AbstractFeature> 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<WebServiceFeature> features)
+ List<WebServiceFeature> wf, List<AbstractFeature>
af)
throws EndpointException {
super(bus, s, ei);
this.implInfo = implementorInfo;
- this.wsFeatures = features;
+ this.wsFeatures = wf;
+ this.features = af;
+ resolveFeatures();
createJaxwsBinding();
List<Interceptor> 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;
+
[EMAIL PROTECTED]
[EMAIL PROTECTED]
+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<String, Object> properties;
private Bus bus;
- private List<AbstractFeature> features;
+ private List<AbstractFeature> features = new ArrayList<AbstractFeature>();
private DataBinding dataBinding;
public ClientProxyFactoryBean() {
@@ -232,16 +232,13 @@
}
public List<AbstractFeature> getFeatures() {
- if (features == null) {
- features = new ArrayList<AbstractFeature>();
- }
return features;
}
- public void setFeatures(List<AbstractFeature> features) {
- this.features = features;
+ public void setFeatures(List<AbstractFeature> 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<AbstractFeature> features;
public ReflectionServiceFactoryBean() {
getServiceConfigurations().add(0, new DefaultServiceConfiguration());
@@ -1685,4 +1687,11 @@
this.ignoredMethods = ignoredMethods;
}
+ public List<AbstractFeature> getFeatures() {
+ return features;
+ }
+
+ public void setFeatures(List<AbstractFeature> 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 @@
<!-- Test stuff -->
<dependency>
<groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-frontend-jaxws</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${project.version}</version>
<scope>test</scope>
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 @@
<wsdl>${basedir}/src/test/resources/wsdl/mtom.wsdl</wsdl>
</wsdlOption>
+ <wsdlOption>
+
<wsdl>${basedir}/src/test/resources/wsdl/add_numbers.wsdl</wsdl>
+ </wsdlOption>
+
</wsdlOptions>
</configuration>
<goals>
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
+
[EMAIL PROTECTED]
[EMAIL PROTECTED]
+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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<definitions name="AddNumbers"
+ targetNamespace="http://apache.org/cxf/systest/ws/addr_feature/"
+ xmlns:tns="http://apache.org/cxf/systest/ws/addr_feature/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl">
+ <types>
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+
targetNamespace="http://apache.org/cxf/systest/ws/addr_feature/">
+ <complexType name="addNumbersResponse">
+ <sequence>
+ <element name="return" type="xsd:int" />
+ </sequence>
+ </complexType>
+ <element name="addNumbersResponse" type="tns:addNumbersResponse" />
+ <element name="addNumbers2Response" type="tns:addNumbersResponse" />
+ <element name="addNumbers3Response" type="tns:addNumbersResponse" />
+
+ <complexType name="addNumbers">
+ <sequence>
+ <element name="number1" type="xsd:int" />
+ <element name="number2" type="xsd:int" />
+ </sequence>
+ </complexType>
+ <element name="addNumbers" type="tns:addNumbers" />
+ <element name="addNumbers2" type="tns:addNumbers" />
+ <element name="addNumbers3" type="tns:addNumbers" />
+
+ <element name="AddNumbersFault" type="tns:AddNumbersFault" />
+ <complexType name="AddNumbersFault">
+ <sequence>
+ <element name="detail" type="xsd:string" />
+ <element name="message" type="xsd:string" />
+ </sequence>
+ </complexType>
+ </xsd:schema>
+ </types>
+ <message name="addNumbers">
+ <part name="parameters" element="tns:addNumbers" />
+ </message>
+ <message name="addNumbersResponse">
+ <part name="result" element="tns:addNumbersResponse" />
+ </message>
+ <message name="addNumbersFault">
+ <part name="AddNumbersFault" element="tns:AddNumbersFault" />
+ </message>
+ <message name="addNumbers2">
+ <part name="parameters" element="tns:addNumbers2" />
+ </message>
+ <message name="addNumbers2Response">
+ <part name="result" element="tns:addNumbers2Response" />
+ </message>
+ <message name="addNumbers3">
+ <part name="parameters" element="tns:addNumbers3" />
+ </message>
+ <message name="addNumbers3Response">
+ <part name="result" element="tns:addNumbers3Response" />
+ </message>
+ <portType name="AddNumbersPortType">
+ <operation name="addNumbers">
+ <input message="tns:addNumbers"/>
+ <output message="tns:addNumbersResponse"/>
+ <!-- <fault name="addNumbersFault" message="tns:addNumbersFault"/>
-->
+ </operation>
+<!-- <operation name="addNumbers2"> -->
+<!-- <input message="tns:addNumbers2" name="add2In"/> -->
+<!-- <output message="tns:addNumbers2Response" name="add2Out"/> -->
+<!-- <fault name="addNumbersFault" message="tns:addNumbersFault"/> -->
+<!-- </operation> -->
+<!-- <operation name="addNumbers3"> -->
+<!-- <input message="tns:addNumbers3" wsaw:Action="3in"/> -->
+<!-- <output message="tns:addNumbers3Response" wsaw:Action="3out"/> -->
+<!-- <fault name="addNumbersFault" message="tns:addNumbersFault"
wsaw:Action="3fault"/> -->
+<!-- </operation> -->
+ </portType>
+ <binding name="AddNumbersBinding" type="tns:AddNumbersPortType">
+ <wsaw:UsingAddressing wsdl:required="false" />
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
+ <operation name="addNumbers">
+ <soap:operation soapAction="" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ <!--
+ <fault name="addNumbersFault">
+ <soap:fault name="addNumbersFault" use="literal" />
+ </fault>
+ -->
+ </operation>
+<!-- <operation name="addNumbers2"> -->
+<!-- <soap:operation soapAction="" /> -->
+<!-- <input> -->
+<!-- <soap:body use="literal" /> -->
+<!-- </input> -->
+<!-- <output> -->
+<!-- <soap:body use="literal" /> -->
+<!-- </output> -->
+<!-- <fault name="addNumbersFault"> -->
+<!-- <soap:fault name="addNumbersFault" use="literal" /> -->
+<!-- </fault> -->
+<!-- </operation> -->
+<!-- <operation name="addNumbers3"> -->
+<!-- <soap:operation soapAction="" /> -->
+<!-- <input> -->
+<!-- <soap:body use="literal" /> -->
+<!-- </input> -->
+<!-- <output> -->
+<!-- <soap:body use="literal" /> -->
+<!-- </output> -->
+<!-- <fault name="addNumbersFault"> -->
+<!-- <soap:fault name="addNumbersFault" use="literal" /> -->
+<!-- </fault> -->
+<!-- </operation> -->
+ </binding>
+ <service name="AddNumbersService">
+ <port name="AddNumbersPort" binding="tns:AddNumbersBinding">
+ <soap:address location="http://localhost:9091/jaxws/add"/>
+ </port>
+ </service>
+</definitions>
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 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
<wsdl:definitions
xmlns:types="http://apache.org/cxf/systest/mtom_feature/types"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"