You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by jl...@apache.org on 2007/02/01 21:29:52 UTC
svn commit: r502348 - in /incubator/cxf/trunk:
rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/
rt/core/src/main/java/org/apache/cxf/interceptor/
rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/
rt/databinding/jaxb/src/test/java/org/ap...
Author: jliu
Date: Thu Feb 1 12:29:49 2007
New Revision: 502348
URL: http://svn.apache.org/viewvc?view=rev&rev=502348
Log:
CXF-327, CXF-147: mixed style support. Replaced BareInInterceptor and WrappedInInterceptor with DocLiteralInInterceptor. BareInInterceptor and WrappedInInterceptor will be removed later.
Added:
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java (with props)
incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/DocLiteralInInterceptorTest.java (with props)
incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/resources/bareNoParamDocLitBareReq.xml (with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMixedStyleTest.java (with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/Server.java (with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMixedStyle.java (with props)
incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_mixedstyle.wsdl (with props)
Modified:
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/BareInInterceptorTest.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
incubator/cxf/trunk/testutils/pom.xml
Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?view=diff&rev=502348&r1=502347&r2=502348
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java Thu Feb 1 12:29:49 2007
@@ -52,12 +52,11 @@
import org.apache.cxf.common.util.StringUtils;
import org.apache.cxf.interceptor.AttachmentInInterceptor;
import org.apache.cxf.interceptor.AttachmentOutInterceptor;
-import org.apache.cxf.interceptor.BareInInterceptor;
import org.apache.cxf.interceptor.BareOutInterceptor;
+import org.apache.cxf.interceptor.DocLiteralInInterceptor;
import org.apache.cxf.interceptor.StaxInInterceptor;
import org.apache.cxf.interceptor.StaxOutInterceptor;
import org.apache.cxf.interceptor.URIMappingInterceptor;
-import org.apache.cxf.interceptor.WrappedInInterceptor;
import org.apache.cxf.interceptor.WrappedOutInterceptor;
import org.apache.cxf.service.model.BindingInfo;
import org.apache.cxf.service.model.BindingMessageInfo;
@@ -146,10 +145,12 @@
sb.getOutInterceptors().add(new RPCOutInterceptor());
} else if (SoapConstants.BINDING_STYLE_DOC.equalsIgnoreCase(bindingStyle)
&& SoapConstants.PARAMETER_STYLE_BARE.equalsIgnoreCase(parameterStyle)) {
- sb.getInInterceptors().add(new BareInInterceptor());
+ //sb.getInInterceptors().add(new BareInInterceptor());
+ sb.getInInterceptors().add(new DocLiteralInInterceptor());
sb.getOutInterceptors().add(new BareOutInterceptor());
} else {
- sb.getInInterceptors().add(new WrappedInInterceptor());
+ //sb.getInInterceptors().add(new WrappedInInterceptor());
+ sb.getInInterceptors().add(new DocLiteralInInterceptor());
sb.getOutInterceptors().add(new WrappedOutInterceptor());
sb.getOutInterceptors().add(new BareOutInterceptor());
}
Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java?view=diff&rev=502348&r1=502347&r2=502348
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java Thu Feb 1 12:29:49 2007
@@ -204,8 +204,34 @@
}
}
return lastChoice;
- }
+ }
+
+ /**
+ * Returns a BindingOperationInfo if the operation is indentified as
+ * a wrapped method, return null if it is not a wrapped method
+ * (i.e., it is a bare method)
+ *
+ * @param exchange
+ * @param name
+ * @param client
+ * @return
+ */
+ protected BindingOperationInfo getBindingOperationInfoForWrapped(Exchange exchange, QName name,
+ boolean client) {
+ String local = name.getLocalPart();
+ if (client && local.endsWith("Response")) {
+ local = local.substring(0, local.length() - 8);
+ }
+ // TODO: Allow overridden methods.
+ BindingOperationInfo operation = ServiceModelUtil.getOperation(exchange, local);
+ if (operation != null && operation.isUnwrappedCapable()) {
+ return operation;
+ }
+
+ return null;
+ }
+
protected MessageInfo getMessageInfo(Message message, BindingOperationInfo operation, Exchange ex) {
return getMessageInfo(message, operation, isRequestor(message));
}
Added: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java?view=auto&rev=502348
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java (added)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java Thu Feb 1 12:29:49 2007
@@ -0,0 +1,236 @@
+/**
+ * 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.interceptor;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ResourceBundle;
+import java.util.Set;
+import java.util.logging.Logger;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+
+import org.apache.cxf.common.i18n.BundleUtils;
+import org.apache.cxf.databinding.DataReader;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.service.Service;
+import org.apache.cxf.service.model.BindingMessageInfo;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.service.model.MessageInfo;
+//import org.apache.cxf.service.model.MessageInfo;
+import org.apache.cxf.service.model.MessagePartInfo;
+import org.apache.cxf.service.model.OperationInfo;
+import org.apache.cxf.staxutils.DepthXMLStreamReader;
+import org.apache.cxf.staxutils.StaxUtils;
+
+public class DocLiteralInInterceptor extends AbstractInDatabindingInterceptor {
+ private static final Logger LOG = Logger.getLogger(DocLiteralInInterceptor.class.getName());
+ private static final ResourceBundle BUNDLE = BundleUtils.getBundle(DocLiteralInInterceptor.class);
+
+ private static Set<String> filter = new HashSet<String>();
+
+ static {
+ filter.add("void");
+ filter.add("javax.activation.DataHandler");
+ }
+
+ public DocLiteralInInterceptor() {
+ super();
+ setPhase(Phase.UNMARSHAL);
+ addAfter(URIMappingInterceptor.class.getName());
+ }
+
+ public void handleMessage(Message message) {
+ if (isGET(message) && message.getContent(List.class) != null) {
+ LOG.info("BareInInterceptor skipped in HTTP GET method");
+ return;
+ }
+
+ DepthXMLStreamReader xmlReader = getXMLStreamReader(message);
+ DataReader<Message> dr = getMessageDataReader(message);
+ List<Object> parameters = new ArrayList<Object>();
+
+ Exchange exchange = message.getExchange();
+ BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
+
+ boolean client = isRequestor(message);
+
+ //if body is empty and we have BindingOperationInfo, we do not need to match
+ //operation anymore, just return
+ if (!StaxUtils.toNextElement(xmlReader) && bop != null) {
+ // body may be empty for partial response to decoupled request
+ return;
+ }
+
+ //bop might be a unwrpped, wrap it back so that we can get correct info
+ if (bop != null && bop.isUnwrapped()) {
+ bop = bop.getWrappedOperation();
+ }
+
+ if (bop == null) {
+ QName startQName = xmlReader.getName();
+ bop = getBindingOperationInfoForWrapped(exchange, startQName, client);
+ }
+
+ if (bop != null && bop.isUnwrappedCapable()) {
+ // Wrapped case
+ MessageInfo msgInfo = setMessage(message, bop, client);
+
+ // Determine if there is a wrapper class
+ if (msgInfo.getMessageParts().get(0).getTypeClass() != null) {
+ Object wrappedObject = dr.read(msgInfo.getMessageParts().get(0), message);
+ parameters.add(wrappedObject);
+
+ } else {
+ // Unwrap each part individually if we don't have a wrapper
+
+ bop = bop.getUnwrappedOperation();
+
+ msgInfo = setMessage(message, bop, client);
+ List<MessagePartInfo> messageParts = msgInfo.getMessageParts();
+ Iterator<MessagePartInfo> itr = messageParts.iterator();
+
+ // advance just past the wrapped element so we don't get
+ // stuck
+ if (xmlReader.getEventType() == XMLStreamConstants.START_ELEMENT) {
+ StaxUtils.nextEvent(xmlReader);
+ }
+
+ // loop through each child element
+ while (StaxUtils.toNextElement(xmlReader)) {
+ MessagePartInfo part = itr.next();
+ parameters.add(dr.read(part, message));
+ }
+ }
+
+ } else {
+ //Bare style
+ BindingMessageInfo msgInfo = null;
+
+ if (bop != null) { //for xml binding or client side
+ getMessageInfo(message, bop, exchange);
+ if (client) {
+ msgInfo = bop.getOutput();
+ } else {
+ msgInfo = bop.getInput();
+ }
+
+ }
+
+ Collection<OperationInfo> operations = null;
+ operations = new ArrayList<OperationInfo>();
+ Endpoint ep = exchange.get(Endpoint.class);
+ Service service = ep.getService();
+ operations.addAll(service.getServiceInfo().getInterface().getOperations());
+
+ if (!StaxUtils.toNextElement(xmlReader)) {
+ // empty input
+
+ // TO DO : check duplicate operation with no input
+ for (OperationInfo op : operations) {
+ MessageInfo bmsg = op.getInput();
+ if (bmsg.getMessageParts().size() == 0) {
+ BindingOperationInfo boi = ep.getEndpointInfo().getBinding().getOperation(op);
+ exchange.put(BindingOperationInfo.class, boi);
+ exchange.put(OperationInfo.class, op);
+ exchange.setOneWay(op.isOneWay());
+ }
+ }
+ return;
+ }
+
+ int paramNum = 0;
+
+ do {
+ QName elName = xmlReader.getName();
+ Object o = null;
+
+ MessagePartInfo p;
+ if (msgInfo != null && msgInfo.getMessageParts() != null) {
+ assert msgInfo.getMessageParts().size() > paramNum;
+ p = msgInfo.getMessageParts().get(paramNum);
+ } else {
+ p = findMessagePart(exchange, operations, elName, client, paramNum);
+ }
+
+ if (p == null) {
+ throw new Fault(new org.apache.cxf.common.i18n.Message("NO_PART_FOUND", BUNDLE, elName));
+ }
+
+ o = dr.read(p, message);
+
+ if (o != null) {
+ parameters.add(o);
+ }
+ paramNum++;
+ } while (StaxUtils.toNextElement(xmlReader));
+
+ }
+
+ if (parameters.size() > 0) {
+ message.setContent(List.class, parameters);
+ }
+ }
+
+ private MessageInfo setMessage(Message message, BindingOperationInfo operation, boolean requestor) {
+ MessageInfo msgInfo = getMessageInfo(message, operation, requestor);
+ message.put(MessageInfo.class, msgInfo);
+
+ message.getExchange().put(BindingOperationInfo.class, operation);
+ message.getExchange().put(OperationInfo.class, operation.getOperationInfo());
+ message.getExchange().setOneWay(operation.getOperationInfo().isOneWay());
+
+ //Set standard MessageContext properties required by JAX_WS, but not specific to JAX_WS.
+ message.put(Message.WSDL_OPERATION, operation.getName());
+
+ Service service = message.getExchange().get(Service.class);
+ QName serviceQName = service.getServiceInfo().getName();
+ message.put(Message.WSDL_SERVICE, serviceQName);
+
+ QName interfaceQName = service.getServiceInfo().getInterface().getName();
+ message.put(Message.WSDL_INTERFACE, interfaceQName);
+
+ EndpointInfo endpointInfo = message.getExchange().get(Endpoint.class).getEndpointInfo();
+ QName portQName = endpointInfo.getName();
+ message.put(Message.WSDL_PORT, portQName);
+
+ String address = endpointInfo.getAddress();
+ URI wsdlDescription = null;
+ try {
+ wsdlDescription = new URI(address + "?wsdl");
+ } catch (URISyntaxException e) {
+ //do nothing
+ }
+ message.put(Message.WSDL_DESCRIPTION, wsdlDescription);
+
+ return msgInfo;
+ }
+
+}
Propchange: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/BareInInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/BareInInterceptorTest.java?view=diff&rev=502348&r1=502347&r2=502348
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/BareInInterceptorTest.java (original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/BareInInterceptorTest.java Thu Feb 1 12:29:49 2007
@@ -19,19 +19,80 @@
package org.apache.cxf.jaxb;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
import java.util.List;
+import javax.xml.bind.JAXBContext;
+import javax.xml.namespace.QName;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import junit.framework.TestCase;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.binding.Binding;
+import org.apache.cxf.binding.BindingFactory;
+import org.apache.cxf.binding.BindingFactoryManager;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.endpoint.EndpointImpl;
import org.apache.cxf.interceptor.BareInInterceptor;
+import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.ExchangeImpl;
import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageImpl;
+import org.apache.cxf.phase.PhaseInterceptorChain;
+import org.apache.cxf.service.Service;
+import org.apache.cxf.service.model.BindingInfo;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.wsdl11.WSDLServiceFactory;
+import org.apache.hello_world_doc_lit_bare.types.TradePriceData;
import org.apache.hello_world_soap_http.types.GreetMe;
import org.apache.hello_world_soap_http.types.GreetMeResponse;
+import org.easymock.classextension.IMocksControl;
+
-public class BareInInterceptorTest extends TestBase {
+import static org.easymock.EasyMock.expect;
+import static org.easymock.classextension.EasyMock.createNiceControl;
+public class BareInInterceptorTest extends TestCase {
+
+ PhaseInterceptorChain chain;
+ MessageImpl message;
+ Bus bus;
+ ServiceInfo serviceInfo;
+ BindingInfo bindingInfo;
+ Service service;
+ EndpointInfo endpointInfo;
+ EndpointImpl endpoint;
+ BindingOperationInfo operation;
+
+ public void setUp() throws Exception {
+ bus = BusFactory.newInstance().createBus();
+
+ BindingFactoryManager bfm = bus.getExtension(BindingFactoryManager.class);
+
+ IMocksControl control = createNiceControl();
+ BindingFactory bf = control.createMock(BindingFactory.class);
+ Binding binding = control.createMock(Binding.class);
+ expect(bf.createBinding(null)).andStubReturn(binding);
+ expect(binding.getInFaultInterceptors()).andStubReturn(new ArrayList<Interceptor>());
+ expect(binding.getOutFaultInterceptors()).andStubReturn(new ArrayList<Interceptor>());
+
+ bfm.registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/", bf);
+
+ }
+
public void testInterceptorInbound() throws Exception {
+ setUpUsingHelloWorld();
+
BareInInterceptor interceptor = new BareInInterceptor();
message.setContent(XMLStreamReader.class, XMLInputFactory.newInstance()
.createXMLStreamReader(getTestStream(getClass(), "resources/GreetMeDocLiteralReq.xml")));
@@ -51,7 +112,55 @@
assertEquals("TestSOAPInputPMessage", greet.getRequestType());
}
+ public void testInterceptorInbound1() throws Exception {
+ setUpUsingDocLit();
+
+ BareInInterceptor interceptor = new BareInInterceptor();
+ message.setContent(XMLStreamReader.class, XMLInputFactory.newInstance()
+ .createXMLStreamReader(getTestStream(getClass(), "resources/sayHiDocLitBareReq.xml")));
+
+ message.put(Message.INBOUND_MESSAGE, Message.INBOUND_MESSAGE);
+
+ interceptor.handleMessage(message);
+
+ assertNull(message.getContent(Exception.class));
+
+ List<?> parameters = message.getContent(List.class);
+ assertEquals(1, parameters.size());
+
+ Object obj = parameters.get(0);
+ assertTrue(obj instanceof TradePriceData);
+ TradePriceData greet = (TradePriceData)obj;
+ assertTrue(1.0 == greet.getTickerPrice());
+ assertEquals("CXF", greet.getTickerSymbol());
+ }
+
+ public void testInterceptorInboundBareNoParameter() throws Exception {
+ setUpUsingDocLit();
+
+ BareInInterceptor interceptor = new BareInInterceptor();
+ message.setContent(XMLStreamReader.class, XMLInputFactory.newInstance()
+ .createXMLStreamReader(getTestStream(getClass(), "resources/bareNoParamDocLitBareReq.xml")));
+
+ XMLStreamReader reader = (XMLStreamReader)message.getContent(XMLStreamReader.class);
+ // skip to the end element of soap body, so that we can serve an empty request to
+ // interceptor
+ StaxUtils.skipToStartOfElement(reader);
+ StaxUtils.nextEvent(reader);
+
+ message.put(Message.INBOUND_MESSAGE, Message.INBOUND_MESSAGE);
+
+ interceptor.handleMessage(message);
+
+ assertNull(message.getContent(Exception.class));
+
+ List<?> parameters = message.getContent(List.class);
+ assertNull(parameters);
+ }
+
public void testInterceptorOutbound() throws Exception {
+ setUpUsingHelloWorld();
+
BareInInterceptor interceptor = new BareInInterceptor();
message.setContent(XMLStreamReader.class, XMLInputFactory.newInstance()
@@ -68,4 +177,77 @@
GreetMeResponse greet = (GreetMeResponse)obj;
assertEquals("TestSOAPOutputPMessage", greet.getResponseType());
}
+
+ //TODO: remove duplicate code in setUpUsingHelloWorld and setUpUsingDocLit
+ private void setUpUsingHelloWorld() throws Exception {
+ String ns = "http://apache.org/hello_world_soap_http";
+ WSDLServiceFactory factory = new WSDLServiceFactory(bus, getClass()
+ .getResource("/wsdl/hello_world.wsdl"),
+ new QName(ns, "SOAPService"));
+
+ service = factory.create();
+ endpointInfo = service.getServiceInfo().getEndpoint(new QName(ns, "SoapPort"));
+ endpoint = new EndpointImpl(bus, service, endpointInfo);
+ JAXBDataBinding db = new JAXBDataBinding();
+ db.setContext(JAXBContext.newInstance(new Class[] {
+ GreetMe.class,
+ GreetMeResponse.class
+ }));
+ service.setDataBinding(db);
+
+ operation = endpointInfo.getBinding().getOperation(new QName(ns, "greetMe"));
+ operation.getOperationInfo().getInput().getMessagePartByIndex(0).setTypeClass(GreetMe.class);
+ operation.getOperationInfo().getOutput()
+ .getMessagePartByIndex(0).setTypeClass(GreetMeResponse.class);
+
+ message = new MessageImpl();
+ Exchange exchange = new ExchangeImpl();
+ message.setExchange(exchange);
+
+ exchange.put(Service.class, service);
+ exchange.put(Endpoint.class, endpoint);
+ exchange.put(Binding.class, endpoint.getBinding());
+ }
+
+ private void setUpUsingDocLit() throws Exception {
+ String ns = "http://apache.org/hello_world_doc_lit_bare";
+ WSDLServiceFactory factory = new WSDLServiceFactory(bus, getClass()
+ .getResource("/wsdl/doc_lit_bare.wsdl"),
+ new QName(ns, "SOAPService"));
+
+ service = factory.create();
+ endpointInfo = service.getServiceInfo().getEndpoint(new QName(ns, "SoapPort"));
+ endpoint = new EndpointImpl(bus, service, endpointInfo);
+ JAXBDataBinding db = new JAXBDataBinding();
+ db.setContext(JAXBContext.newInstance(new Class[] {
+ TradePriceData.class
+ }));
+ service.setDataBinding(db);
+
+ operation = endpointInfo.getBinding().getOperation(new QName(ns, "SayHi"));
+ operation.getOperationInfo().getInput().getMessagePartByIndex(0).setTypeClass(TradePriceData.class);
+ operation.getOperationInfo().getOutput()
+ .getMessagePartByIndex(0).setTypeClass(TradePriceData.class);
+
+ message = new MessageImpl();
+ Exchange exchange = new ExchangeImpl();
+ message.setExchange(exchange);
+
+ exchange.put(Service.class, service);
+ exchange.put(Endpoint.class, endpoint);
+ exchange.put(Binding.class, endpoint.getBinding());
+ }
+
+ public InputStream getTestStream(Class<?> clz, String file) {
+ return clz.getResourceAsStream(file);
+ }
+
+ public XMLStreamReader getXMLStreamReader(InputStream is) {
+ return StaxUtils.createXMLStreamReader(is);
+ }
+
+ public XMLStreamWriter getXMLStreamWriter(OutputStream os) {
+ return StaxUtils.createXMLStreamWriter(os);
+ }
+
}
Added: incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/DocLiteralInInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/DocLiteralInInterceptorTest.java?view=auto&rev=502348
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/DocLiteralInInterceptorTest.java (added)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/DocLiteralInInterceptorTest.java Thu Feb 1 12:29:49 2007
@@ -0,0 +1,228 @@
+/**
+ * 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.jaxb;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import junit.framework.TestCase;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.binding.Binding;
+import org.apache.cxf.binding.BindingFactory;
+import org.apache.cxf.binding.BindingFactoryManager;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.endpoint.EndpointImpl;
+import org.apache.cxf.interceptor.DocLiteralInInterceptor;
+import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.ExchangeImpl;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageImpl;
+import org.apache.cxf.phase.PhaseInterceptorChain;
+import org.apache.cxf.service.Service;
+import org.apache.cxf.service.model.BindingInfo;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.wsdl11.WSDLServiceFactory;
+import org.apache.hello_world_doc_lit_bare.types.TradePriceData;
+import org.apache.hello_world_soap_http.types.GreetMe;
+import org.apache.hello_world_soap_http.types.GreetMeResponse;
+import org.easymock.classextension.IMocksControl;
+
+import static org.easymock.EasyMock.expect;
+import static org.easymock.classextension.EasyMock.createNiceControl;
+
+public class DocLiteralInInterceptorTest extends TestCase {
+ PhaseInterceptorChain chain;
+ MessageImpl message;
+ Bus bus;
+ ServiceInfo serviceInfo;
+ BindingInfo bindingInfo;
+ Service service;
+ EndpointInfo endpointInfo;
+ EndpointImpl endpoint;
+ BindingOperationInfo operation;
+
+ public void setUp() throws Exception {
+ bus = BusFactory.newInstance().createBus();
+
+ BindingFactoryManager bfm = bus.getExtension(BindingFactoryManager.class);
+
+ IMocksControl control = createNiceControl();
+ BindingFactory bf = control.createMock(BindingFactory.class);
+ Binding binding = control.createMock(Binding.class);
+ expect(bf.createBinding(null)).andStubReturn(binding);
+ expect(binding.getInFaultInterceptors()).andStubReturn(new ArrayList<Interceptor>());
+ expect(binding.getOutFaultInterceptors()).andStubReturn(new ArrayList<Interceptor>());
+
+ bfm.registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/", bf);
+ }
+
+ public void testInterceptorInboundWrapped() throws Exception {
+ setUpUsingHelloWorld();
+
+ //WrappedInInterceptor interceptor = new WrappedInInterceptor();
+ DocLiteralInInterceptor interceptor = new DocLiteralInInterceptor();
+
+ message.setContent(XMLStreamReader.class, XMLInputFactory.newInstance()
+ .createXMLStreamReader(getTestStream(getClass(), "resources/GreetMeDocLiteralReq.xml")));
+ XMLStreamReader reader = (XMLStreamReader)message.getContent(XMLStreamReader.class);
+ // skip the start element of soap body
+ StaxUtils.skipToStartOfElement(reader);
+
+ message.put(Message.INBOUND_MESSAGE, Message.INBOUND_MESSAGE);
+
+ interceptor.handleMessage(message);
+
+ assertNull(message.getContent(Exception.class));
+
+ List<?> parameters = message.getContent(List.class);
+ assertEquals(1, parameters.size());
+
+ Object obj = parameters.get(0);
+ assertTrue(obj instanceof GreetMe);
+ GreetMe greet = (GreetMe)obj;
+ assertEquals("TestSOAPInputPMessage", greet.getRequestType());
+ }
+
+ public void testInterceptorInboundBare() throws Exception {
+ setUpUsingDocLit();
+
+ DocLiteralInInterceptor interceptor = new DocLiteralInInterceptor();
+ message.setContent(XMLStreamReader.class, XMLInputFactory.newInstance()
+ .createXMLStreamReader(getTestStream(getClass(), "resources/sayHiDocLitBareReq.xml")));
+ XMLStreamReader reader = (XMLStreamReader)message.getContent(XMLStreamReader.class);
+ // skip the start element of soap body
+ StaxUtils.skipToStartOfElement(reader);
+
+ message.put(Message.INBOUND_MESSAGE, Message.INBOUND_MESSAGE);
+
+ interceptor.handleMessage(message);
+
+ assertNull(message.getContent(Exception.class));
+
+ List<?> parameters = message.getContent(List.class);
+ assertEquals(1, parameters.size());
+
+ Object obj = parameters.get(0);
+ assertTrue(obj instanceof TradePriceData);
+ TradePriceData greet = (TradePriceData)obj;
+ assertTrue(1.0 == greet.getTickerPrice());
+ assertEquals("CXF", greet.getTickerSymbol());
+ }
+
+ public void testInterceptorInboundBareNoParameter() throws Exception {
+ setUpUsingDocLit();
+
+ DocLiteralInInterceptor interceptor = new DocLiteralInInterceptor();
+ message.setContent(XMLStreamReader.class, XMLInputFactory.newInstance()
+ .createXMLStreamReader(getTestStream(getClass(), "resources/bareNoParamDocLitBareReq.xml")));
+
+ XMLStreamReader reader = (XMLStreamReader)message.getContent(XMLStreamReader.class);
+ // skip the start element of soap body, so that we can serve an empty request to
+ // interceptor
+ StaxUtils.skipToStartOfElement(reader);
+ StaxUtils.nextEvent(reader);
+
+ message.put(Message.INBOUND_MESSAGE, Message.INBOUND_MESSAGE);
+
+ interceptor.handleMessage(message);
+
+ assertNull(message.getContent(Exception.class));
+
+ List<?> parameters = message.getContent(List.class);
+ assertNull(parameters);
+ }
+
+ //TODO: remove duplicate code in setUpUsingHelloWorld and setUpUsingDocLit
+ private void setUpUsingHelloWorld() throws Exception {
+ String ns = "http://apache.org/hello_world_soap_http";
+ WSDLServiceFactory factory = new WSDLServiceFactory(bus, getClass()
+ .getResource("/wsdl/hello_world.wsdl"), new QName(ns, "SOAPService"));
+
+ service = factory.create();
+ endpointInfo = service.getServiceInfo().getEndpoint(new QName(ns, "SoapPort"));
+ endpoint = new EndpointImpl(bus, service, endpointInfo);
+ JAXBDataBinding db = new JAXBDataBinding();
+ db.setContext(JAXBContext.newInstance(new Class[] {GreetMe.class, GreetMeResponse.class}));
+ service.setDataBinding(db);
+
+ operation = endpointInfo.getBinding().getOperation(new QName(ns, "greetMe"));
+ operation.getOperationInfo().getInput().getMessagePartByIndex(0).setTypeClass(GreetMe.class);
+ operation.getOperationInfo().getOutput().getMessagePartByIndex(0).setTypeClass(GreetMeResponse.class);
+
+ message = new MessageImpl();
+ Exchange exchange = new ExchangeImpl();
+ message.setExchange(exchange);
+
+ exchange.put(Service.class, service);
+ exchange.put(Endpoint.class, endpoint);
+ exchange.put(Binding.class, endpoint.getBinding());
+ }
+
+ private void setUpUsingDocLit() throws Exception {
+ String ns = "http://apache.org/hello_world_doc_lit_bare";
+ WSDLServiceFactory factory = new WSDLServiceFactory(bus, getClass()
+ .getResource("/wsdl/doc_lit_bare.wsdl"), new QName(ns, "SOAPService"));
+
+ service = factory.create();
+ endpointInfo = service.getServiceInfo().getEndpoint(new QName(ns, "SoapPort"));
+ endpoint = new EndpointImpl(bus, service, endpointInfo);
+ JAXBDataBinding db = new JAXBDataBinding();
+ db.setContext(JAXBContext.newInstance(new Class[] {TradePriceData.class}));
+ service.setDataBinding(db);
+
+ operation = endpointInfo.getBinding().getOperation(new QName(ns, "SayHi"));
+ operation.getOperationInfo().getInput().getMessagePartByIndex(0).setTypeClass(TradePriceData.class);
+ operation.getOperationInfo().getOutput().getMessagePartByIndex(0).setTypeClass(TradePriceData.class);
+
+ message = new MessageImpl();
+ Exchange exchange = new ExchangeImpl();
+ message.setExchange(exchange);
+
+ exchange.put(Service.class, service);
+ exchange.put(Endpoint.class, endpoint);
+ exchange.put(Binding.class, endpoint.getBinding());
+ }
+
+ public InputStream getTestStream(Class<?> clz, String file) {
+ return clz.getResourceAsStream(file);
+ }
+
+ public XMLStreamReader getXMLStreamReader(InputStream is) {
+ return StaxUtils.createXMLStreamReader(is);
+ }
+
+ public XMLStreamWriter getXMLStreamWriter(OutputStream os) {
+ return StaxUtils.createXMLStreamWriter(os);
+ }
+}
Propchange: incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/DocLiteralInInterceptorTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/DocLiteralInInterceptorTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/resources/bareNoParamDocLitBareReq.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/resources/bareNoParamDocLitBareReq.xml?view=auto&rev=502348
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/resources/bareNoParamDocLitBareReq.xml (added)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/resources/bareNoParamDocLitBareReq.xml Thu Feb 1 12:29:49 2007
@@ -0,0 +1,18 @@
+<!--
+ 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:Body xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"/>
\ No newline at end of file
Propchange: incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/resources/bareNoParamDocLitBareReq.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/resources/bareNoParamDocLitBareReq.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/resources/bareNoParamDocLitBareReq.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMixedStyleTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMixedStyleTest.java?view=auto&rev=502348
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMixedStyleTest.java (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMixedStyleTest.java Thu Feb 1 12:29:49 2007
@@ -0,0 +1,72 @@
+/**
+ * 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.jaxws;
+
+import java.lang.reflect.UndeclaredThrowableException;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.apache.cxf.systest.common.ClientServerSetupBase;
+import org.apache.hello_world_mixedstyle.Greeter;
+import org.apache.hello_world_mixedstyle.SOAPService;
+import org.apache.hello_world_mixedstyle.types.GreetMe1;
+import org.apache.hello_world_mixedstyle.types.GreetMeResponse;
+
+public class ClientServerMixedStyleTest extends TestCase {
+
+ private final QName portName = new QName("http://apache.org/hello_world_mixedstyle", "SoapPort");
+
+
+ public static Test suite() throws Exception {
+ TestSuite suite = new TestSuite(ClientServerMixedStyleTest.class);
+ return new ClientServerSetupBase(suite) {
+ public void startServers() throws Exception {
+ assertTrue("server did not launch correctly", launchServer(ServerMixedStyle.class));
+ }
+ };
+ }
+
+ public void testMixedStyle() throws Exception {
+
+ SOAPService service = new SOAPService();
+ assertNotNull(service);
+
+ try {
+ Greeter greeter = service.getPort(portName, Greeter.class);
+
+ GreetMe1 request = new GreetMe1();
+ request.setRequestType("Bonjour");
+ GreetMeResponse greeting = greeter.greetMe(request);
+ assertNotNull("no response received from service", greeting);
+ assertEquals("Hello Bonjour", greeting.getResponseType());
+
+ String reply = greeter.sayHi();
+ assertNotNull("no response received from service", reply);
+ assertEquals("Bonjour", reply);
+ } catch (UndeclaredThrowableException ex) {
+ throw (Exception)ex.getCause();
+ }
+ }
+
+}
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMixedStyleTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMixedStyleTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java?view=diff&rev=502348&r1=502347&r2=502348
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java Thu Feb 1 12:29:49 2007
@@ -35,7 +35,6 @@
import javax.xml.namespace.QName;
import javax.xml.ws.AsyncHandler;
import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Endpoint;
import javax.xml.ws.Response;
import javax.xml.ws.Service;
import javax.xml.xpath.XPathConstants;
@@ -55,12 +54,9 @@
import org.apache.cxf.message.Message;
import org.apache.cxf.systest.common.ClientServerSetupBase;
import org.apache.cxf.systest.common.ClientServerTestBase;
-import org.apache.cxf.systest.common.TestServerBase;
import org.apache.hello_world_soap_http.BadRecordLitFault;
import org.apache.hello_world_soap_http.DocLitBare;
-import org.apache.hello_world_soap_http.DocLitBareGreeterImpl;
import org.apache.hello_world_soap_http.Greeter;
-import org.apache.hello_world_soap_http.GreeterImpl;
import org.apache.hello_world_soap_http.NoSuchCodeLitFault;
import org.apache.hello_world_soap_http.SOAPService;
import org.apache.hello_world_soap_http.SOAPServiceDocLitBare;
@@ -81,36 +77,6 @@
private final QName portName1 = new QName("http://apache.org/hello_world_soap_http",
"SoapPort2");
- public static class Server extends TestServerBase {
-
-
- protected void run() {
- URL url = getClass().getResource("fault-stack-trace.xml");
- if (url != null) {
- System.setProperty("cxf.config.file.url", url.toString());
- }
- Object implementor = new GreeterImpl();
- String address = "http://localhost:9000/SoapContext/SoapPort";
- Endpoint.publish(address, implementor);
- implementor = new DocLitBareGreeterImpl();
- address = "http://localhost:7600/SoapContext/SoapPort";
- 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!");
- }
- }
- }
-
public static Test suite() throws Exception {
TestSuite suite = new TestSuite(ClientServerTest.class);
return new ClientServerSetupBase(suite) {
Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/Server.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/Server.java?view=auto&rev=502348
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/Server.java (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/Server.java Thu Feb 1 12:29:49 2007
@@ -0,0 +1,56 @@
+/**
+ * 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.jaxws;
+
+import java.net.URL;
+
+import javax.xml.ws.Endpoint;
+
+import org.apache.cxf.systest.common.TestServerBase;
+import org.apache.hello_world_soap_http.DocLitBareGreeterImpl;
+import org.apache.hello_world_soap_http.GreeterImpl;
+
+public class Server extends TestServerBase {
+
+ protected void run() {
+ URL url = getClass().getResource("fault-stack-trace.xml");
+ if (url != null) {
+ System.setProperty("cxf.config.file.url", url.toString());
+ }
+ Object implementor = new GreeterImpl();
+ String address = "http://localhost:9000/SoapContext/SoapPort";
+ Endpoint.publish(address, implementor);
+ implementor = new DocLitBareGreeterImpl();
+ address = "http://localhost:7600/SoapContext/SoapPort";
+ 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/jaxws/Server.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/Server.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMixedStyle.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMixedStyle.java?view=auto&rev=502348
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMixedStyle.java (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMixedStyle.java Thu Feb 1 12:29:49 2007
@@ -0,0 +1,47 @@
+/**
+ * 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.jaxws;
+
+import javax.xml.ws.Endpoint;
+
+import org.apache.cxf.systest.common.TestServerBase;
+import org.apache.hello_world_mixedstyle.GreeterImplMixedStyle;
+
+
+public class ServerMixedStyle extends TestServerBase {
+
+ protected void run() {
+ Object implementor = new GreeterImplMixedStyle();
+ String address = "http://localhost:9027/SoapContext/SoapPort";
+ Endpoint.publish(address, implementor);
+ }
+
+ public static void main(String[] args) {
+ try {
+ ServerMixedStyle s = new ServerMixedStyle();
+ 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/jaxws/ServerMixedStyle.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMixedStyle.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/cxf/trunk/testutils/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/pom.xml?view=diff&rev=502348&r1=502347&r2=502348
==============================================================================
--- incubator/cxf/trunk/testutils/pom.xml (original)
+++ incubator/cxf/trunk/testutils/pom.xml Thu Feb 1 12:29:49 2007
@@ -220,6 +220,9 @@
<wsdl>${basedir}/src/main/resources/wsdl/hello_world_rpc_lit.wsdl</wsdl>
</wsdlOption>
<wsdlOption>
+ <wsdl>${basedir}/src/main/resources/wsdl/hello_world_mixedstyle.wsdl</wsdl>
+ </wsdlOption>
+ <wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/hello_world_doc_lit.wsdl</wsdl>
</wsdlOption>
<wsdlOption>
Added: incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_mixedstyle.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_mixedstyle.wsdl?view=auto&rev=502348
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_mixedstyle.wsdl (added)
+++ incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_mixedstyle.wsdl Thu Feb 1 12:29:49 2007
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<wsdl:definitions name="HelloWorld" targetNamespace="http://apache.org/hello_world_mixedstyle"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://apache.org/hello_world_mixedstyle"
+ xmlns:x1="http://apache.org/hello_world_mixedstyle/types"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <wsdl:types>
+ <schema targetNamespace="http://apache.org/hello_world_mixedstyle/types"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://apache.org/hello_world_mixedstyle/types"
+ elementFormDefault="qualified">
+ <simpleType name="MyStringType">
+ <restriction base="string">
+ <maxLength value="30" />
+ </restriction>
+ </simpleType>
+
+ <element name="sayHi">
+ <complexType/>
+ </element>
+ <element name="sayHiResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMe1">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="tns:MyStringType"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeOneWay">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="pingMe">
+ <complexType/>
+ </element>
+ <element name="pingMeResponse">
+ <complexType/>
+ </element>
+ <element name="faultDetail">
+ <complexType>
+ <sequence>
+ <element name="minor" type="short"/>
+ <element name="major" type="short"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </wsdl:types>
+ <wsdl:message name="sayHiRequest">
+ <wsdl:part element="x1:sayHi" name="in"/>
+ </wsdl:message>
+ <wsdl:message name="sayHiResponse">
+ <wsdl:part element="x1:sayHiResponse" name="out"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeRequest">
+ <wsdl:part element="x1:greetMe1" name="in"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeResponse">
+ <wsdl:part element="x1:greetMeResponse" name="out"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeOneWayRequest">
+ <wsdl:part element="x1:greetMeOneWay" name="in"/>
+ </wsdl:message>
+ <wsdl:message name="pingMeRequest">
+ <wsdl:part name="in" element="x1:pingMe"/>
+ </wsdl:message>
+ <wsdl:message name="pingMeResponse">
+ <wsdl:part name="out" element="x1:pingMeResponse"/>
+ </wsdl:message>
+ <wsdl:message name="pingMeFault">
+ <wsdl:part name="faultDetail" element="x1:faultDetail"/>
+ </wsdl:message>
+
+ <wsdl:portType name="Greeter">
+ <wsdl:operation name="sayHi">
+ <wsdl:input message="tns:sayHiRequest" name="sayHiRequest"/>
+ <wsdl:output message="tns:sayHiResponse" name="sayHiResponse"/>
+ </wsdl:operation>
+
+ <wsdl:operation name="greetMe">
+ <wsdl:input message="tns:greetMeRequest" name="greetMeRequest"/>
+ <wsdl:output message="tns:greetMeResponse" name="greetMeResponse"/>
+ </wsdl:operation>
+
+ <wsdl:operation name="greetMeOneWay">
+ <wsdl:input message="tns:greetMeOneWayRequest" name="greetMeOneWayRequest"/>
+ </wsdl:operation>
+
+ <wsdl:operation name="pingMe">
+ <wsdl:input name="pingMeRequest" message="tns:pingMeRequest"/>
+ <wsdl:output name="pingMeResponse" message="tns:pingMeResponse"/>
+ <wsdl:fault name="pingMeFault" message="tns:pingMeFault"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <wsdl:operation name="sayHi">
+ <soap:operation soapAction="" style="document"/>
+ <wsdl:input name="sayHiRequest">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="sayHiResponse">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="greetMe">
+ <soap:operation soapAction="" style="document"/>
+ <wsdl:input name="greetMeRequest">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="greetMeResponse">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="greetMeOneWay">
+ <soap:operation soapAction="" style="document"/>
+ <wsdl:input name="greetMeOneWayRequest">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ </wsdl:operation>
+
+ <wsdl:operation name="pingMe">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="pingMeFault">
+ <soap:fault name="pingMeFault" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+
+ </wsdl:binding>
+ <wsdl:service name="SOAPService">
+ <wsdl:port binding="tns:Greeter_SOAPBinding" name="SoapPort">
+ <soap:address location="http://localhost:9027/SoapContext/SoapPort"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
+
Propchange: incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_mixedstyle.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_mixedstyle.wsdl
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_mixedstyle.wsdl
------------------------------------------------------------------------------
svn:mime-type = text/xml