You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2011/08/29 17:30:47 UTC
svn commit: r1162870 - in /cxf/trunk:
rt/frontend/simple/src/main/java/org/apache/cxf/frontend/
rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/
rt/ws/mex/src/main/java/org/apache/cxf/ws/mex/ systests/ws-specs/
systests/ws-specs/src/test/java/org...
Author: dkulp
Date: Mon Aug 29 15:30:46 2011
New Revision: 1162870
URL: http://svn.apache.org/viewvc?rev=1162870&view=rev
Log:
More updates toward WS-MEX
Add schemas into to WS-MEX response. Allow querying the schemas.
Added:
cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/
cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/AddNumberImpl.java (with props)
cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/MEXTest.java (with props)
cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/Server.java (with props)
cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/imports/
cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/imports/add_numbers_imports.wsdl (with props)
cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/imports/add_numbers_imports.xsd (with props)
Modified:
cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java
cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
cxf/trunk/rt/ws/mex/src/main/java/org/apache/cxf/ws/mex/MEXEndpoint.java
cxf/trunk/rt/ws/mex/src/main/java/org/apache/cxf/ws/mex/MEXInInterceptor.java
cxf/trunk/rt/ws/mex/src/main/java/org/apache/cxf/ws/mex/MEXUtils.java
cxf/trunk/systests/ws-specs/pom.xml
Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java?rev=1162870&r1=1162869&r2=1162870&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java (original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java Mon Aug 29 15:30:46 2011
@@ -24,8 +24,10 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLDecoder;
import java.util.Collection;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Logger;
@@ -80,6 +82,46 @@ public class WSDLGetUtils {
}
+ public Set<String> getWSDLIds(Message message,
+ String base,
+ String ctxUri,
+ EndpointInfo endpointInfo) {
+ Map<String, String> params = new HashMap<String, String>();
+ params.put("wsdl", "");
+ new WSDLGetUtils().getDocument(message, base,
+ params, ctxUri,
+ endpointInfo);
+
+ Map<String, Definition> mp = CastUtils.cast((Map)endpointInfo.getService()
+ .getProperty(WSDLS_KEY));
+ return mp.keySet();
+ }
+ private String buildUrl(String base, String ctxUri, String s) {
+ return base + ctxUri + "?" + s;
+ }
+ public Map<String, String> getSchemaLocations(Message message,
+ String base,
+ String ctxUri,
+ EndpointInfo endpointInfo) {
+ Map<String, String> params = new HashMap<String, String>();
+ params.put("wsdl", "");
+ new WSDLGetUtils().getDocument(message, base,
+ params, ctxUri,
+ endpointInfo);
+
+ Map<String, SchemaReference> mp = CastUtils.cast((Map)endpointInfo.getService()
+ .getProperty(SCHEMAS_KEY));
+
+ Map<String, String> schemas = new HashMap<String, String>();
+ for (Map.Entry<String, SchemaReference> ent : mp.entrySet()) {
+ params.clear();
+ params.put("xsd", ent.getKey());
+ Document doc = getDocument(message, base, params, ctxUri, endpointInfo);
+ schemas.put(doc.getDocumentElement().getAttribute("targetNamespace"),
+ buildUrl(base, ctxUri, "xsd=" + ent.getKey()));
+ }
+ return schemas;
+ }
public Document getDocument(Message message,
String base,
@@ -89,6 +131,9 @@ public class WSDLGetUtils {
try {
Bus bus = message.getExchange().getBus();
Object prop = message.getContextualProperty(PUBLISHED_ENDPOINT_URL);
+ if (prop == null) {
+ prop = endpointInfo.getProperty(PUBLISHED_ENDPOINT_URL);
+ }
if (prop != null) {
base = String.valueOf(prop);
}
Modified: cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?rev=1162870&r1=1162869&r2=1162870&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java (original)
+++ cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java Mon Aug 29 15:30:46 2011
@@ -508,7 +508,7 @@ public final class ContextUtils {
}
/**
- * Propogate inbound MAPs onto full reponse & fault messages.
+ * Propagate inbound MAPs onto full reponse & fault messages.
*
* @param inMAPs the inbound MAPs
* @param exchange the current Exchange
Modified: cxf/trunk/rt/ws/mex/src/main/java/org/apache/cxf/ws/mex/MEXEndpoint.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/mex/src/main/java/org/apache/cxf/ws/mex/MEXEndpoint.java?rev=1162870&r1=1162869&r2=1162870&view=diff
==============================================================================
--- cxf/trunk/rt/ws/mex/src/main/java/org/apache/cxf/ws/mex/MEXEndpoint.java (original)
+++ cxf/trunk/rt/ws/mex/src/main/java/org/apache/cxf/ws/mex/MEXEndpoint.java Mon Aug 29 15:30:46 2011
@@ -62,8 +62,8 @@ public class MEXEndpoint implements Meta
org.apache.cxf.ws.mex.model._2004_09.Metadata metadata
= new org.apache.cxf.ws.mex.model._2004_09.Metadata();
- Element el = MEXUtils.getWSDL(server);
- if (el != null) {
+ List<Element> wsdls = MEXUtils.getWSDLs(server);
+ for (Element el : wsdls) {
org.apache.cxf.ws.mex.model._2004_09.MetadataSection sect
= new org.apache.cxf.ws.mex.model._2004_09.MetadataSection();
sect.setAny(el);
@@ -83,7 +83,7 @@ public class MEXEndpoint implements Meta
}
}
Map<String, String> policies = MEXUtils.getPolicyLocations(server);
- if (schemas != null && !policies.isEmpty()) {
+ if (policies != null && !policies.isEmpty()) {
for (Map.Entry<String, String> s : policies.entrySet()) {
org.apache.cxf.ws.mex.model._2004_09.MetadataSection sect
= new org.apache.cxf.ws.mex.model._2004_09.MetadataSection();
@@ -92,7 +92,7 @@ public class MEXEndpoint implements Meta
org.apache.cxf.ws.mex.model._2004_09.MetadataReference ref
= new org.apache.cxf.ws.mex.model._2004_09.MetadataReference();
- el = DOMUtils.createDocument().createElementNS(getAddressingNamespace(),
+ Element el = DOMUtils.createDocument().createElementNS(getAddressingNamespace(),
"wsa:Address");
el.setTextContent(s.getValue());
ref.getAny().add(el);
@@ -114,8 +114,8 @@ public class MEXEndpoint implements Meta
= new org.apache.cxf.ws.mex.model._2004_09.Metadata();
if ("http://schemas.xmlsoap.org/wsdl/".equals(dialect)) {
- Element el = MEXUtils.getWSDL(server);
- if (el != null) {
+ List<Element> wsdls = MEXUtils.getWSDLs(server);
+ for (Element el : wsdls) {
org.apache.cxf.ws.mex.model._2004_09.MetadataSection sect
= new org.apache.cxf.ws.mex.model._2004_09.MetadataSection();
sect.setAny(el);
Modified: cxf/trunk/rt/ws/mex/src/main/java/org/apache/cxf/ws/mex/MEXInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/mex/src/main/java/org/apache/cxf/ws/mex/MEXInInterceptor.java?rev=1162870&r1=1162869&r2=1162870&view=diff
==============================================================================
--- cxf/trunk/rt/ws/mex/src/main/java/org/apache/cxf/ws/mex/MEXInInterceptor.java (original)
+++ cxf/trunk/rt/ws/mex/src/main/java/org/apache/cxf/ws/mex/MEXInInterceptor.java Mon Aug 29 15:30:46 2011
@@ -64,7 +64,8 @@ public class MEXInInterceptor extends Ab
action = inProps.getAction().getValue();
}
}
- if ("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get".equals(action)) {
+ if ("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get".equals(action)
+ || "http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata/Request".equals(action)) {
message.remove(AssertionInfoMap.class);
Exchange ex = message.getExchange();
Endpoint endpoint = createEndpoint(message);
Modified: cxf/trunk/rt/ws/mex/src/main/java/org/apache/cxf/ws/mex/MEXUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/mex/src/main/java/org/apache/cxf/ws/mex/MEXUtils.java?rev=1162870&r1=1162869&r2=1162870&view=diff
==============================================================================
--- cxf/trunk/rt/ws/mex/src/main/java/org/apache/cxf/ws/mex/MEXUtils.java (original)
+++ cxf/trunk/rt/ws/mex/src/main/java/org/apache/cxf/ws/mex/MEXUtils.java Mon Aug 29 15:30:46 2011
@@ -20,15 +20,19 @@
package org.apache.cxf.ws.mex;
import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.w3c.dom.Element;
+import org.apache.cxf.common.util.StringUtils;
import org.apache.cxf.endpoint.Server;
import org.apache.cxf.frontend.WSDLGetUtils;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.PhaseInterceptorChain;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.transport.http.UrlUtilities;
/**
*
@@ -38,29 +42,68 @@ public final class MEXUtils {
//utility
}
- public static Element getWSDL(Server server) {
+ public static List<Element> getWSDLs(Server server) {
Message message = PhaseInterceptorChain.getCurrentMessage();
- String base = null;
- String ctxUri = null;
- Map<String, String> params = new HashMap<String, String>();
- params.put("wsdl", "");
- return new WSDLGetUtils().getDocument(message, base,
- params, ctxUri,
- server.getEndpoint().getEndpointInfo()).getDocumentElement();
+
+ String base = (String)message.get(Message.REQUEST_URL);
+ String ctxUri = (String)message.get(Message.PATH_INFO);
+
+ WSDLGetUtils utils = new WSDLGetUtils();
+ EndpointInfo info = server.getEndpoint().getEndpointInfo();
+ List<Element> ret = new LinkedList<Element>();
+ for (String id : utils.getWSDLIds(message, base, ctxUri, info)) {
+ Map<String, String> params = new HashMap<String, String>();
+ params.put("wsdl", id);
+ ret.add(utils.getDocument(message, base,
+ params, ctxUri,
+ info).getDocumentElement());
+
+ }
+ return ret;
}
public static Map<String, String> getSchemaLocations(Server server) {
- return null;
+ Message message = PhaseInterceptorChain.getCurrentMessage();
+
+ String base = (String)message.get(Message.REQUEST_URL);
+ String ctxUri = (String)message.get(Message.PATH_INFO);
+
+ WSDLGetUtils utils = new WSDLGetUtils();
+ EndpointInfo info = server.getEndpoint().getEndpointInfo();
+ return utils.getSchemaLocations(message, base, ctxUri, info);
}
- public static Map<String, String> getPolicyLocations(Server server) {
- return null;
+ public static List<Element> getSchemas(Server server, String id) {
+ Message message = PhaseInterceptorChain.getCurrentMessage();
+
+ String base = (String)message.get(Message.REQUEST_URL);
+ String ctxUri = (String)message.get(Message.PATH_INFO);
+
+ WSDLGetUtils utils = new WSDLGetUtils();
+ EndpointInfo info = server.getEndpoint().getEndpointInfo();
+ Map<String, String> locs = utils.getSchemaLocations(message,
+ base,
+ ctxUri,
+ info);
+ List<Element> ret = new LinkedList<Element>();
+ for (Map.Entry<String, String> xsd : locs.entrySet()) {
+
+ if (StringUtils.isEmpty(id)
+ || id.equals(xsd.getKey())) {
+ String query = xsd.getValue().substring(xsd.getValue().indexOf('?') + 1);
+ Map<String, String> params = UrlUtilities.parseQueryString(query);
+
+ ret.add(utils.getDocument(message, base, params, ctxUri, info).getDocumentElement());
+ }
+ }
+ return ret;
}
- public static List<Element> getSchemas(Server server, String id) {
+ public static Map<String, String> getPolicyLocations(Server server) {
return null;
}
+
public static List<Element> getPolicies(Server server, String id) {
return null;
}
Modified: cxf/trunk/systests/ws-specs/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/pom.xml?rev=1162870&r1=1162869&r2=1162870&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/pom.xml (original)
+++ cxf/trunk/systests/ws-specs/pom.xml Mon Aug 29 15:30:46 2011
@@ -148,11 +148,11 @@
<artifactId>cxf-rt-ws-policy</artifactId>
<version>${project.version}</version>
</dependency>
- <!--dependency>
+ <dependency>
<groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-ws-security</artifactId>
+ <artifactId>cxf-rt-ws-mex</artifactId>
<version>${project.version}</version>
- </dependency-->
+ </dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-testutils</artifactId>
Added: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/AddNumberImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/AddNumberImpl.java?rev=1162870&view=auto
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/AddNumberImpl.java (added)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/AddNumberImpl.java Mon Aug 29 15:30:46 2011
@@ -0,0 +1,88 @@
+/**
+ * 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.mex;
+
+import java.util.concurrent.Future;
+
+import javax.jws.WebService;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+
+import org.apache.cxf.systest.ws.addr_feature.AddNumbersFault;
+import org.apache.cxf.systest.ws.addr_feature.AddNumbersFault_Exception;
+import org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType;
+import org.apache.cxf.systest.ws.addr_feature.AddNumbersResponse;
+
+
+@WebService(serviceName = "AddNumbersService",
+ portName = "AddNumbersOnlyAnonPort",
+ targetNamespace = "http://apache.org/cxf/systest/ws/addr_feature/")
+public class AddNumberImpl implements AddNumbersPortType {
+ public int addNumbers(int number1, int number2) throws AddNumbersFault_Exception {
+ return execute(number1, number2);
+ }
+
+ public int addNumbers2(int number1, int number2) {
+ return number1 + number2;
+ }
+
+ public int addNumbers3(int number1, int number2) throws AddNumbersFault_Exception {
+ return execute(number1, number2);
+ }
+
+ int execute(int number1, int number2) throws AddNumbersFault_Exception {
+ if (number1 < 0 || number2 < 0) {
+ AddNumbersFault fb = new AddNumbersFault();
+ fb.setDetail("Negative numbers cant be added!");
+ fb.setMessage("Numbers: " + number1 + ", " + number2);
+
+ throw new AddNumbersFault_Exception(fb.getMessage(), fb);
+ }
+
+ return number1 + number2;
+ }
+
+ public Response<AddNumbersResponse> addNumbers2Async(int number1, int number2) {
+ return null;
+ }
+
+ public Future<?> addNumbers2Async(int number1, int number2,
+ AsyncHandler<AddNumbersResponse> asyncHandler) {
+ return null;
+ }
+
+ public Response<AddNumbersResponse> addNumbers3Async(int number1, int number2) {
+ return null;
+ }
+
+ public Future<?> addNumbers3Async(int number1, int number2,
+ AsyncHandler<AddNumbersResponse> asyncHandler) {
+ return null;
+ }
+
+ public Response<AddNumbersResponse> addNumbersAsync(int number1, int number2) {
+ return null;
+ }
+
+ public Future<?> addNumbersAsync(int number1, int number2,
+ AsyncHandler<AddNumbersResponse> asyncHandler) {
+ return null;
+ }
+}
Propchange: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/AddNumberImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/AddNumberImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/MEXTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/MEXTest.java?rev=1162870&view=auto
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/MEXTest.java (added)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/MEXTest.java Mon Aug 29 15:30:46 2011
@@ -0,0 +1,68 @@
+/**
+ * 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.mex;
+
+import org.apache.cxf.feature.LoggingFeature;
+import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
+import org.apache.cxf.systest.ws.AbstractWSATestBase;
+import org.apache.cxf.ws.mex.MetadataExchange;
+import org.apache.cxf.ws.mex.model._2004_09.GetMetadata;
+import org.apache.cxf.ws.mex.model._2004_09.Metadata;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+/**
+ *
+ */
+public class MEXTest extends AbstractWSATestBase {
+ static final String PORT = Server.PORT;
+ @BeforeClass
+ public static void startServers() throws Exception {
+ assertTrue("server did not launch correctly", launchServer(Server.class, true));
+ }
+
+ @Test
+ public void testGet() {
+ // Create the client
+ JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
+ proxyFac.setAddress("http://localhost:" + PORT + "/jaxws/addmex");
+ proxyFac.getFeatures().add(new LoggingFeature());
+ MetadataExchange exc = proxyFac.create(MetadataExchange.class);
+ Metadata metadata = exc.get2004();
+ assertNotNull(metadata);
+ assertEquals(2, metadata.getMetadataSection().size());
+
+
+ assertEquals("http://schemas.xmlsoap.org/wsdl/",
+ metadata.getMetadataSection().get(0).getDialect());
+ assertEquals("http://apache.org/cxf/systest/ws/addr_feature/",
+ metadata.getMetadataSection().get(0).getIdentifier());
+ assertEquals("http://www.w3.org/2001/XMLSchema",
+ metadata.getMetadataSection().get(1).getDialect());
+
+ GetMetadata body = new GetMetadata();
+ body.setDialect("http://www.w3.org/2001/XMLSchema");
+ metadata = exc.getMetadata(body);
+ assertEquals(1, metadata.getMetadataSection().size());
+ assertEquals("http://www.w3.org/2001/XMLSchema",
+ metadata.getMetadataSection().get(0).getDialect());
+ }
+}
Propchange: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/MEXTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/MEXTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/Server.java?rev=1162870&view=auto
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/Server.java (added)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/Server.java Mon Aug 29 15:30:46 2011
@@ -0,0 +1,66 @@
+/**
+ * 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.mex;
+
+
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.jaxws.EndpointImpl;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+public class Server extends AbstractBusTestServerBase {
+ static final String PORT = allocatePort(Server.class);
+
+ protected void run() {
+ Object implementor = new AddNumberImpl();
+ String address = "http://localhost:" + PORT + "/jaxws/addmex";
+
+ EndpointImpl ep = new EndpointImpl(BusFactory.getThreadDefaultBus(),
+ implementor,
+ null,
+ getWsdl());
+
+ ep.publish(address);
+ }
+
+ private String getWsdl() {
+ try {
+ java.net.URL wsdl = getClass()
+ .getResource("/wsdl_systest_wsspec/imports/add_numbers_imports.wsdl");
+ return wsdl.toString();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ 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!");
+ }
+ }
+
+
+}
Propchange: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/Server.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/Server.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/imports/add_numbers_imports.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/imports/add_numbers_imports.wsdl?rev=1162870&view=auto
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/imports/add_numbers_imports.wsdl (added)
+++ cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/imports/add_numbers_imports.wsdl Mon Aug 29 15:30:46 2011
@@ -0,0 +1,225 @@
+<?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"
+ xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
+ xmlns:wsp="http://www.w3.org/ns/ws-policy">
+ <types>
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema">
+ <xsd:import schemaLocation="add_numbers_imports.xsd" namespace="http://apache.org/cxf/systest/ws/addr_feature/"/>
+ </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" wsam:Action="3in" />
+ <output message="tns:addNumbers3Response" wsam:Action="3out" />
+ <fault name="addNumbersFault" message="tns:addNumbersFault"
+ wsam: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="3in" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ <fault name="addNumbersFault">
+ <soap:fault name="addNumbersFault" use="literal" />
+ </fault>
+ </operation>
+ </binding>
+ <binding name="AddNumbersBindingOnlyAnon" type="tns:AddNumbersPortType">
+ <wsaw:UsingAddressing wsdl:required="false" />
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
+ style="document" />
+ <wsp:PolicyReference URI="#AddNumbersOnlyAnon_WSAM_Addressing_Policy"/>
+ <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>
+ <binding name="AddNumbersBindingNonAnon" type="tns:AddNumbersPortType">
+ <wsaw:UsingAddressing wsdl:required="false" />
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
+ style="document" />
+ <wsp:PolicyReference URI="#AddNumbersNonAnon_WSAM_Addressing_Policy"/>
+ <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>
+ <port name="AddNumbersOnlyAnonPort" binding="tns:AddNumbersBindingOnlyAnon">
+ <soap:address location="http://localhost:9091/jaxws/addAnon" />
+ </port>
+ <port name="AddNumbersNonAnonPort" binding="tns:AddNumbersBindingNonAnon">
+ <soap:address location="http://localhost:9091/jaxws/addNonAnon" />
+ </port>
+ </service>
+
+ <wsp:Policy wsu:Id="AddNumbersNonAnon_WSAM_Addressing_Policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+ <wsam:Addressing>
+ <wsp:Policy>
+ <wsam:NonAnonymousResponses />
+ </wsp:Policy>
+ </wsam:Addressing>
+ </wsp:Policy>
+
+ <wsp:Policy wsu:Id="AddNumbersOnlyAnon_WSAM_Addressing_Policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+ <wsam:Addressing>
+ <wsp:Policy>
+ <wsam:AnonymousResponses />
+ </wsp:Policy>
+ </wsam:Addressing>
+ </wsp:Policy>
+
+</definitions>
Propchange: cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/imports/add_numbers_imports.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/imports/add_numbers_imports.wsdl
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/imports/add_numbers_imports.wsdl
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/imports/add_numbers_imports.xsd
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/imports/add_numbers_imports.xsd?rev=1162870&view=auto
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/imports/add_numbers_imports.xsd (added)
+++ cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/imports/add_numbers_imports.xsd Mon Aug 29 15:30:46 2011
@@ -0,0 +1,49 @@
+<?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.
+ -->
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://apache.org/cxf/systest/ws/addr_feature/"
+ 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>
+
Propchange: cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/imports/add_numbers_imports.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/imports/add_numbers_imports.xsd
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/imports/add_numbers_imports.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml