You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by mm...@apache.org on 2006/09/14 11:58:19 UTC
svn commit: r443301 [1/2] - in /incubator/cxf/trunk:
rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/
rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/
rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ systests/sr...
Author: mmao
Date: Thu Sep 14 02:58:14 2006
New Revision: 443301
URL: http://svn.apache.org/viewvc?view=rev&rev=443301
Log:
* JAX-WS provider/dispatch support invoke oneway and invoke async
* Ported the celtix system tests
* AsyncResponse more generic
* Service.Mode annotation maybe null or the value maybe null, if so we should take the default annotation which is PAYLOAD
Added:
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchAsyncCallable.java (with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq1.xml (with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq2.xml (with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq3.xml (with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq.xml (with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq1.xml (with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq2.xml (with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq3.xml (with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java (with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/Server.java (with props)
Modified:
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/AsyncResponse.java
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxwsImplementorInfo.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourceMessageProvider.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourceMessageProvider.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourcePayloadProvider.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWStreamSourceMessageProvider.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWStreamSourcePayloadProvider.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderClientServerTest.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/resources/GreetMeRpcLiteralResp.xml
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/resources/sayHiRpcLiteralResp.xml
incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java
incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl
Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java?view=diff&rev=443301&r1=443300&r2=443301
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java Thu Sep 14 02:58:14 2006
@@ -43,29 +43,26 @@
setPhase(Phase.UNMARSHAL);
}
- private BindingOperationInfo getOperation(Message message, DepthXMLStreamReader xmlReader) {
+ private BindingOperationInfo getOperation(Message message, QName opName) {
+ return ServiceModelUtil.getOperation(message.getExchange(), opName);
+ }
+
+ public void handleMessage(Message message) {
+ DepthXMLStreamReader xmlReader = getXMLStreamReader(message);
+
+ BindingOperationInfo operation = null;
if (!StaxUtils.toNextElement(xmlReader)) {
message.setContent(Exception.class, new RuntimeException("There must be a method name element."));
}
-
String opName = xmlReader.getLocalName();
if (isRequestor(message) && opName.endsWith("Response")) {
opName = opName.substring(0, opName.length() - 8);
}
- BindingOperationInfo operation = ServiceModelUtil.getOperation(message.getExchange(), new QName(
- xmlReader.getNamespaceURI(), opName));
- return operation;
- }
-
- public void handleMessage(Message message) {
- DepthXMLStreamReader xmlReader = getXMLStreamReader(message);
-
- BindingOperationInfo operation = null;
if (message.getExchange().get(BindingOperationInfo.class) == null) {
- operation = getOperation(message, xmlReader);
+ operation = getOperation(message, new QName(xmlReader.getNamespaceURI(), opName));
if (operation == null) {
- // it's doc-lit-bare
+ // it's doc-lit-bare
new BareInInterceptor().handleMessage(message);
}
message.getExchange().put(BindingOperationInfo.class, operation);
@@ -89,21 +86,22 @@
MessagePartInfo p = msg.getMessageParts().get(idx);
if (p == null) {
message.setContent(Exception.class, new RuntimeException("Parameter " + xmlReader.getName()
- + " does not exist!"));
+ + " does not exist!"));
}
QName name = xmlReader.getName();
QName elName = ServiceModelUtil.getRPCPartName(p);
if (!elName.getLocalPart().equals(name.getLocalPart())) {
- String expMessage = "Parameter " + name + " does not equal to the name in the servicemodel!";
+ String expMessage = "Parameter " + name + " does not equal to the name ["
+ + elName.getLocalPart() + "] in the servicemodel!";
message.setContent(Exception.class, new RuntimeException(expMessage));
- }
+ }
Object param = null;
- param = dr.read(elName, message, (Class)p.getProperty(Class.class.getName()));
+ param = dr.read(elName, message, (Class)p.getProperty(Class.class.getName()));
if (param != null) {
parameters.add(param);
} else {
- throw new RuntimeException(p.getName() + " can not be unmarshalled");
+ throw new RuntimeException(p.getName() + " can not be unmarshalled");
}
}
message.setContent(List.class, parameters);
Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/AsyncResponse.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/AsyncResponse.java?view=diff&rev=443301&r1=443300&r2=443301
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/AsyncResponse.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/AsyncResponse.java Thu Sep 14 02:58:14 2006
@@ -31,11 +31,11 @@
public class AsyncResponse<T> implements Response<T> {
- private final Future<Object> obj;
+ private final Future<T> obj;
private T result;
private Class<T> cls;
- public AsyncResponse(Future<Object> object, Class<T> c) {
+ public AsyncResponse(Future<T> object, Class<T> c) {
obj = object;
cls = c;
}
Added: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchAsyncCallable.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchAsyncCallable.java?view=auto&rev=443301
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchAsyncCallable.java (added)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchAsyncCallable.java Thu Sep 14 02:58:14 2006
@@ -0,0 +1,38 @@
+/**
+ * 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 java.util.concurrent.Callable;
+
+import javax.xml.ws.Dispatch;
+
+public class DispatchAsyncCallable<T> implements Callable<T> {
+ private Dispatch<T> dispatch;
+ private T object;
+ public DispatchAsyncCallable(Dispatch<T> disp, T obj) {
+ dispatch = disp;
+ object = obj;
+ }
+
+ public T call() throws Exception {
+ return dispatch.invoke(object);
+ }
+
+}
Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchAsyncCallable.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchAsyncCallable.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java?view=diff&rev=443301&r1=443300&r2=443301
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java Thu Sep 14 02:58:14 2006
@@ -23,7 +23,9 @@
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
import java.util.concurrent.Future;
+import java.util.concurrent.FutureTask;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -73,28 +75,29 @@
endpoint = ep;
}
- DispatchImpl(Bus b,
- Service.Mode m,
- JAXBContext ctx,
- Class<T> clazz,
- Executor e,
- Endpoint ep) {
+ DispatchImpl(Bus b, Service.Mode m, JAXBContext ctx, Class<T> clazz, Executor e, Endpoint ep) {
bus = b;
executor = e;
context = ctx;
cl = clazz;
mode = m;
-
+
endpoint = ep;
}
public T invoke(T obj) {
+ return invoke(obj, false);
+ }
+
+ public T invoke(T obj, boolean isOneWay) {
if (LOG.isLoggable(Level.INFO)) {
LOG.info("Dispatch: invoke called");
}
- Message message = endpoint.getBinding().createMessage();
-
+ System.err.println("INVOKING...");
+
+ Message message = endpoint.getBinding().createMessage();
+
if (context != null) {
message.setContent(JAXBContext.class, context);
}
@@ -132,28 +135,34 @@
// Exchange's inbound message is set and had been passed through the inbound interceptor chain.
}
- synchronized (exchange) {
- Message inMsg = exchange.getInMessage();
- if (inMsg == null) {
- try {
- exchange.wait();
- } catch (InterruptedException e) {
- //TODO - timeout
- }
- inMsg = exchange.getInMessage();
+ if (!isOneWay) {
+ synchronized (exchange) {
+ Message inMsg = waitResponse(exchange);
+ return cl.cast(inMsg.getContent(Object.class));
}
- if (inMsg.getContent(Exception.class) != null) {
- //TODO - exceptions
- throw new RuntimeException(inMsg.getContent(Exception.class));
- }
- // TODO, just assume it's soap message, should handle the DOMSouce, SAXSource etc.
- return cl.cast(inMsg.getContent(Object.class));
}
+ return null;
// populateResponseContext(objMsgContext);
// return cl.cast(objMsgContext.getReturn());
}
-
+ private Message waitResponse(Exchange exchange) {
+ Message inMsg = exchange.getInMessage();
+ if (inMsg == null) {
+ try {
+ exchange.wait();
+ } catch (InterruptedException e) {
+ //TODO - timeout
+ }
+ inMsg = exchange.getInMessage();
+ }
+ if (inMsg.getContent(Exception.class) != null) {
+ //TODO - exceptions
+ throw new RuntimeException(inMsg.getContent(Exception.class));
+ }
+ return inMsg;
+ }
+
private PhaseInterceptorChain getDispatchOutChain() {
PhaseManager pm = bus.getExtension(PhaseManager.class);
PhaseInterceptorChain chain = new PhaseInterceptorChain(pm.getOutPhases());
@@ -231,19 +240,36 @@
return null;
}
+ private Executor getExecutor() {
+ if (executor == null) {
+ executor = endpoint.getService().getExecutor();
+ }
+ if (executor == null) {
+ executor = Executors.newFixedThreadPool(5);
+ }
+ if (executor == null) {
+ System.err.println("Can't not get executor");
+ }
+ return executor;
+ }
+
public Future<?> invokeAsync(T obj, AsyncHandler<T> asyncHandler) {
- // TODO
- return null;
+ Response<?> r = invokeAsync(obj);
+ AsyncCallbackFuture callback = new AsyncCallbackFuture(r, asyncHandler);
+
+ getExecutor().execute(callback);
+ return callback;
}
+ @SuppressWarnings("unchecked")
public Response<T> invokeAsync(T obj) {
- Response<T> response = null;
- executor.execute(null);
- // TODO
- return response;
+ FutureTask<T> f = new FutureTask<T>(new DispatchAsyncCallable<T>(this, obj));
+
+ getExecutor().execute(f);
+ return new AsyncResponse<T>(f, cl);
}
public void invokeOneWay(T obj) {
- // TODO
+ invoke(obj, true);
}
}
Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxwsImplementorInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxwsImplementorInfo.java?view=diff&rev=443301&r1=443300&r2=443301
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxwsImplementorInfo.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxwsImplementorInfo.java Thu Sep 14 02:58:14 2006
@@ -147,8 +147,8 @@
if ((null != portName && !"".equals(portName))
|| (null != serviceName && !"".equals(serviceName))
|| (null != endpointInterface && !"".equals(endpointInterface))) {
- throw new
- WebServiceException(BUNDLE.getString("ILLEGAL_ATTRIBUTE_IN_SEI_ANNOTATION_EXC"));
+ String expString = BUNDLE.getString("ILLEGAL_ATTRIBUTE_IN_SEI_ANNOTATION_EXC");
+ throw new WebServiceException(expString);
}
}
} else {
@@ -165,7 +165,11 @@
}
public Service.Mode getServiceMode() {
- return implementorClass.getAnnotation(ServiceMode.class).value();
+ ServiceMode m = implementorClass.getAnnotation(ServiceMode.class);
+ if (m != null && m.value() != null) {
+ return m.value();
+ }
+ return Service.Mode.PAYLOAD;
}
public Class<?> getProviderParameterType() {
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java?view=diff&rev=443301&r1=443300&r2=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java Thu Sep 14 02:58:14 2006
@@ -21,19 +21,27 @@
import java.io.InputStream;
import java.net.URL;
+import java.util.concurrent.Future;
import javax.xml.bind.JAXBContext;
import javax.xml.namespace.QName;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPMessage;
import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.AsyncHandler;
import javax.xml.ws.Dispatch;
import javax.xml.ws.Endpoint;
+import javax.xml.ws.Response;
import javax.xml.ws.Service;
+import org.xml.sax.InputSource;
+
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.apache.cxf.helpers.XMLUtils;
import org.apache.cxf.systest.common.ClientServerSetupBase;
import org.apache.cxf.systest.common.ClientServerTestBase;
import org.apache.cxf.systest.common.TestServerBase;
@@ -44,10 +52,9 @@
public class DispatchClientServerTest extends ClientServerTestBase {
- private final QName serviceName = new QName("http://apache.org/hello_world_soap_http",
+ private final QName serviceName = new QName("http://apache.org/hello_world_soap_http",
"SOAPDispatchService");
- private final QName portName = new QName("http://apache.org/hello_world_soap_http",
- "SoapDispatchPort");
+ private final QName portName = new QName("http://apache.org/hello_world_soap_http", "SoapDispatchPort");
public static class Server extends TestServerBase {
@@ -88,18 +95,50 @@
SOAPService service = new SOAPService(wsdl, serviceName);
assertNotNull(service);
+ Dispatch<SOAPMessage> disp = service
+ .createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE);
+
+ // Test request-response
InputStream is = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
SOAPMessage soapReqMsg = MessageFactory.newInstance().createMessage(null, is);
assertNotNull(soapReqMsg);
-
- Dispatch<SOAPMessage> disp = service
- .createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE);
SOAPMessage soapResMsg = disp.invoke(soapReqMsg);
assertNotNull(soapResMsg);
String expected = "Hello TestSOAPInputMessage";
assertEquals("Response should be : Hello TestSOAPInputMessage", expected, soapResMsg.getSOAPBody()
.getTextContent());
+ // Test oneway
+ InputStream is1 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq1.xml");
+ SOAPMessage soapReqMsg1 = MessageFactory.newInstance().createMessage(null, is1);
+ assertNotNull(soapReqMsg1);
+ disp.invokeOneWay(soapReqMsg1);
+
+ // Test async polling
+ InputStream is2 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq2.xml");
+ SOAPMessage soapReqMsg2 = MessageFactory.newInstance().createMessage(null, is2);
+ assertNotNull(soapReqMsg2);
+
+ Response response = disp.invokeAsync(soapReqMsg2);
+ SOAPMessage soapResMsg2 = (SOAPMessage)response.get();
+ assertNotNull(soapResMsg2);
+ String expected2 = "Hello TestSOAPInputMessage2";
+ assertEquals("Response should be : Hello TestSOAPInputMessage2", expected2, soapResMsg2.getSOAPBody()
+ .getTextContent());
+
+ // Test async callback
+ InputStream is3 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq3.xml");
+ SOAPMessage soapReqMsg3 = MessageFactory.newInstance().createMessage(null, is3);
+ assertNotNull(soapReqMsg3);
+ TestSOAPMessageHandler tsmh = new TestSOAPMessageHandler();
+ Future f = disp.invokeAsync(soapReqMsg3, tsmh);
+ assertNotNull(f);
+ while (!f.isDone()) {
+ // wait
+ }
+ String expected3 = "Hello TestSOAPInputMessage3";
+ assertEquals("Response should be : Hello TestSOAPInputMessage3", expected3, tsmh.getReplyBuffer());
+
}
public void testDOMSourceMESSAGE() throws Exception {
@@ -121,6 +160,41 @@
assertEquals("Response should be : Hello TestSOAPInputMessage", expected, domResMsg.getNode()
.getFirstChild().getTextContent());
+
+ // Test invoke oneway
+ InputStream is1 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq1.xml");
+ SOAPMessage soapReqMsg1 = MessageFactory.newInstance().createMessage(null, is1);
+ DOMSource domReqMsg1 = new DOMSource(soapReqMsg1.getSOAPPart());
+ assertNotNull(domReqMsg1);
+ disp.invokeOneWay(domReqMsg1);
+
+ // Test async polling
+ InputStream is2 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq2.xml");
+ SOAPMessage soapReqMsg2 = MessageFactory.newInstance().createMessage(null, is2);
+ DOMSource domReqMsg2 = new DOMSource(soapReqMsg2.getSOAPPart());
+ assertNotNull(domReqMsg2);
+
+ Response response = disp.invokeAsync(domReqMsg2);
+ DOMSource domRespMsg2 = (DOMSource)response.get();
+ assertNotNull(domReqMsg2);
+ String expected2 = "Hello TestSOAPInputMessage2";
+ assertEquals("Response should be : Hello TestSOAPInputMessage2", expected2, domRespMsg2.getNode()
+ .getFirstChild().getTextContent());
+
+ // Test async callback
+ InputStream is3 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq3.xml");
+ SOAPMessage soapReqMsg3 = MessageFactory.newInstance().createMessage(null, is3);
+ DOMSource domReqMsg3 = new DOMSource(soapReqMsg3.getSOAPPart());
+ assertNotNull(domReqMsg3);
+
+ TestDOMSourceHandler tdsh = new TestDOMSourceHandler();
+ Future fd = disp.invokeAsync(domReqMsg3, tdsh);
+ assertNotNull(fd);
+ while (!fd.isDone()) {
+ // wait
+ }
+ String expected3 = "Hello TestSOAPInputMessage3";
+ assertEquals("Response should be : Hello TestSOAPInputMessage3", expected3, tdsh.getReplyBuffer());
}
public void testDOMSourcePAYLOAD() throws Exception {
@@ -130,19 +204,52 @@
SOAPService service = new SOAPService(wsdl, serviceName);
assertNotNull(service);
+ Dispatch<DOMSource> disp = service.createDispatch(portName, DOMSource.class, Service.Mode.PAYLOAD);
+
InputStream is = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
SOAPMessage soapReqMsg = MessageFactory.newInstance().createMessage(null, is);
DOMSource domReqMsg = new DOMSource(soapReqMsg.getSOAPBody().extractContentAsDocument());
assertNotNull(domReqMsg);
- Dispatch<DOMSource> disp = service.createDispatch(portName, DOMSource.class, Service.Mode.PAYLOAD);
-
// invoke
DOMSource domResMsg = disp.invoke(domReqMsg);
assertNotNull(domResMsg);
String expected = "Hello TestSOAPInputMessage";
assertEquals("Response should be : Hello TestSOAPInputMessage", expected, domResMsg.getNode()
.getFirstChild().getTextContent());
+
+ InputStream is1 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq1.xml");
+ SOAPMessage soapReqMsg1 = MessageFactory.newInstance().createMessage(null, is1);
+ DOMSource domReqMsg1 = new DOMSource(soapReqMsg1.getSOAPBody().extractContentAsDocument());
+ assertNotNull(domReqMsg1);
+ // invokeOneWay
+ disp.invokeOneWay(domReqMsg1);
+
+ InputStream is2 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq2.xml");
+ SOAPMessage soapReqMsg2 = MessageFactory.newInstance().createMessage(null, is2);
+ DOMSource domReqMsg2 = new DOMSource(soapReqMsg2.getSOAPBody().extractContentAsDocument());
+ assertNotNull(domReqMsg2);
+ // invokeAsync
+ Response response = disp.invokeAsync(domReqMsg2);
+ DOMSource domRespMsg2 = (DOMSource)response.get();
+ assertNotNull(domRespMsg2);
+ String expected2 = "Hello TestSOAPInputMessage2";
+ assertEquals("Response should be : Hello TestSOAPInputMessage2", expected2, domRespMsg2.getNode()
+ .getFirstChild().getTextContent());
+
+ InputStream is3 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq3.xml");
+ SOAPMessage soapReqMsg3 = MessageFactory.newInstance().createMessage(null, is3);
+ DOMSource domReqMsg3 = new DOMSource(soapReqMsg3.getSOAPBody().extractContentAsDocument());
+ assertNotNull(domReqMsg3);
+ // invokeAsync with AsyncHandler
+ TestDOMSourceHandler tdsh = new TestDOMSourceHandler();
+ Future fd = disp.invokeAsync(domReqMsg3, tdsh);
+ assertNotNull(fd);
+ while (!fd.isDone()) {
+ // wait
+ }
+ String expected3 = "Hello TestSOAPInputMessage3";
+ assertEquals("Response should be : Hello TestSOAPInputMessage3", expected3, tdsh.getReplyBuffer());
}
public void testJAXBObjectPAYLOAD() throws Exception {
@@ -163,6 +270,321 @@
assertNotNull(response);
String responseValue = ((GreetMeResponse)response).getResponseType();
assertTrue("Expected string, " + expected, expected.equals(responseValue));
+
+ // Test oneway
+ disp.invokeOneWay(greetMe);
+
+ // Test async polling
+ Response response2 = disp.invokeAsync(greetMe);
+ assertNotNull(response2);
+ GreetMeResponse greetMeResponse = (GreetMeResponse)response2.get();
+ String responseValue2 = greetMeResponse.getResponseType();
+ assertTrue("Expected string, " + expected, expected.equals(responseValue2));
+
+ // Test async callback
+ TestJAXBHandler tjbh = new TestJAXBHandler();
+ Future fd = disp.invokeAsync(greetMe, tjbh);
+ assertNotNull(fd);
+ while (!fd.isDone()) {
+ // wait
+ }
+ String responseValue3 = ((GreetMeResponse)tjbh.getResponse()).getResponseType();
+ assertTrue("Expected string, " + expected, expected.equals(responseValue3));
+ }
+
+ public void testSAXSourceMESSAGE() throws Exception {
+
+ URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
+ assertNotNull(wsdl);
+
+ SOAPService service = new SOAPService(wsdl, serviceName);
+ assertNotNull(service);
+
+ InputStream is = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
+ InputSource inputSource = new InputSource(is);
+ SAXSource saxSourceReq = new SAXSource(inputSource);
+ assertNotNull(saxSourceReq);
+
+ Dispatch<SAXSource> disp = service.createDispatch(portName, SAXSource.class, Service.Mode.MESSAGE);
+ SAXSource saxSourceResp = disp.invoke(saxSourceReq);
+ assertNotNull(saxSourceResp);
+ String expected = "Hello TestSOAPInputMessage";
+ assertTrue("Expected: " + expected, XMLUtils.toString(saxSourceResp).contains(expected));
+
+ // Test oneway
+ InputStream is1 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq1.xml");
+ InputSource inputSource1 = new InputSource(is1);
+ SAXSource saxSourceReq1 = new SAXSource(inputSource1);
+ assertNotNull(saxSourceReq1);
+ disp.invokeOneWay(saxSourceReq1);
+
+ // Test async polling
+ InputStream is2 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq2.xml");
+ InputSource inputSource2 = new InputSource(is2);
+ SAXSource saxSourceReq2 = new SAXSource(inputSource2);
+ assertNotNull(saxSourceReq2);
+
+ Response response = disp.invokeAsync(saxSourceReq2);
+ SAXSource saxSourceResp2 = (SAXSource)response.get();
+ assertNotNull(saxSourceResp2);
+ String expected2 = "Hello TestSOAPInputMessage2";
+ assertTrue("Expected: " + expected, XMLUtils.toString(saxSourceResp2).contains(expected2));
+
+ // Test async callback
+ InputStream is3 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq3.xml");
+ InputSource inputSource3 = new InputSource(is3);
+ SAXSource saxSourceReq3 = new SAXSource(inputSource3);
+ assertNotNull(saxSourceReq3);
+ TestSAXSourceHandler tssh = new TestSAXSourceHandler();
+ Future fd = disp.invokeAsync(saxSourceReq3, tssh);
+ assertNotNull(fd);
+ while (!fd.isDone()) {
+ //wait
+ }
+ String expected3 = "Hello TestSOAPInputMessage3";
+ SAXSource saxSourceResp3 = tssh.getSAXSource();
+ assertNotNull(saxSourceResp3);
+ assertTrue("Expected: " + expected, XMLUtils.toString(saxSourceResp3).contains(expected3));
+ }
+
+ public void testSAXSourcePAYLOAD() throws Exception {
+
+ URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
+ assertNotNull(wsdl);
+
+ SOAPService service = new SOAPService(wsdl, serviceName);
+ assertNotNull(service);
+
+ Dispatch<SAXSource> disp = service.createDispatch(portName, SAXSource.class, Service.Mode.PAYLOAD);
+
+ // Test request-response
+ InputStream is = getClass().getResourceAsStream("resources/GreetMeDocLiteralSOAPBodyReq.xml");
+ InputSource inputSource = new InputSource(is);
+ SAXSource saxSourceReq = new SAXSource(inputSource);
+ assertNotNull(saxSourceReq);
+ SAXSource saxSourceResp = disp.invoke(saxSourceReq);
+ assertNotNull(saxSourceResp);
+ String expected = "Hello TestSOAPInputMessage";
+ assertTrue("Expected: " + expected, XMLUtils.toString(saxSourceResp).contains(expected));
+
+ // Test oneway
+ InputStream is1 = getClass().getResourceAsStream("resources/GreetMeDocLiteralSOAPBodyReq1.xml");
+ InputSource inputSource1 = new InputSource(is1);
+ SAXSource saxSourceReq1 = new SAXSource(inputSource1);
+ assertNotNull(saxSourceReq1);
+ disp.invokeOneWay(saxSourceReq1);
+
+ // Test async polling
+ InputStream is2 = getClass().getResourceAsStream("resources/GreetMeDocLiteralSOAPBodyReq2.xml");
+ InputSource inputSource2 = new InputSource(is2);
+ SAXSource saxSourceReq2 = new SAXSource(inputSource2);
+ assertNotNull(saxSourceReq2);
+ Response response = disp.invokeAsync(saxSourceReq2);
+ SAXSource saxSourceResp2 = (SAXSource)response.get();
+ assertNotNull(saxSourceResp2);
+ String expected2 = "Hello TestSOAPInputMessage2";
+ assertTrue("Expected: " + expected, XMLUtils.toString(saxSourceResp2).contains(expected2));
+
+ // Test async callback
+ InputStream is3 = getClass().getResourceAsStream("resources/GreetMeDocLiteralSOAPBodyReq3.xml");
+ InputSource inputSource3 = new InputSource(is3);
+ SAXSource saxSourceReq3 = new SAXSource(inputSource3);
+ assertNotNull(saxSourceReq3);
+
+ TestSAXSourceHandler tssh = new TestSAXSourceHandler();
+ Future fd = disp.invokeAsync(saxSourceReq3, tssh);
+ assertNotNull(fd);
+ while (!fd.isDone()) {
+ //wait
+ }
+ String expected3 = "Hello TestSOAPInputMessage3";
+ SAXSource saxSourceResp3 = tssh.getSAXSource();
+ assertNotNull(saxSourceResp3);
+ assertTrue("Expected: " + expected, XMLUtils.toString(saxSourceResp3).contains(expected3));
+ }
+
+ public void testStreamSourceMESSAGE() throws Exception {
+ URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
+ assertNotNull(wsdl);
+
+ SOAPService service = new SOAPService(wsdl, serviceName);
+ assertNotNull(service);
+ Dispatch<StreamSource> disp = service.createDispatch(portName, StreamSource.class,
+ Service.Mode.MESSAGE);
+
+ InputStream is = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
+ StreamSource streamSourceReq = new StreamSource(is);
+ assertNotNull(streamSourceReq);
+ StreamSource streamSourceResp = disp.invoke(streamSourceReq);
+ assertNotNull(streamSourceResp);
+ String expected = "Hello TestSOAPInputMessage";
+ assertTrue("Expected: " + expected, XMLUtils.toString(streamSourceResp).contains(expected));
+
+ InputStream is1 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq1.xml");
+ StreamSource streamSourceReq1 = new StreamSource(is1);
+ assertNotNull(streamSourceReq1);
+ disp.invokeOneWay(streamSourceReq1);
+
+ InputStream is2 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq2.xml");
+ StreamSource streamSourceReq2 = new StreamSource(is2);
+ assertNotNull(streamSourceReq2);
+ Response response = disp.invokeAsync(streamSourceReq2);
+ StreamSource streamSourceResp2 = (StreamSource)response.get();
+ assertNotNull(streamSourceResp2);
+ String expected2 = "Hello TestSOAPInputMessage2";
+ assertTrue("Expected: " + expected, XMLUtils.toString(streamSourceResp2).contains(expected2));
+
+ InputStream is3 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq3.xml");
+ StreamSource streamSourceReq3 = new StreamSource(is3);
+ assertNotNull(streamSourceReq3);
+ TestStreamSourceHandler tssh = new TestStreamSourceHandler();
+ Future fd = disp.invokeAsync(streamSourceReq3, tssh);
+ assertNotNull(fd);
+ while (!fd.isDone()) {
+ //wait
+ }
+ String expected3 = "Hello TestSOAPInputMessage3";
+ StreamSource streamSourceResp3 = tssh.getStreamSource();
+ assertNotNull(streamSourceResp3);
+ assertTrue("Expected: " + expected, XMLUtils.toString(streamSourceResp3).contains(expected3));
+ }
+
+ public void testStreamSourcePAYLOAD() throws Exception {
+
+ URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
+ assertNotNull(wsdl);
+
+ SOAPService service = new SOAPService(wsdl, serviceName);
+ assertNotNull(service);
+ Dispatch<StreamSource> disp = service.createDispatch(portName, StreamSource.class,
+ Service.Mode.PAYLOAD);
+
+ InputStream is = getClass().getResourceAsStream("resources/GreetMeDocLiteralSOAPBodyReq.xml");
+ StreamSource streamSourceReq = new StreamSource(is);
+ assertNotNull(streamSourceReq);
+ StreamSource streamSourceResp = disp.invoke(streamSourceReq);
+ assertNotNull(streamSourceResp);
+ String expected = "Hello TestSOAPInputMessage";
+ assertTrue("Expected: " + expected, XMLUtils.toString(streamSourceResp).contains(expected));
+
+ InputStream is1 = getClass().getResourceAsStream("resources/GreetMeDocLiteralSOAPBodyReq1.xml");
+ StreamSource streamSourceReq1 = new StreamSource(is1);
+ assertNotNull(streamSourceReq1);
+ disp.invokeOneWay(streamSourceReq1);
+
+ // Test async polling
+ InputStream is2 = getClass().getResourceAsStream("resources/GreetMeDocLiteralSOAPBodyReq2.xml");
+ StreamSource streamSourceReq2 = new StreamSource(is2);
+ assertNotNull(streamSourceReq2);
+ Response response = disp.invokeAsync(streamSourceReq2);
+ StreamSource streamSourceResp2 = (StreamSource)response.get();
+ assertNotNull(streamSourceResp2);
+ String expected2 = "Hello TestSOAPInputMessage2";
+ assertTrue("Expected: " + expected, XMLUtils.toString(streamSourceResp2).contains(expected2));
+
+ // Test async callback
+ InputStream is3 = getClass().getResourceAsStream("resources/GreetMeDocLiteralSOAPBodyReq3.xml");
+ StreamSource streamSourceReq3 = new StreamSource(is3);
+ assertNotNull(streamSourceReq3);
+
+ TestStreamSourceHandler tssh = new TestStreamSourceHandler();
+ Future fd = disp.invokeAsync(streamSourceReq3, tssh);
+ assertNotNull(fd);
+ while (!fd.isDone()) {
+ //wait
+ }
+ String expected3 = "Hello TestSOAPInputMessage3";
+ StreamSource streamSourceResp3 = tssh.getStreamSource();
+ assertNotNull(streamSourceResp3);
+ assertTrue("Expected: " + expected, XMLUtils.toString(streamSourceResp3).contains(expected3));
}
+ class TestSOAPMessageHandler implements AsyncHandler<SOAPMessage> {
+
+ String replyBuffer;
+
+ public void handleResponse(Response<SOAPMessage> response) {
+ try {
+ SOAPMessage reply = response.get();
+ replyBuffer = reply.getSOAPBody().getTextContent();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public String getReplyBuffer() {
+ return replyBuffer;
+ }
+ }
+
+ class TestDOMSourceHandler implements AsyncHandler<DOMSource> {
+
+ String replyBuffer;
+
+ public void handleResponse(Response<DOMSource> response) {
+ try {
+ DOMSource reply = response.get();
+ replyBuffer = reply.getNode().getFirstChild().getTextContent();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public String getReplyBuffer() {
+ return replyBuffer;
+ }
+ }
+
+ class TestJAXBHandler implements AsyncHandler<Object> {
+
+ Object reply;
+
+ public void handleResponse(Response<Object> response) {
+ try {
+ reply = response.get();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public Object getResponse() {
+ return reply;
+ }
+ }
+
+ class TestSAXSourceHandler implements AsyncHandler<SAXSource> {
+
+ SAXSource reply;
+
+ public void handleResponse(Response<SAXSource> response) {
+ try {
+ reply = response.get();
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public SAXSource getSAXSource() {
+ return reply;
+ }
+ }
+
+ class TestStreamSourceHandler implements AsyncHandler<StreamSource> {
+
+ StreamSource reply;
+
+ public void handleResponse(Response<StreamSource> response) {
+ try {
+ reply = response.get();
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public StreamSource getStreamSource() {
+ return reply;
+ }
+ }
}
Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq1.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq1.xml?view=auto&rev=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq1.xml (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq1.xml Thu Sep 14 02:58:14 2006
@@ -0,0 +1,20 @@
+<?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.
+-->
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns4:greetMe xmlns:ns4="http://apache.org/hello_world_soap_http/types"><ns4:requestType>TestSOAPInputMessage1</ns4:requestType></ns4:greetMe></SOAP-ENV:Body></SOAP-ENV:Envelope>
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq1.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq1.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq1.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq2.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq2.xml?view=auto&rev=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq2.xml (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq2.xml Thu Sep 14 02:58:14 2006
@@ -0,0 +1,20 @@
+<?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.
+-->
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns4:greetMe xmlns:ns4="http://apache.org/hello_world_soap_http/types"><ns4:requestType>TestSOAPInputMessage2</ns4:requestType></ns4:greetMe></SOAP-ENV:Body></SOAP-ENV:Envelope>
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq2.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq2.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq2.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq3.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq3.xml?view=auto&rev=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq3.xml (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq3.xml Thu Sep 14 02:58:14 2006
@@ -0,0 +1,20 @@
+<?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.
+-->
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns4:greetMe xmlns:ns4="http://apache.org/hello_world_soap_http/types"><ns4:requestType>TestSOAPInputMessage3</ns4:requestType></ns4:greetMe></SOAP-ENV:Body></SOAP-ENV:Envelope>
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq3.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq3.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq3.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq.xml?view=auto&rev=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq.xml (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq.xml Thu Sep 14 02:58:14 2006
@@ -0,0 +1,19 @@
+<?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.
+--><ns4:greetMe xmlns:ns4="http://apache.org/hello_world_soap_http/types"><ns4:requestType>TestSOAPInputMessage</ns4:requestType></ns4:greetMe>
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq1.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq1.xml?view=auto&rev=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq1.xml (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq1.xml Thu Sep 14 02:58:14 2006
@@ -0,0 +1,19 @@
+<?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.
+--><ns4:greetMe xmlns:ns4="http://apache.org/hello_world_soap_http/types"><ns4:requestType>TestSOAPInputMessage1</ns4:requestType></ns4:greetMe>
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq1.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq1.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq1.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq2.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq2.xml?view=auto&rev=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq2.xml (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq2.xml Thu Sep 14 02:58:14 2006
@@ -0,0 +1,19 @@
+<?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.
+--><ns4:greetMe xmlns:ns4="http://apache.org/hello_world_soap_http/types"><ns4:requestType>TestSOAPInputMessage2</ns4:requestType></ns4:greetMe>
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq2.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq2.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq2.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq3.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq3.xml?view=auto&rev=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq3.xml (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq3.xml Thu Sep 14 02:58:14 2006
@@ -0,0 +1,19 @@
+<?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.
+--><ns4:greetMe xmlns:ns4="http://apache.org/hello_world_soap_http/types"><ns4:requestType>TestSOAPInputMessage3</ns4:requestType></ns4:greetMe>
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq3.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq3.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralSOAPBodyReq3.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourceMessageProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourceMessageProvider.java?view=diff&rev=443301&r1=443300&r2=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourceMessageProvider.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourceMessageProvider.java Thu Sep 14 02:58:14 2006
@@ -34,7 +34,7 @@
//The following wsdl file is used.
//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
-@WebServiceProvider(portName = "SoapPortRPCLit1", serviceName = "SOAPServiceRPCLit1",
+@WebServiceProvider(portName = "SoapPortProviderRPCLit2", serviceName = "SOAPServiceProviderRPCLit",
targetNamespace = "http://apache.org/hello_world_rpclit",
wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
@ServiceMode(value = Service.Mode.MESSAGE)
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java?view=diff&rev=443301&r1=443300&r2=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java Thu Sep 14 02:58:14 2006
@@ -33,7 +33,7 @@
//The following wsdl file is used.
//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
-@WebServiceProvider(portName = "SoapPortRPCLit2", serviceName = "SOAPServiceRPCLit2",
+@WebServiceProvider(portName = "SoapPortProviderRPCLit3", serviceName = "SOAPServiceProviderRPCLit",
targetNamespace = "http://apache.org/hello_world_rpclit",
wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
public class HWDOMSourcePayloadProvider implements Provider<DOMSource> {
@@ -45,7 +45,6 @@
private MessageFactory factory;
public HWDOMSourcePayloadProvider() {
-
try {
factory = MessageFactory.newInstance();
InputStream is = getClass().getResourceAsStream("resources/sayHiRpcLiteralResp.xml");
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourceMessageProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourceMessageProvider.java?view=diff&rev=443301&r1=443300&r2=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourceMessageProvider.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourceMessageProvider.java Thu Sep 14 02:58:14 2006
@@ -37,7 +37,7 @@
//The following wsdl file is used.
//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
-@WebServiceProvider(portName = "SoapPortRPCLit3", serviceName = "SOAPServiceRPCLit3",
+@WebServiceProvider(portName = "SoapPortProviderRPCLit4", serviceName = "SOAPServiceProviderRPCLit",
targetNamespace = "http://apache.org/hello_world_rpclit",
wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
@ServiceMode(value = Service.Mode.MESSAGE)
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourcePayloadProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourcePayloadProvider.java?view=diff&rev=443301&r1=443300&r2=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourcePayloadProvider.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourcePayloadProvider.java Thu Sep 14 02:58:14 2006
@@ -46,7 +46,7 @@
//The following wsdl file is used.
//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
-@WebServiceProvider(portName = "SoapPortRPCLit5", serviceName = "SOAPServiceRPCLit5",
+@WebServiceProvider(portName = "SoapPortProviderRPCLit6", serviceName = "SOAPServiceProviderRPCLit",
targetNamespace = "http://apache.org/hello_world_rpclit",
wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
@ServiceMode(value = Service.Mode.PAYLOAD)
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java?view=diff&rev=443301&r1=443300&r2=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java Thu Sep 14 02:58:14 2006
@@ -33,7 +33,7 @@
//The following wsdl file is used.
//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
-@WebServiceProvider(portName = "SoapPortRPCLit", serviceName = "SOAPServiceRPCLit",
+@WebServiceProvider(portName = "SoapPortProviderRPCLit1", serviceName = "SOAPServiceProviderRPCLit",
targetNamespace = "http://apache.org/hello_world_rpclit",
wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
@ServiceMode(value = Service.Mode.MESSAGE)
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWStreamSourceMessageProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWStreamSourceMessageProvider.java?view=diff&rev=443301&r1=443300&r2=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWStreamSourceMessageProvider.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWStreamSourceMessageProvider.java Thu Sep 14 02:58:14 2006
@@ -37,7 +37,7 @@
//The following wsdl file is used.
//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
-@WebServiceProvider(portName = "SoapPortRPCLit4", serviceName = "SOAPServiceRPCLit4",
+@WebServiceProvider(portName = "SoapPortProviderRPCLit5", serviceName = "SOAPServiceProviderRPCLit",
targetNamespace = "http://apache.org/hello_world_rpclit",
wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
@ServiceMode(value = Service.Mode.MESSAGE)
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWStreamSourcePayloadProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWStreamSourcePayloadProvider.java?view=diff&rev=443301&r1=443300&r2=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWStreamSourcePayloadProvider.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWStreamSourcePayloadProvider.java Thu Sep 14 02:58:14 2006
@@ -45,7 +45,7 @@
//The following wsdl file is used.
//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
-@WebServiceProvider(portName = "SoapPortRPCLit6", serviceName = "SOAPServiceRPCLit6",
+@WebServiceProvider(portName = "SoapPortProviderRPCLit7", serviceName = "SOAPServiceProviderRPCLit",
targetNamespace = "http://apache.org/hello_world_rpclit",
wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
@ServiceMode(value = Service.Mode.PAYLOAD)
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderClientServerTest.java?view=diff&rev=443301&r1=443300&r2=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderClientServerTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderClientServerTest.java Thu Sep 14 02:58:14 2006
@@ -40,31 +40,7 @@
protected void run() {
Object implementor = new HWSoapMessageDocProvider();
String address = "http://localhost:9003/SoapContext/SoapProviderPort";
- Endpoint.publish(address, implementor);
-
-// implementor = new HWDOMSourceMessageProvider();
-// address = new String("http://localhost:9002/SOAPServiceRPCLit/SoapPort1");
-// Endpoint.publish(address, implementor);
-//
-// implementor = new HWDOMSourcePayloadProvider();
-// address = new String("http://localhost:9002/SOAPServiceRPCLit/SoapPort2");
-// Endpoint.publish(address, implementor);
-//
-// implementor = new HWSAXSourceMessageProvider();
-// address = new String("http://localhost:9002/SOAPServiceRPCLit/SoapPort3");
-// Endpoint.publish(address, implementor);
-//
-// implementor = new HWStreamSourceMessageProvider();
-// address = new String("http://localhost:9002/SOAPServiceRPCLit/SoapPort4");
-// Endpoint.publish(address, implementor);
-//
-// implementor = new HWSAXSourcePayloadProvider();
-// address = new String("http://localhost:9002/SOAPServiceRPCLit/SoapPort5");
-// Endpoint.publish(address, implementor);
-//
-// implementor = new HWStreamSourcePayloadProvider();
-// address = new String("http://localhost:9002/SOAPServiceRPCLit/SoapPort6");
-// Endpoint.publish(address, implementor);
+ Endpoint.publish(address, implementor);
}
public static void main(String[] args) {
@@ -88,37 +64,6 @@
}
};
}
-
-// public void testSOAPMessageModeRPC() throws Exception {
-//
-// QName serviceName =
-// new QName("http://apache.org/hello_world_rpclit", "SOAPServiceRPCLit");
-// QName portName =
-// new QName("http://apache.org/hello_world_rpclit", "SoapPortRPCLit");
-//
-// URL wsdl = getClass().getResource("/wsdl/hello_world_rpc_lit.wsdl");
-// assertNotNull(wsdl);
-//
-// SOAPServiceRPCLit service = new SOAPServiceRPCLit(wsdl, serviceName);
-// assertNotNull(service);
-//
-// String response1 = new String("TestGreetMeResponse");
-// String response2 = new String("TestSayHiResponse");
-// try {
-// GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class);
-// for (int idx = 0; idx < 2; idx++) {
-// String greeting = greeter.greetMe("Milestone-" + idx);
-// assertNotNull("no response received from service", greeting);
-// assertEquals(response1, greeting);
-//
-// String reply = greeter.sayHi();
-// assertNotNull("no response received from service", reply);
-// assertEquals(response2, reply);
-// }
-// } catch (UndeclaredThrowableException ex) {
-// throw (Exception)ex.getCause();
-// }
-// }
public void testSOAPMessageModeDocLit() throws Exception {
Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java?view=auto&rev=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java Thu Sep 14 02:58:14 2006
@@ -0,0 +1,144 @@
+/**
+ * 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.provider;
+
+import java.lang.reflect.UndeclaredThrowableException;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.cxf.systest.common.ClientServerSetupBase;
+import org.apache.cxf.systest.common.ClientServerTestBase;
+import org.apache.hello_world_rpclit.GreeterRPCLit;
+import org.apache.hello_world_rpclit.SOAPServiceRPCLit;
+
+public class ProviderRPCClientServerTest extends ClientServerTestBase {
+
+ public static Test suite() throws Exception {
+ TestSuite suite = new TestSuite(ProviderRPCClientServerTest.class);
+ return new ClientServerSetupBase(suite) {
+ public void startServers() throws Exception {
+ assertTrue("server did not launch correctly", launchServer(Server.class));
+ }
+ };
+ }
+
+ private void doGreeterRPCLit(SOAPServiceRPCLit service, QName portName, int count) throws Exception {
+ String response1 = new String("TestGreetMeResponse");
+ String response2 = new String("TestSayHiResponse");
+ try {
+ GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class);
+ for (int idx = 0; idx < count; idx++) {
+ String greeting = greeter.greetMe("Milestone-" + idx);
+ assertNotNull("no response received from service", greeting);
+ assertEquals(response1, greeting);
+
+ String reply = greeter.sayHi();
+ assertNotNull("no response received from service", reply);
+ assertEquals(response2, reply);
+ }
+ } catch (UndeclaredThrowableException ex) {
+ throw (Exception)ex.getCause();
+ }
+ }
+
+ public void testSOAPMessageModeRPC() throws Exception {
+
+ QName serviceName = new QName("http://apache.org/hello_world_rpclit", "SOAPServiceProviderRPCLit");
+ QName portName = new QName("http://apache.org/hello_world_rpclit", "SoapPortProviderRPCLit1");
+
+ URL wsdl = getClass().getResource("/wsdl/hello_world_rpc_lit.wsdl");
+ assertNotNull(wsdl);
+
+ SOAPServiceRPCLit service = new SOAPServiceRPCLit(wsdl, serviceName);
+ assertNotNull(service);
+
+ doGreeterRPCLit(service, portName, 2);
+ }
+
+ public void testSOAPMessageModeWithDOMSourceData() throws Exception {
+ QName serviceName = new QName("http://apache.org/hello_world_rpclit", "SOAPServiceProviderRPCLit");
+ QName portName = new QName("http://apache.org/hello_world_rpclit", "SoapPortProviderRPCLit2");
+
+ URL wsdl = getClass().getResource("/wsdl/hello_world_rpc_lit.wsdl");
+ assertNotNull(wsdl);
+
+ SOAPServiceRPCLit service = new SOAPServiceRPCLit(wsdl, serviceName);
+ assertNotNull(service);
+
+ doGreeterRPCLit(service, portName, 2);
+ }
+
+ public void testPayloadModeWithDOMSourceData() throws Exception {
+ URL wsdl = getClass().getResource("/wsdl/hello_world_rpc_lit.wsdl");
+ assertNotNull(wsdl);
+
+ QName serviceName = new QName("http://apache.org/hello_world_rpclit", "SOAPServiceProviderRPCLit");
+ QName portName = new QName("http://apache.org/hello_world_rpclit", "SoapPortProviderRPCLit3");
+
+ SOAPServiceRPCLit service = new SOAPServiceRPCLit(wsdl, serviceName);
+ assertNotNull(service);
+
+ doGreeterRPCLit(service, portName, 1);
+ }
+
+ public void testMessageModeWithSAXSourceData() throws Exception {
+ URL wsdl = getClass().getResource("/wsdl/hello_world_rpc_lit.wsdl");
+ assertNotNull(wsdl);
+
+ QName serviceName = new QName("http://apache.org/hello_world_rpclit", "SOAPServiceProviderRPCLit");
+ QName portName = new QName("http://apache.org/hello_world_rpclit", "SoapPortProviderRPCLit4");
+
+ SOAPServiceRPCLit service = new SOAPServiceRPCLit(wsdl, serviceName);
+ assertNotNull(service);
+
+ doGreeterRPCLit(service, portName, 1);
+ }
+
+ public void testMessageModeWithStreamSourceData() throws Exception {
+ URL wsdl = getClass().getResource("/wsdl/hello_world_rpc_lit.wsdl");
+ assertNotNull(wsdl);
+
+ QName serviceName = new QName("http://apache.org/hello_world_rpclit", "SOAPServiceProviderRPCLit");
+ QName portName = new QName("http://apache.org/hello_world_rpclit", "SoapPortProviderRPCLit5");
+
+ SOAPServiceRPCLit service = new SOAPServiceRPCLit(wsdl, serviceName);
+ assertNotNull(service);
+
+ doGreeterRPCLit(service, portName, 1);
+ }
+
+ public void testPayloadModeWithSAXSourceData() throws Exception {
+ URL wsdl = getClass().getResource("/wsdl/hello_world_rpc_lit.wsdl");
+ assertNotNull(wsdl);
+
+ QName serviceName = new QName("http://apache.org/hello_world_rpclit", "SOAPServiceProviderRPCLit");
+ QName portName = new QName("http://apache.org/hello_world_rpclit", "SoapPortProviderRPCLit6");
+
+ SOAPServiceRPCLit service = new SOAPServiceRPCLit(wsdl, serviceName);
+ assertNotNull(service);
+
+ doGreeterRPCLit(service, portName, 1);
+ }
+
+}
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderRPCClientServerTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/Server.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/Server.java?view=auto&rev=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/Server.java (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/Server.java Thu Sep 14 02:58:14 2006
@@ -0,0 +1,69 @@
+/**
+ * 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.provider;
+
+import javax.xml.ws.Endpoint;
+
+import org.apache.cxf.systest.common.TestServerBase;
+
+public class Server extends TestServerBase {
+
+ protected void run() {
+ Object implementor = new HWSoapMessageProvider();
+ String address = "http://localhost:9008/SOAPServiceProviderRPCLit/SoapPortProviderRPCLit1";
+ Endpoint.publish(address, implementor);
+
+ implementor = new HWDOMSourceMessageProvider();
+ address = "http://localhost:9008/SOAPServiceProviderRPCLit/SoapPortProviderRPCLit2";
+ Endpoint.publish(address, implementor);
+
+ implementor = new HWDOMSourcePayloadProvider();
+ address = "http://localhost:9008/SOAPServiceProviderRPCLit/SoapPortProviderRPCLit3";
+ Endpoint.publish(address, implementor);
+
+ implementor = new HWSAXSourceMessageProvider();
+ address = "http://localhost:9008/SOAPServiceProviderRPCLit/SoapPortProviderRPCLit4";
+ Endpoint.publish(address, implementor);
+
+ implementor = new HWStreamSourceMessageProvider();
+ address = "http://localhost:9008/SOAPServiceProviderRPCLit/SoapPortProviderRPCLit5";
+ Endpoint.publish(address, implementor);
+
+ implementor = new HWSAXSourcePayloadProvider();
+ address = "http://localhost:9008/SOAPServiceProviderRPCLit/SoapPortProviderRPCLit6";
+ Endpoint.publish(address, implementor);
+
+ implementor = new HWStreamSourcePayloadProvider();
+ address = "http://localhost:9008/SOAPServiceProviderRPCLit/SoapPortProviderRPCLit7";
+ Endpoint.publish(address, implementor);
+ }
+
+ 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: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/Server.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/Server.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/resources/GreetMeRpcLiteralResp.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/resources/GreetMeRpcLiteralResp.xml?view=diff&rev=443301&r1=443300&r2=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/resources/GreetMeRpcLiteralResp.xml (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/resources/GreetMeRpcLiteralResp.xml Thu Sep 14 02:58:14 2006
@@ -1,10 +1,9 @@
-<?xml version="1.0" encoding="utf-8" ?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
- <ns4:greetMeResponse xmlns:ns4="http://objectweb.org/hello_world_rpclit">
+ <ns4:greetMeResponse xmlns:ns4="http://apache.org/hello_world_rpclit">
<out>TestGreetMeResponse</out>
</ns4:greetMeResponse>
</SOAP-ENV:Body>
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/resources/sayHiRpcLiteralResp.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/resources/sayHiRpcLiteralResp.xml?view=diff&rev=443301&r1=443300&r2=443301
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/resources/sayHiRpcLiteralResp.xml (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/resources/sayHiRpcLiteralResp.xml Thu Sep 14 02:58:14 2006
@@ -3,7 +3,7 @@
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:m1="http://objectweb.org/hello_world_rpclit">
+ xmlns:m1="http://apache.org/hello_world_rpclit">
<SOAP-ENV:Body>
<m1:sayHiResponse>
<out>TestSayHiResponse</out>
Modified: incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java?view=diff&rev=443301&r1=443300&r2=443301
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java (original)
+++ incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java Thu Sep 14 02:58:14 2006
@@ -46,7 +46,7 @@
private int invocationCount;
public String greetMe(String me) {
- LOG.info("Invoking greetMe");
+ LOG.info("Invoking greetMe");
invocationCount++;
return "Hello " + me;
}