You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ff...@apache.org on 2007/08/29 10:16:05 UTC
svn commit: r570691 [1/2] - in /incubator/servicemix/trunk/deployables:
bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/
bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/
bindingco...
Author: ffang
Date: Wed Aug 29 01:16:04 2007
New Revision: 570691
URL: http://svn.apache.org/viewvc?rev=570691&view=rev
Log:
[SM-1019] support ws-addressing in cxf binding component
Added:
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiAddressingInterceptor.java (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/AnotherGreeterImpl.java (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/CxfBcAddressingTest.java (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/GreeterImpl.java (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/HeaderVerifier.java (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/MAPVerifier.java (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/VerificationCache.java (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/addressing-hpux.xml (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/addressing.xml (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/hello_world.wsdl (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/wsa_interceptors.xml (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/xbean.xml (with props)
Modified:
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiConstants.java
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/policy/CxfBCPolicyTest.java
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/rm/CxfBcRMSequenceTest.java
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
Modified: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java?rev=570691&r1=570690&r2=570691&view=diff
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java (original)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java Wed Aug 29 01:16:04 2007
@@ -316,7 +316,7 @@
}
- protected class JbiInvokerInterceptor extends
+ public class JbiInvokerInterceptor extends
AbstractPhaseInterceptor<Message> {
public JbiInvokerInterceptor() {
@@ -401,7 +401,7 @@
process(exchange);
} else {
context.getDeliveryChannel().send(exchange);
-
+
}
} catch (Exception e) {
throw new Fault(e);
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiAddressingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiAddressingInterceptor.java?rev=570691&view=auto
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiAddressingInterceptor.java (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiAddressingInterceptor.java Wed Aug 29 01:16:04 2007
@@ -0,0 +1,77 @@
+/*
+ * 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.servicemix.cxfbc.interceptors;
+
+
+import javax.jbi.messaging.MessageExchange;
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.ws.addressing.AddressingPropertiesImpl;
+import org.apache.cxf.ws.addressing.AttributedURIType;
+import org.apache.cxf.ws.addressing.ContextUtils;
+import org.apache.servicemix.cxfbc.CxfBcConsumer;
+import org.apache.servicemix.jbi.resolver.URIResolver;
+
+
+public class JbiAddressingInterceptor extends AbstractPhaseInterceptor<Message> {
+
+
+ //private static final Logger LOG = Logger.getLogger(JbiAddressingInInterceptor.class.getName());
+
+ public JbiAddressingInterceptor() {
+ super(Phase.INVOKE);
+ getBefore().add(CxfBcConsumer.JbiInvokerInterceptor.class.getName());
+ }
+
+ public void handleMessage(Message message) throws Fault {
+
+ final AddressingPropertiesImpl maps = ContextUtils.retrieveMAPs(message, false, false);
+ if (null == maps) {
+ return;
+ }
+ AttributedURIType action = maps.getAction();
+ if (action != null) {
+ String value = action.getValue();
+
+ if (value != null && value.endsWith(JbiConstants.JBI_SUFFIX)) {
+ value = value.substring(0, value.indexOf(JbiConstants.JBI_SUFFIX) - 1);
+ String[] parts = URIResolver.split3(value);
+ MessageExchange exchange = message.getContent(MessageExchange.class);
+ exchange.setOperation(new QName(parts[0], parts[2]));
+ exchange.setInterfaceName(new QName(parts[0], parts[1]));
+ }
+ }
+
+ AttributedURIType to = maps.getTo();
+ if (to != null) {
+ String toAddress = to.getValue();
+ if (toAddress != null && toAddress.endsWith(JbiConstants.JBI_SUFFIX)) {
+ toAddress = toAddress.substring(0, toAddress.indexOf(JbiConstants.JBI_SUFFIX) - 1);
+ String[] parts = URIResolver.split3(toAddress);
+ MessageExchange exchange = message.getContent(MessageExchange.class);
+ exchange.setService(new QName(parts[0], parts[1]));
+ }
+ }
+
+ }
+
+
+}
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiAddressingInterceptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiAddressingInterceptor.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiConstants.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiConstants.java?rev=570691&r1=570690&r2=570691&view=diff
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiConstants.java (original)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiConstants.java Wed Aug 29 01:16:04 2007
@@ -56,6 +56,8 @@
public static final String WSDL11_WRAPPER_PREFIX = "jbi";
public static final String WSDL11_WRAPPER_MESSAGE_LOCALNAME = "message";
+
+ public static final String JBI_SUFFIX = "JBIADDRESS";
public static final QName WSDL11_WRAPPER_MESSAGE = new QName(
WSDL11_WRAPPER_NAMESPACE, WSDL11_WRAPPER_MESSAGE_LOCALNAME,
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/AnotherGreeterImpl.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/AnotherGreeterImpl.java?rev=570691&view=auto
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/AnotherGreeterImpl.java (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/AnotherGreeterImpl.java Wed Aug 29 01:16:04 2007
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.cxfbc.ws.addressing;
+
+@javax.jws.WebService(
+ serviceName = "SOAPServiceWSSecurity",
+ portName = "TimestampSignEncrypt",
+ endpointInterface = "org.apache.hello_world_soap_http.Greeter",
+ targetNamespace = "http://apache.org/hello_world_soap_http",
+ wsdlLocation = "org/apache/servicemix/cxfbc/ws/security/hello_world.wsdl"
+ )
+
+public class AnotherGreeterImpl extends GreeterImpl {
+ public String greetMe(String me) {
+ return "Another Greeter Hello " + me;
+ }
+}
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/AnotherGreeterImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/AnotherGreeterImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/CxfBcAddressingTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/CxfBcAddressingTest.java?rev=570691&view=auto
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/CxfBcAddressingTest.java (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/CxfBcAddressingTest.java Wed Aug 29 01:16:04 2007
@@ -0,0 +1,412 @@
+/*
+ * 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.servicemix.cxfbc.ws.addressing;
+
+import java.lang.reflect.UndeclaredThrowableException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Logger;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.jaxws.ServiceImpl;
+import org.apache.cxf.jaxws.support.ServiceDelegateAccessor;
+import org.apache.cxf.ws.addressing.AddressingBuilder;
+import org.apache.cxf.ws.addressing.AddressingProperties;
+import org.apache.cxf.ws.addressing.AttributedURIType;
+import org.apache.cxf.ws.addressing.ContextUtils;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
+import org.apache.cxf.ws.addressing.Names;
+import org.apache.cxf.ws.addressing.ReferenceParametersType;
+import org.apache.cxf.ws.addressing.VersionTransformer;
+import org.apache.cxf.wsdl.EndpointReferenceUtils;
+import org.apache.hello_world_soap_http.BadRecordLitFault;
+import org.apache.hello_world_soap_http.Greeter;
+import org.apache.hello_world_soap_http.NoSuchCodeLitFault;
+import org.apache.hello_world_soap_http.SOAPService;
+import org.apache.servicemix.cxfbc.interceptors.JbiConstants;
+import org.apache.servicemix.jbi.container.SpringJBIContainer;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.apache.servicemix.tck.SpringTestSupport;
+import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import static org.apache.cxf.ws.addressing.JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES;
+
+public class CxfBcAddressingTest extends SpringTestSupport implements VerificationCache {
+
+ static final String INBOUND_KEY = "inbound";
+ static final String OUTBOUND_KEY = "outbound";
+ static final String ADDRESS = "http://localhost:9008/SoapContext/SoapPort";
+ static final QName CUSTOMER_NAME =
+ new QName("http://example.org/customer", "CustomerKey", "customer");
+ static final String CUSTOMER_KEY = "Key#123456789";
+ private static final Logger LOG = Logger
+ .getLogger(CxfBcAddressingTest.class.getName());
+
+ private static Bus staticBus;
+
+
+ private static MAPVerifier mapVerifier;
+ private static HeaderVerifier headerVerifier;
+
+ private static final QName SERVICE_NAME =
+ new QName("http://apache.org/hello_world_soap_http", "SOAPServiceAddressing");
+
+ private static final java.net.URL WSDL_LOC;
+ private static final String CONFIG;
+
+
+ private static Map<Object, Map<String, String>> messageIDs =
+ new HashMap<Object, Map<String, String>>();
+ protected Greeter greeter;
+ private String verified;
+
+
+
+
+ static {
+ CONFIG = "org/apache/servicemix/cxfbc/ws/addressing/addressing"
+ + (("HP-UX".equals(System.getProperty("os.name"))
+ || "Windows XP".equals(System.getProperty("os.name"))) ? "-hpux" : "")
+ + ".xml";
+
+ java.net.URL tmp = null;
+ try {
+ tmp = CxfBcAddressingTest.class.getClassLoader().getResource(
+ "org/apache/servicemix/cxfbc/ws/addressing/hello_world.wsdl"
+ );
+ } catch (final Exception e) {
+ e.printStackTrace();
+ }
+ WSDL_LOC = tmp;
+ }
+
+ public void setUp() throws Exception {
+ //super.setUp();
+ if (context != null) {
+ context.refresh();
+ }
+ transformer = new SourceTransformer();
+ context = createBeanFactory();
+
+ jbi = (SpringJBIContainer) context.getBean("jbi");
+ assertNotNull("JBI Container not found in spring!", jbi);
+ LOG.info("setUp is invoked");
+ if (staticBus == null) {
+ SpringBusFactory bf = new SpringBusFactory();
+ staticBus = bf.createBus(getConfigFileName());
+ }
+ BusFactory.setDefaultBus(staticBus);
+ messageIDs.clear();
+ mapVerifier = new MAPVerifier();
+ headerVerifier = new HeaderVerifier();
+ Interceptor[] interceptors = {mapVerifier, headerVerifier };
+ addInterceptors(staticBus.getInInterceptors(), interceptors);
+ addInterceptors(staticBus.getOutInterceptors(), interceptors);
+ addInterceptors(staticBus.getOutFaultInterceptors(), interceptors);
+ addInterceptors(staticBus.getInFaultInterceptors(), interceptors);
+
+ EndpointReferenceType target =
+ EndpointReferenceUtils.getEndpointReference(ADDRESS);
+ ReferenceParametersType params =
+ ContextUtils.WSA_OBJECT_FACTORY.createReferenceParametersType();
+ JAXBElement<String> param =
+ new JAXBElement<String>(CUSTOMER_NAME, String.class, CUSTOMER_KEY);
+ params.getAny().add(param);
+ target.setReferenceParameters(params);
+
+ ServiceImpl serviceImpl =
+ ServiceDelegateAccessor.get(new SOAPService(WSDL_LOC, SERVICE_NAME));
+ greeter = serviceImpl.getPort(target, Greeter.class);
+
+ mapVerifier.verificationCache = this;
+ headerVerifier.verificationCache = this;
+ }
+
+ public void tearDown() throws Exception {
+ Interceptor[] interceptors = {mapVerifier, headerVerifier };
+ removeInterceptors(staticBus.getInInterceptors(), interceptors);
+ removeInterceptors(staticBus.getOutInterceptors(), interceptors);
+ removeInterceptors(staticBus.getOutFaultInterceptors(), interceptors);
+ removeInterceptors(staticBus.getInFaultInterceptors(), interceptors);
+ mapVerifier = null;
+ headerVerifier = null;
+ verified = null;
+ messageIDs.clear();
+ if (context != null) {
+ context.destroy();
+ context = null;
+ }
+ if (jbi != null) {
+ jbi.shutDown();
+ jbi.destroy();
+ jbi = null;
+ }
+ BusFactory.setDefaultBus(null);
+ super.tearDown();
+ }
+
+
+ public void testImplicitMAPs() throws Exception {
+ try {
+ String greeting = greeter.greetMe("implicit1");
+ assertEquals("unexpected response received from service",
+ "Hello implicit1",
+ greeting);
+ checkVerification();
+ greeting = greeter.greetMe("implicit2");
+ assertEquals("unexpected response received from service",
+ "Hello implicit2",
+ greeting);
+ checkVerification();
+ } catch (UndeclaredThrowableException ex) {
+ throw (Exception)ex.getCause();
+ }
+ }
+
+ public void testExplicitMAPsAddressTo() throws Exception {
+ AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+ AddressingProperties maps = builder.newAddressingProperties();
+ AttributedURIType to = new AttributedURIType();
+ String delimiter = "/";
+ String ns = "http://apache.org/hello_world_soap_http";
+ String serviceName = "SOAPServiceWSSecurity";
+ String endpointName = "TimestampSignEncrypt";
+
+ to.setValue(ns + delimiter + serviceName + delimiter + endpointName + delimiter + JbiConstants.JBI_SUFFIX);
+ EndpointReferenceType toRef = new EndpointReferenceType();
+ toRef.setAddress(to);
+ maps.setTo(toRef);
+ //associate MAPs with request context
+ Map<String, Object> requestContext =
+ ((BindingProvider)greeter).getRequestContext();
+ requestContext.put(CLIENT_ADDRESSING_PROPERTIES, maps);
+ String greeting = greeter.greetMe("explicitly set to invoke antoher endpoint in another service");
+ //dispatch operation to to greetMeSomeTime method
+ assertEquals(greeting,
+ "Another Greeter Hello explicitly set to invoke antoher endpoint in another service");
+ //disassociate MAPs from request context
+ requestContext.remove(CLIENT_ADDRESSING_PROPERTIES);
+ }
+
+ public void testExplicitMAPs() throws Exception {
+ try {
+ AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+ AddressingProperties maps = builder.newAddressingProperties();
+ AttributedURIType action = new AttributedURIType();
+ String delimiter = "/";
+ String ns = "http://apache.org/hello_world_soap_http";
+ String interfaceName = "Greeter";
+ String operationName = "greetMeSometime";
+ action.setValue(ns + delimiter + interfaceName + delimiter + operationName + delimiter + JbiConstants.JBI_SUFFIX);
+ maps.setAction(action);
+ //associate MAPs with request context
+ Map<String, Object> requestContext =
+ ((BindingProvider)greeter).getRequestContext();
+ requestContext.put(CLIENT_ADDRESSING_PROPERTIES, maps);
+ String greeting = greeter.greetMe("explicitly set ot invoke greetMeSomeTime");
+ //dispatch operation to to greetMeSomeTime method
+ assertEquals(greeting, "greetMeSomeTime:How are you explicitly set ot invoke greetMeSomeTime");
+ checkVerification();
+ operationName = "sayHi";
+ action.setValue(ns + delimiter + interfaceName + delimiter + operationName
+ + delimiter + JbiConstants.JBI_SUFFIX);
+ greeting = greeter.greetMe("explicitly set to invoke sayHi");
+ assertEquals(greeting, "sayHi:Bonjour");
+ checkVerification();
+ //disassociate MAPs from request context
+ requestContext.remove(CLIENT_ADDRESSING_PROPERTIES);
+ } catch (UndeclaredThrowableException ex) {
+ throw (Exception)ex.getCause();
+ }
+ }
+
+ public void testOneway() throws Exception {
+ try {
+ greeter.greetMeOneWay("implicit_oneway1");
+ checkVerification();
+ } catch (UndeclaredThrowableException ex) {
+ throw (Exception)ex.getCause();
+ }
+ }
+
+ public void testApplicationFault() throws Exception {
+ try {
+ greeter.testDocLitFault("BadRecordLitFault");
+ fail("expected fault from service");
+ } catch (BadRecordLitFault brlf) {
+ checkVerification();
+ } catch (UndeclaredThrowableException ex) {
+ throw (Exception)ex.getCause();
+ }
+ String greeting = greeter.greetMe("intra-fault");
+ assertEquals("unexpected response received from service",
+ "Hello intra-fault",
+ greeting);
+ try {
+ greeter.testDocLitFault("NoSuchCodeLitFault");
+ fail("expected NoSuchCodeLitFault");
+ } catch (NoSuchCodeLitFault nsclf) {
+ checkVerification();
+ } catch (UndeclaredThrowableException ex) {
+ throw (Exception)ex.getCause();
+ }
+ }
+
+
+ public void testVersioning() throws Exception {
+ try {
+ // expect two MAPs instances versioned with 200408, i.e. for both
+ // the partial and full responses
+ mapVerifier.expectedExposedAs.add(VersionTransformer.Names200408.WSA_NAMESPACE_NAME);
+ mapVerifier.expectedExposedAs.add(VersionTransformer.Names200408.WSA_NAMESPACE_NAME);
+ String greeting = greeter.greetMe("versioning1");
+ assertEquals("unexpected response received from service",
+ "Hello versioning1",
+ greeting);
+ checkVerification();
+ greeting = greeter.greetMe("versioning2");
+ assertEquals("unexpected response received from service",
+ "Hello versioning2",
+ greeting);
+ checkVerification();
+ } catch (UndeclaredThrowableException ex) {
+ throw (Exception)ex.getCause();
+ }
+ }
+
+
+ @Override
+ protected AbstractXmlApplicationContext createBeanFactory() {
+ // load cxf se and bc from spring config file
+ return new ClassPathXmlApplicationContext(
+ "org/apache/servicemix/cxfbc/ws/addressing/xbean.xml");
+ }
+
+ protected static String verifyMAPs(AddressingProperties maps,
+ Object checkPoint) {
+ if (maps == null) {
+ return "expected MAPs";
+ }
+ String id = maps.getMessageID().getValue();
+ if (id == null) {
+ return "expected MessageID MAP";
+ }
+ if (!id.startsWith("urn:uuid")) {
+ return "bad URN format in MessageID MAP: " + id;
+ }
+ // ensure MessageID is unique for this check point
+ Map<String, String> checkPointMessageIDs = messageIDs.get(checkPoint);
+ if (checkPointMessageIDs != null) {
+ if (checkPointMessageIDs.containsKey(id)) {
+ // return "MessageID MAP duplicate: " + id;
+ return null;
+ }
+ } else {
+ checkPointMessageIDs = new HashMap<String, String>();
+ messageIDs.put(checkPoint, checkPointMessageIDs);
+ }
+ checkPointMessageIDs.put(id, id);
+ // To
+ if (maps.getTo() == null) {
+ return "expected To MAP";
+ }
+ return null;
+ }
+
+ public String getConfigFileName() {
+ return CONFIG;
+ }
+
+ public static void shutdownBus() throws Exception {
+ staticBus.shutdown(true);
+ }
+
+ private void addInterceptors(List<Interceptor> chain,
+ Interceptor[] interceptors) {
+ for (int i = 0; i < interceptors.length; i++) {
+ chain.add(interceptors[i]);
+ }
+ }
+ private void removeInterceptors(List<Interceptor> chain,
+ Interceptor[] interceptors) {
+ for (int i = 0; i < interceptors.length; i++) {
+ chain.add(interceptors[i]);
+ }
+ }
+
+ public void put(String verification) {
+ if (verification != null) {
+ verified = verified == null
+ ? verification
+ : verified + "; " + verification;
+ }
+ }
+
+ /**
+ * Verify presence of expected MAP headers.
+ *
+ * @param wsaHeaders a list of the wsa:* headers present in the SOAP
+ * message
+ * @param parial true if partial response
+ * @return null if all expected headers present, otherwise an error string.
+ */
+ protected static String verifyHeaders(List<String> wsaHeaders,
+ boolean partial,
+ boolean requestLeg) {
+
+ String ret = null;
+ if (!wsaHeaders.contains(Names.WSA_MESSAGEID_NAME)) {
+ ret = "expected MessageID header";
+ }
+ if (!wsaHeaders.contains(Names.WSA_TO_NAME)) {
+ ret = "expected To header";
+ }
+
+ if (!(wsaHeaders.contains(Names.WSA_REPLYTO_NAME)
+ || wsaHeaders.contains(Names.WSA_RELATESTO_NAME))) {
+ ret = "expected ReplyTo or RelatesTo header";
+ }
+ if (partial) {
+ if (!wsaHeaders.contains(Names.WSA_FROM_NAME)) {
+ //ret = "expected From header";
+ }
+ } else {
+ // REVISIT Action missing from full response
+ //if (!wsaHeaders.contains(Names.WSA_ACTION_NAME)) {
+ // ret = "expected Action header";
+ //}
+ }
+ if (requestLeg && !(wsaHeaders.contains(CUSTOMER_NAME.getLocalPart()))) {
+ ret = "expected CustomerKey header";
+ }
+ return ret;
+ }
+
+ private void checkVerification() {
+ assertNull("MAP/Header verification failed: " + verified, verified);
+ }
+
+
+}
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/CxfBcAddressingTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/CxfBcAddressingTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/GreeterImpl.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/GreeterImpl.java?rev=570691&view=auto
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/GreeterImpl.java (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/GreeterImpl.java Wed Aug 29 01:16:04 2007
@@ -0,0 +1,221 @@
+/*
+ * 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.servicemix.cxfbc.ws.addressing;
+
+import java.util.concurrent.Future;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.annotation.Resource;
+import javax.jws.WebService;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+import javax.xml.ws.WebServiceContext;
+
+import org.apache.cxf.ws.addressing.AddressingProperties;
+import org.apache.hello_world_soap_http.BadRecordLitFault;
+import org.apache.hello_world_soap_http.Greeter;
+import org.apache.hello_world_soap_http.NoSuchCodeLitFault;
+import org.apache.hello_world_soap_http.types.BareDocumentResponse;
+import org.apache.hello_world_soap_http.types.ErrorCode;
+import org.apache.hello_world_soap_http.types.GreetMeLaterResponse;
+import org.apache.hello_world_soap_http.types.GreetMeResponse;
+import org.apache.hello_world_soap_http.types.GreetMeSometimeResponse;
+import org.apache.hello_world_soap_http.types.NoSuchCodeLit;
+import org.apache.hello_world_soap_http.types.SayHiResponse;
+import org.apache.hello_world_soap_http.types.TestDocLitFaultResponse;
+import org.apache.hello_world_soap_http.types.TestNillableResponse;
+
+import static org.apache.cxf.ws.addressing.JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND;
+
+
+@WebService(serviceName = "SOAPServiceAddressing",
+ portName = "SoapPort",
+ endpointInterface = "org.apache.hello_world_soap_http.Greeter",
+ targetNamespace = "http://apache.org/hello_world_soap_http",
+ wsdlLocation = "org/apache/servicemix/cxfbc/ws/addressing/hello_world.wsdl")
+public class GreeterImpl implements Greeter, VerificationCache {
+
+ private String verified;
+ /**
+ * Injectable context.
+ */
+ @Resource
+ private WebServiceContext context;
+
+
+ public String greetMe(String me) {
+ System.out.println("\n\n*** GreetMe called with: " + me + "***\n\n");
+ verifyMAPs();
+ return "Hello " + me;
+ }
+
+ public String greetMeLater(long delay) {
+ System.out.println("\n\n*** GreetMeLater called with: " + delay + "***\n\n");
+ if (delay > 0) {
+ try {
+ Thread.sleep(delay);
+ } catch (InterruptedException ex) {
+ // ignore
+ }
+ }
+ verifyMAPs();
+ return "Hello, finally";
+ }
+
+ public void greetMeOneWay(String requestType) {
+ System.out.println("\n\n*** GreetMeOneWay called with: " + requestType + "***\n\n");
+ verifyMAPs();
+ }
+
+ public String sayHi() {
+ verifyMAPs();
+ return "sayHi:Bonjour";
+ }
+
+ public void testDocLitFault(String faultType) throws BadRecordLitFault, NoSuchCodeLitFault {
+ verifyMAPs();
+ if (faultType.equals(BadRecordLitFault.class.getSimpleName())) {
+ throw new BadRecordLitFault("TestBadRecordLit", "BadRecordLitFault");
+ }
+ if (faultType.equals(NoSuchCodeLitFault.class.getSimpleName())) {
+ ErrorCode ec = new ErrorCode();
+ ec.setMajor((short)1);
+ ec.setMinor((short)1);
+ NoSuchCodeLit nscl = new NoSuchCodeLit();
+ nscl.setCode(ec);
+ throw new NoSuchCodeLitFault("TestNoSuchCodeLit", nscl);
+ }
+ }
+
+ public BareDocumentResponse testDocLitBare(String in) {
+ BareDocumentResponse res = new BareDocumentResponse();
+ res.setCompany("Celtix");
+ res.setId(1);
+ return res;
+ }
+
+ private void verifyMAPs() {
+ if (context.getMessageContext() != null) {
+ String property = SERVER_ADDRESSING_PROPERTIES_INBOUND;
+ AddressingProperties maps = (AddressingProperties)
+ context.getMessageContext().get(property);
+ put(CxfBcAddressingTest.verifyMAPs(maps, this));
+ }
+ }
+
+ public String greetMeSometime(String me) {
+ return "greetMeSomeTime:How are you " + me;
+ }
+
+ public Future<?> greetMeSometimeAsync(String requestType,
+ AsyncHandler<GreetMeSometimeResponse> asyncHandler) {
+ return null;
+ /*not called */
+ }
+
+ public Response<GreetMeSometimeResponse> greetMeSometimeAsync(String requestType) {
+ return null;
+ /*not called */
+ }
+
+ public Response<TestDocLitFaultResponse> testDocLitFaultAsync(String faultType) {
+ return null;
+ /*not called */
+ }
+
+ public Future<?> testDocLitFaultAsync(String faultType, AsyncHandler ah) {
+ return null;
+ /*not called */
+ }
+
+ public Future<?> testDocLitBareAsync(String bare, AsyncHandler ah) {
+ return null;
+ /* not called */
+ }
+
+ public Response<BareDocumentResponse> testDocLitBareAsync(String bare) {
+ return null;
+ /* not called */
+ }
+
+ public Future<?> greetMeAsync(String requestType, AsyncHandler<GreetMeResponse> asyncHandler) {
+ return null;
+ /*not called */
+ }
+
+ public Response<GreetMeResponse> greetMeAsync(String requestType) {
+ return null;
+ /*not called */
+ }
+
+ public Future<?> greetMeLaterAsync(long requestType, AsyncHandler<GreetMeLaterResponse> asyncHandler) {
+ return null;
+ /*not called */
+ }
+
+ public Response<GreetMeLaterResponse> greetMeLaterAsync(long requestType) {
+ return null;
+ /*not called */
+ }
+
+ public Future<?> sayHiAsync(AsyncHandler<SayHiResponse> asyncHandler) {
+ return null;
+ /*not called */
+ }
+
+ public Response<SayHiResponse> sayHiAsync() {
+ return null;
+ /*not called */
+ }
+
+ public String testNillable(String nillElem, int intElem) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Response<TestNillableResponse> testNillableAsync(String nillElem,
+ int intElem) {
+ return null;
+ }
+
+ public Future<?> testNillableAsync(String nillElem,
+ int intElem,
+ AsyncHandler<TestNillableResponse> asyncHandler) {
+ return null;
+ }
+
+ protected boolean verify(Logger log) {
+ if (verified != null) {
+ System.out.println("MAP/Header verification failed: " + verified);
+ log.log(Level.WARNING,
+ "MAP/Header verification failed: {0}",
+ verified);
+ }
+ return verified == null;
+ }
+
+
+ public void put(String verification) {
+ if (verification != null) {
+ verified = verified == null
+ ? verification
+ : verified + "; " + verification;
+ }
+ }
+}
+
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/GreeterImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/GreeterImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/HeaderVerifier.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/HeaderVerifier.java?rev=570691&view=auto
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/HeaderVerifier.java (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/HeaderVerifier.java Wed Aug 29 01:16:04 2007
@@ -0,0 +1,223 @@
+/*
+ * 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.servicemix.cxfbc.ws.addressing;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import org.apache.cxf.binding.soap.SoapMessage;
+import org.apache.cxf.binding.soap.SoapVersion;
+import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
+import org.apache.cxf.headers.Header;
+import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.ws.addressing.AddressingProperties;
+import org.apache.cxf.ws.addressing.AttributedURIType;
+import org.apache.cxf.ws.addressing.ContextUtils;
+import org.apache.cxf.ws.addressing.Names;
+import org.apache.cxf.ws.addressing.soap.VersionTransformer;
+import org.apache.cxf.ws.addressing.v200408.AttributedURI;
+
+import static org.apache.cxf.ws.addressing.JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND;
+import static org.apache.cxf.ws.addressing.JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND;
+
+
+/**
+ * Verifies presence of expected SOAP headers.
+ */
+public class HeaderVerifier extends AbstractSoapInterceptor {
+ VerificationCache verificationCache = new GreeterImpl();
+ String currentNamespaceURI;
+
+ public HeaderVerifier() {
+ super(Phase.POST_PROTOCOL);
+ }
+
+ public Set<QName> getUnderstoodHeaders() {
+ return Names.HEADERS;
+ }
+
+ public void handleMessage(SoapMessage message) {
+ mediate(message);
+ }
+
+ public void handleFault(SoapMessage message) {
+ mediate(message);
+ }
+
+ private void mediate(SoapMessage message) {
+ boolean outgoingPartialResponse = isOutgoingPartialResponse(message);
+ if (outgoingPartialResponse) {
+ addPartialResponseHeader(message);
+ }
+ verify(message, outgoingPartialResponse);
+ }
+
+ private void addPartialResponseHeader(SoapMessage message) {
+ try {
+ // add piggybacked wsa:From header to partial response
+ List<Header> header = message.getHeaders();
+ Document doc = DOMUtils.createDocument();
+ SoapVersion ver = message.getVersion();
+ Element hdr = doc.createElementNS(ver.getHeader().getNamespaceURI(),
+ ver.getHeader().getLocalPart());
+ hdr.setPrefix(ver.getHeader().getPrefix());
+
+ marshallFrom("urn:piggyback_responder", hdr, getMarshaller());
+ NodeList nl = hdr.getChildNodes();
+ for (int i = 0; i < nl.getLength(); i++) {
+ Object obj = nl.item(i);
+ if (obj instanceof Element) {
+ Element elem = (Element) obj;
+ Header holder = new Header(
+ new QName(elem.getNamespaceURI(), elem.getLocalName()),
+ elem, null);
+ header.add(holder);
+ }
+ }
+
+ } catch (Exception e) {
+ verificationCache.put("SOAP header addition failed: " + e);
+ e.printStackTrace();
+ }
+ }
+
+ private void verify(SoapMessage message, boolean outgoingPartialResponse) {
+ try {
+ List<String> wsaHeaders = new ArrayList<String>();
+ List<Header> headers = message.getHeaders();
+ if (headers != null) {
+ recordWSAHeaders(headers,
+ wsaHeaders,
+ Names.WSA_NAMESPACE_NAME);
+ recordWSAHeaders(headers,
+ wsaHeaders,
+ VersionTransformer.Names200408.WSA_NAMESPACE_NAME);
+ recordWSAHeaders(headers,
+ wsaHeaders,
+ CxfBcAddressingTest.CUSTOMER_NAME.getNamespaceURI());
+ }
+ boolean partialResponse = isIncomingPartialResponse(message)
+ || outgoingPartialResponse;
+ verificationCache.put(CxfBcAddressingTest.verifyHeaders(wsaHeaders,
+ partialResponse,
+ isRequestLeg(message)));
+ } catch (SOAPException se) {
+ verificationCache.put("SOAP header verification failed: " + se);
+ }
+ }
+
+ private void recordWSAHeaders(List<Header> headers,
+ List<String> wsaHeaders,
+ String namespaceURI) {
+ Iterator<Header> iter = headers.iterator();
+ while (iter.hasNext()) {
+ Object obj = iter.next().getObject();
+ if (obj instanceof Element) {
+ Element hdr = (Element) obj;
+ if (namespaceURI.equals(hdr.getNamespaceURI())) {
+ if (namespaceURI.endsWith("addressing")) {
+ currentNamespaceURI = namespaceURI;
+ wsaHeaders.add(hdr.getLocalName());
+ } else if (CxfBcAddressingTest.CUSTOMER_NAME.getNamespaceURI().equals(namespaceURI)) {
+ String headerText = hdr.getTextContent();
+ if (CxfBcAddressingTest.CUSTOMER_KEY.equals(headerText)) {
+ wsaHeaders.add(hdr.getLocalName());
+ }
+ }
+ }
+ }
+
+ }
+ }
+
+ private boolean isRequestLeg(SoapMessage message) {
+ return (ContextUtils.isRequestor(message) && ContextUtils.isOutbound(message))
+ || (!ContextUtils.isRequestor(message) && !ContextUtils.isOutbound(message));
+ }
+
+ private boolean isOutgoingPartialResponse(SoapMessage message) {
+ AddressingProperties maps =
+ (AddressingProperties)message.get(SERVER_ADDRESSING_PROPERTIES_OUTBOUND);
+ return ContextUtils.isOutbound(message)
+ && !ContextUtils.isRequestor(message)
+ && maps != null
+ && Names.WSA_ANONYMOUS_ADDRESS.equals(maps.getTo().getValue());
+ }
+
+ private boolean isIncomingPartialResponse(SoapMessage message)
+ throws SOAPException {
+ AddressingProperties maps =
+ (AddressingProperties)message.get(CLIENT_ADDRESSING_PROPERTIES_INBOUND);
+ return !ContextUtils.isOutbound(message)
+ && ContextUtils.isRequestor(message)
+ && maps != null
+ && Names.WSA_ANONYMOUS_ADDRESS.equals(maps.getTo().getValue());
+ }
+
+ private Marshaller getMarshaller() throws JAXBException {
+ JAXBContext jaxbContext =
+ VersionTransformer.getExposedJAXBContext(currentNamespaceURI);
+ Marshaller marshaller = jaxbContext.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
+ return marshaller;
+ }
+
+ private void marshallFrom(String from, Element header, Marshaller marshaller)
+ throws JAXBException {
+ if (Names.WSA_NAMESPACE_NAME.equals(currentNamespaceURI)) {
+ String u = "urn:piggyback_responder";
+ AttributedURIType value =
+ org.apache.cxf.ws.addressing.ContextUtils.getAttributedURI(u);
+ marshaller.marshal(
+ new JAXBElement<AttributedURIType>(Names.WSA_FROM_QNAME,
+ AttributedURIType.class,
+ value),
+ header);
+ } else if (VersionTransformer.Names200408.WSA_NAMESPACE_NAME.equals(
+ currentNamespaceURI)) {
+ AttributedURI value =
+ VersionTransformer.Names200408.WSA_OBJECT_FACTORY.createAttributedURI();
+ value.setValue(from);
+ QName qname = new QName(VersionTransformer.Names200408.WSA_NAMESPACE_NAME,
+ Names.WSA_FROM_NAME);
+ marshaller.marshal(
+ new JAXBElement<AttributedURI>(qname,
+ AttributedURI.class,
+ value),
+ header);
+ }
+ }
+
+ public void setVerificationCache(VerificationCache cache) {
+ verificationCache = cache;
+ }
+}
+
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/HeaderVerifier.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/HeaderVerifier.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/MAPVerifier.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/MAPVerifier.java?rev=570691&view=auto
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/MAPVerifier.java (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/MAPVerifier.java Wed Aug 29 01:16:04 2007
@@ -0,0 +1,105 @@
+/*
+ * 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.servicemix.cxfbc.ws.addressing;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.ws.addressing.AddressingPropertiesImpl;
+import org.apache.cxf.ws.addressing.ContextUtils;
+import org.apache.cxf.ws.addressing.Names;
+
+import static org.apache.cxf.ws.addressing.JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND;
+import static org.apache.cxf.ws.addressing.JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND;
+
+
+/**
+ * Verifies presence of MAPs in the context.
+ */
+public class MAPVerifier extends AbstractPhaseInterceptor<Message> {
+ VerificationCache verificationCache = new GreeterImpl();
+ List<String> expectedExposedAs = new ArrayList<String>();
+ private Map<String, Object> mapProperties;
+
+ public MAPVerifier() {
+ super(Phase.POST_LOGICAL);
+ mapProperties = new HashMap<String, Object>();
+ mapProperties.put(CxfBcAddressingTest.INBOUND_KEY, CLIENT_ADDRESSING_PROPERTIES_INBOUND);
+ mapProperties.put(CxfBcAddressingTest.OUTBOUND_KEY, CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+ }
+
+ public void handleMessage(Message message) {
+ verify(message);
+ }
+
+ public void handleFault(Message message) {
+ verify(message);
+ }
+
+ private void verify(Message message) {
+ boolean isOutbound = ContextUtils.isOutbound(message);
+ String mapProperty =
+ (String)mapProperties.get(isOutbound
+ ? CxfBcAddressingTest.OUTBOUND_KEY
+ : CxfBcAddressingTest.INBOUND_KEY);
+ AddressingPropertiesImpl maps =
+ (AddressingPropertiesImpl)message.get(mapProperty);
+ if (ContextUtils.isRequestor(message)) {
+ if (isOutbound) {
+ String exposeAs = getExpectedExposeAs(false);
+ if (exposeAs != null) {
+ maps.exposeAs(exposeAs);
+ }
+ } else {
+ String exposeAs = getExpectedExposeAs(true);
+ String expected = exposeAs != null
+ ? exposeAs
+ : Names.WSA_NAMESPACE_NAME;
+ if (maps.getNamespaceURI() != expected) {
+ verificationCache.put("Incoming version mismatch"
+ + " expected: " + expected
+ + " got: " + maps.getNamespaceURI());
+ }
+ exposeAs = null;
+ }
+ }
+ verificationCache.put(CxfBcAddressingTest.verifyMAPs(maps, this));
+ }
+
+ private String getExpectedExposeAs(boolean remove) {
+ int size = expectedExposedAs.size();
+ return size == 0
+ ? null
+ : remove
+ ? expectedExposedAs.remove(size - 1)
+ : expectedExposedAs.get(size - 1);
+ }
+
+ public void setVerificationCache(VerificationCache cache) {
+ verificationCache = cache;
+ }
+
+ public void addToExpectedExposedAs(String str) {
+ expectedExposedAs.add(str);
+ }
+}
+
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/MAPVerifier.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/MAPVerifier.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/VerificationCache.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/VerificationCache.java?rev=570691&view=auto
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/VerificationCache.java (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/VerificationCache.java Wed Aug 29 01:16:04 2007
@@ -0,0 +1,21 @@
+/*
+ * 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.servicemix.cxfbc.ws.addressing;
+
+public interface VerificationCache {
+ void put(String verification);
+}
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/VerificationCache.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/addressing/VerificationCache.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/policy/CxfBCPolicyTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/policy/CxfBCPolicyTest.java?rev=570691&r1=570690&r2=570691&view=diff
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/policy/CxfBCPolicyTest.java (original)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/policy/CxfBCPolicyTest.java Wed Aug 29 01:16:04 2007
@@ -24,6 +24,8 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.endpoint.ClientImpl;
+import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.greeter_control.BasicGreeterService;
import org.apache.cxf.greeter_control.Greeter;
import org.apache.cxf.greeter_control.PingMeFault;
@@ -59,8 +61,10 @@
ConnectionHelper.setKeepAliveConnection(greeter, true);
}
+ //set timeout to 30 secs to avoid intermitly failed
+ ((ClientImpl)ClientProxy.getClient(greeter)).setSynchronousTimeout(30000);
+
// oneway
-
greeter.greetMeOneWay("CXF");
// two-way
Modified: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/rm/CxfBcRMSequenceTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/rm/CxfBcRMSequenceTest.java?rev=570691&r1=570690&r2=570691&view=diff
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/rm/CxfBcRMSequenceTest.java (original)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/rm/CxfBcRMSequenceTest.java Wed Aug 29 01:16:04 2007
@@ -35,6 +35,7 @@
import org.apache.cxf.binding.soap.SoapFault;
import org.apache.cxf.bus.spring.SpringBusFactory;
import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.endpoint.ClientImpl;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.greeter_control.Control;
import org.apache.cxf.greeter_control.ControlService;
@@ -1347,6 +1348,10 @@
}
greeter = gs.getGreeterPort();
+
+ // set timeout to 30 secs to avoid intermitly failed
+ ((ClientImpl)ClientProxy.getClient(greeter)).setSynchronousTimeout(30000);
+
LOG.fine("Created greeter client.");
ConnectionHelper.setKeepAliveConnection(greeter, true);
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/addressing-hpux.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/addressing-hpux.xml?rev=570691&view=auto
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/addressing-hpux.xml (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/addressing-hpux.xml Wed Aug 29 01:16:04 2007
@@ -0,0 +1,33 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:http="http://cxf.apache.org/transports/http/configuration"
+ xsi:schemaLocation="
+http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <http:conduit name="{http://apache.org/hello_world_soap_http}SoapPort.http-conduit">
+ <http:client Connection="Keep-Alive" DecoupledEndpoint="http://localhost:9999/decoupled_endpoint"/>
+ </http:conduit>
+
+ <import resource="wsa_interceptors.xml"/>
+</beans>
+
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/addressing-hpux.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/addressing-hpux.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/addressing-hpux.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/addressing.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/addressing.xml?rev=570691&view=auto
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/addressing.xml (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/addressing.xml Wed Aug 29 01:16:04 2007
@@ -0,0 +1,33 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:http="http://cxf.apache.org/transports/http/configuration"
+ xsi:schemaLocation="
+http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <http:conduit name="{http://apache.org/hello_world_soap_http}SoapPort.http-conduit">
+ <http:client DecoupledEndpoint="http://localhost:9999/decoupled_endpoint"/>
+ </http:conduit>
+
+ <import resource="wsa_interceptors.xml"/>
+</beans>
+
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/addressing.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/addressing.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/addressing.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/hello_world.wsdl
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/hello_world.wsdl?rev=570691&view=auto
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/hello_world.wsdl (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/hello_world.wsdl Wed Aug 29 01:16:04 2007
@@ -0,0 +1,407 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://apache.org/hello_world_soap_http"
+ xmlns:x1="http://apache.org/hello_world_soap_http/types"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://apache.org/hello_world_soap_http" name="HelloWorld">
+ <wsdl:types>
+ <schema targetNamespace="http://apache.org/hello_world_soap_http/types" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:x1="http://apache.org/hello_world_soap_http/types" elementFormDefault="qualified">
+ <element name="sayHi">
+ <complexType/>
+ </element>
+ <element name="sayHiResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMe">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="testNillable">
+ <complexType>
+ <sequence>
+ <element name="NillElem" nillable="true" type="string"/>
+ <element name="intElem" type="int"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="testNillableResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" nillable="true" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="greetMeLater">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="long"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeLaterResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeSometime">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeSometimeResponse">
+ <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="testDocLitFault">
+ <complexType>
+ <sequence>
+ <element name="faultType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="testDocLitFaultResponse">
+ <complexType>
+ <sequence/>
+ </complexType>
+ </element>
+ <complexType name="ErrorCode">
+ <sequence>
+ <element name="minor" type="short"/>
+ <element name="major" type="short"/>
+ </sequence>
+ </complexType>
+ <element name="NoSuchCodeLit">
+ <complexType>
+ <sequence>
+ <element name="code" type="x1:ErrorCode"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="BadRecordLit" type="string"/>
+ <complexType name="BadRecord">
+ <sequence>
+ <element name="reason" type="string"/>
+ <element name="code" type="short"/>
+ </sequence>
+ </complexType>
+ <complexType name="addNumbers">
+ <sequence>
+ <element name="arg0" type="int"/>
+ <element name="arg1" type="int"/>
+ </sequence>
+ </complexType>
+ <element name="addNumbers" type="x1:addNumbers"/>
+ <complexType name="addNumbersResponse">
+ <sequence>
+ <element name="return" type="int"/>
+ </sequence>
+ </complexType>
+ <element name="addNumbersResponse" type="x1:addNumbersResponse"/>
+ <complexType name="stringStruct">
+ <sequence>
+ <element name="arg0" type="string"/>
+ <element name="arg1" type="string"/>
+ </sequence>
+ </complexType>
+ <element name="BareDocument" type="string"/>
+ <element name="BareDocumentResponse">
+ <complexType>
+ <sequence>
+ <element name="company" type="string"/>
+ </sequence>
+ <attribute name="id" type="int"/>
+ </complexType>
+ </element>
+ </schema>
+ </wsdl:types>
+ <wsdl:message name="sayHiRequest">
+ <wsdl:part name="in" element="x1:sayHi"/>
+ </wsdl:message>
+ <wsdl:message name="sayHiResponse">
+ <wsdl:part name="out" element="x1:sayHiResponse"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeRequest">
+ <wsdl:part name="in" element="x1:greetMe"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeResponse">
+ <wsdl:part name="out" element="x1:greetMeResponse"/>
+ </wsdl:message>
+ <wsdl:message name="testNillableRequest">
+ <wsdl:part name="in" element="x1:testNillable"/>
+ </wsdl:message>
+ <wsdl:message name="testNillableResponse">
+ <wsdl:part name="out" element="x1:testNillableResponse"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeLaterRequest">
+ <wsdl:part name="in" element="x1:greetMeLater"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeLaterResponse">
+ <wsdl:part name="out" element="x1:greetMeLaterResponse"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeSometimeRequest">
+ <wsdl:part name="in" element="x1:greetMeSometime"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeSometimeResponse">
+ <wsdl:part name="out" element="x1:greetMeSometimeResponse"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeOneWayRequest">
+ <wsdl:part name="in" element="x1:greetMeOneWay"/>
+ </wsdl:message>
+ <wsdl:message name="testDocLitFaultRequest">
+ <wsdl:part name="in" element="x1:testDocLitFault"/>
+ </wsdl:message>
+ <wsdl:message name="testDocLitFaultResponse">
+ <wsdl:part name="out" element="x1:testDocLitFaultResponse"/>
+ </wsdl:message>
+ <wsdl:message name="NoSuchCodeLitFault">
+ <wsdl:part name="NoSuchCodeLit" element="x1:NoSuchCodeLit"/>
+ </wsdl:message>
+ <wsdl:message name="BadRecordLitFault">
+ <wsdl:part name="BadRecordLit" element="x1:BadRecordLit"/>
+ </wsdl:message>
+ <wsdl:message name="testDocLitBareRequest">
+ <wsdl:part name="in" element="x1:BareDocument"/>
+ </wsdl:message>
+ <wsdl:message name="testDocLitBareResponse">
+ <wsdl:part name="out" element="x1:BareDocumentResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="Greeter">
+ <wsdl:operation name="sayHi">
+ <wsdl:input name="sayHiRequest" message="tns:sayHiRequest"/>
+ <wsdl:output name="sayHiResponse" message="tns:sayHiResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="greetMe">
+ <wsdl:input name="greetMeRequest" message="tns:greetMeRequest"/>
+ <wsdl:output name="greetMeResponse" message="tns:greetMeResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="testNillable">
+ <wsdl:input name="testNillableRequest" message="tns:testNillableRequest"/>
+ <wsdl:output name="testNillableResponse" message="tns:testNillableResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="greetMeLater">
+ <wsdl:input name="greetMeLaterRequest" message="tns:greetMeLaterRequest"/>
+ <wsdl:output name="greetMeLaterResponse" message="tns:greetMeLaterResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="greetMeSometime">
+ <wsdl:input name="greetMeSometimeRequest" message="tns:greetMeSometimeRequest"/>
+ <wsdl:output name="greetMeSometimeResponse" message="tns:greetMeSometimeResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="greetMeOneWay">
+ <wsdl:input name="greetMeOneWayRequest" message="tns:greetMeOneWayRequest"/>
+ </wsdl:operation>
+ <wsdl:operation name="testDocLitFault">
+ <wsdl:input name="testDocLitFaultRequest" message="tns:testDocLitFaultRequest"/>
+ <wsdl:output name="testDocLitFaultResponse" message="tns:testDocLitFaultResponse"/>
+ <wsdl:fault name="NoSuchCodeLitFault" message="tns:NoSuchCodeLitFault"/>
+ <wsdl:fault name="BadRecordLitFault" message="tns:BadRecordLitFault"/>
+ </wsdl:operation>
+
+ </wsdl:portType>
+
+ <wsdl:portType name="DocLitBare">
+ <wsdl:operation name="testDocLitBare">
+ <wsdl:input name="testDocLitBareRequest" message="tns:testDocLitBareRequest"/>
+ <wsdl:output name="testDocLitBareResponse" message="tns:testDocLitBareResponse"/>
+ </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 style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="greetMe">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="testNillable">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="greetMeLater">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="greetMeSometime">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="greetMeOneWay">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ </wsdl:operation>
+ <wsdl:operation name="testDocLitFault">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="NoSuchCodeLitFault">
+ <soap:fault name="NoSuchCodeLitFault" use="literal"/>
+ </wsdl:fault>
+ <wsdl:fault name="BadRecordLitFault">
+ <soap:fault name="BadRecordLitFault" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+
+ </wsdl:binding>
+ <wsdl:binding name="Doc_Lit_Bare_SOAPBinding" type="tns:DocLitBare">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="testDocLitBare">
+ <soap:operation style="document" soapAction="http://apache.org/hello_world_soap_http/testDocLitBare"/>
+ <wsdl:input name="testDocLitBareRequest">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="testDocLitBareResponse">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+
+ <wsdl:service name="SOAPService">
+ <wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
+ </wsdl:port>
+
+ <wsdl:port name="SoapPort1" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:7000/SoapContext/SoapPort"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <wsdl:service name="SOAPProviderService">
+ <wsdl:port name="SoapProviderPort" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9003/SoapContext/SoapProviderPort"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <wsdl:service name="SOAPDispatchService">
+ <wsdl:port name="SoapDispatchPort" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9006/SOAPDispatchService/SoapDispatchPort"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <wsdl:service name="SOAPService_DocLitBare">
+ <wsdl:port name="SoapPort2" binding="tns:Doc_Lit_Bare_SOAPBinding">
+ <soap:address location="http://localhost:7600/SoapContext/SoapPort"/>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="SOAPServiceAddressingDocLitBare">
+ <wsdl:port name="SoapPort" binding="tns:Doc_Lit_Bare_SOAPBinding">
+ <soap:address location="http://localhost:7600/SoapContext/SoapPort"/>
+ <wswa:UsingAddressing xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl"/>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="SOAPService_Test1">
+ <wsdl:port name="SoapPort_Test1" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9100"/>
+ </wsdl:port>
+ <wsdl:port name="SoapPort_Test2" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9101"/>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="SOAPServiceAddressing">
+ <wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9008/SoapContext/SoapPort"/>
+ <wswa:UsingAddressing xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl"/>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="SOAPServiceConcurrencyTest">
+ <wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9009/SoapContext/SoapPort"/>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="SOAPServiceBogusAddressTest">
+ <wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="FOO"/>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="SOAPServiceMultiPortTypeTest">
+ <wsdl:port name="GreeterPort" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9020/MultiPort/GreeterPort"/>
+ </wsdl:port>
+ <wsdl:port name="DocLitBarePort" binding="tns:Doc_Lit_Bare_SOAPBinding">
+ <soap:address location="http://localhost:9021/MultiPort/DocBarePort"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
+
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/hello_world.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/hello_world.wsdl
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/addressing/hello_world.wsdl
------------------------------------------------------------------------------
svn:mime-type = text/xml