Author: ningjiang
Date: Tue Jul 22 05:19:04 2008
New Revision: 678734
URL: http://svn.apache.org/viewvc?rev=678734&view=rev
Log:
CAMEL-741 CAMEL-726 added test to verify the WS-Addressing with Camel transport
Added:
activemq/camel/trunk/tests/camel-itest/src/main/resources/wsdl/CustomerService_noSoapAction.wsdl
(with props)
activemq/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesWsAddressingTest.java
(with props)
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/client-WsAddressingContext.xml
(with props)
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/server-WsAddressingContext.xml
(with props)
Modified:
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/client-applicationContext.xml
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/server-applicationContext.xml
Added:
activemq/camel/trunk/tests/camel-itest/src/main/resources/wsdl/CustomerService_noSoapAction.wsdl
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/tests/camel-itest/src/main/resources/wsdl/CustomerService_noSoapAction.wsdl?rev=678734&view=auto
==============================================================================
---
activemq/camel/trunk/tests/camel-itest/src/main/resources/wsdl/CustomerService_noSoapAction.wsdl
(added)
+++
activemq/camel/trunk/tests/camel-itest/src/main/resources/wsdl/CustomerService_noSoapAction.wsdl
Tue Jul 22 05:19:04 2008
@@ -0,0 +1,103 @@
+<?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="CustomerServiceV1"
+ targetNamespace="http://camel.apache.org/itest/customerrelations"
+ xmlns:customer="http://camel.apache.org/itest/customerrelations"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:types>
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+
targetNamespace="http://camel.apache.org/itest/customerrelations"
+ xmlns="http://camel.apache.org/itest/customerrelations">
+ <xsd:include schemaLocation="../xsd/Customer.xsd" />
+ <xs:element name="getCustomerResponse"
+ type="getCustomerResponse" />
+ <xs:complexType name="getCustomerResponse">
+ <xs:sequence>
+ <xs:element name="customers"
type="Customer"
+ minOccurs="1" />
+ </xs:sequence>
+ </xs:complexType>
+ <xs:element name="getCustomer"
type="getCustomerRequest" />
+ <xs:complexType name="getCustomerRequest">
+ <xs:sequence>
+ <xs:element name="customerNummber"
type="xs:token"
+ minOccurs="1" />
+ </xs:sequence>
+ </xs:complexType>
+ <xs:element name="BusinessLogicException"
+ type="BusinessLogicException" />
+ <xs:complexType name="BusinessLogicException">
+ <xs:sequence>
+ <xs:element name="message"
nillable="true"
+ type="xs:string" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+ </wsdl:types>
+ <wsdl:message name="getCustomerResponse">
+ <wsdl:part name="parameters"
+ element="customer:getCustomerResponse">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="getCustomer">
+ <wsdl:part name="parameters" element="customer:getCustomer">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="BusinessLogicException">
+ <wsdl:part name="fault"
element="customer:BusinessLogicException">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="CustomerServiceV1">
+ <wsdl:operation name="getCustomer">
+ <wsdl:input name="getCustomer"
message="customer:getCustomer">
+ </wsdl:input>
+ <wsdl:output name="getCustomerResponse"
+ message="customer:getCustomerResponse">
+ </wsdl:output>
+ <wsdl:fault name="BusinessLogicException"
+ message="customer:BusinessLogicException">
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="CustomerServiceV1SoapBinding"
+ type="customer:CustomerServiceV1">
+ <soap:binding style="document"
+ transport="http://cxf.apache.org/transports/camel" />
+ <wsdl:operation name="getCustomer">
+ <soap:operation soapAction="" style="document" />
+ <wsdl:input name="getCustomer">
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output name="getCustomerResponse">
+ <soap:body use="literal" />
+ </wsdl:output>
+ <wsdl:fault name="BusinessLogicException">
+ <soap:fault name="BusinessLogicException"
use="literal" />
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="CustomerServiceV1">
+ <wsdl:port name="CustomerServiceV1CamelPort"
+ binding="customer:CustomerServiceV1SoapBinding">
+ <soap:address
+ location="camel://direct:clientOutbound" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
Propchange:
activemq/camel/trunk/tests/camel-itest/src/main/resources/wsdl/CustomerService_noSoapAction.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
activemq/camel/trunk/tests/camel-itest/src/main/resources/wsdl/CustomerService_noSoapAction.wsdl
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
activemq/camel/trunk/tests/camel-itest/src/main/resources/wsdl/CustomerService_noSoapAction.wsdl
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added:
activemq/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesWsAddressingTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesWsAddressingTest.java?rev=678734&view=auto
==============================================================================
---
activemq/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesWsAddressingTest.java
(added)
+++
activemq/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesWsAddressingTest.java
Tue Jul 22 05:19:04 2008
@@ -0,0 +1,61 @@
+/**
+ * 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.camel.itest.customerrelations;
+
+import java.lang.reflect.Proxy;
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.jaxws.EndpointImpl;
+import org.apache.cxf.jaxws.JaxWsClientProxy;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class CustomerServicesWsAddressingTest extends TestCase {
+
+ public void testCustomerService() throws Exception {
+ ClassPathXmlApplicationContext serverContext = null;
+ ClassPathXmlApplicationContext clientContext = null;
+ try {
+ serverContext = new ClassPathXmlApplicationContext(
+ new String[] {"spring-config/server-WsAddressingContext.xml"});
+ Object server =
serverContext.getBean("org.apache.camel.itest.customerrelations.CustomerServiceV1");
+ assertNotNull("We should get server here", server);
+
+ clientContext = new ClassPathXmlApplicationContext(
+ new String[] {"spring-config/client-WsAddressingContext.xml"});
+ CustomerServiceV1 customerService = (CustomerServiceV1)
clientContext.getBean("org.apache.camel.itest.customerrelations.CustomerServiceV1");
+
+ Customer customer = customerService.getCustomer("12345");
+ assertNotNull("We should get Customer here", customer);
+ } finally {
+ if (clientContext != null) {
+ clientContext.destroy();
+ }
+ if (serverContext != null) {
+ serverContext.destroy();
+ }
+ }
+ }
+
+}
Propchange:
activemq/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesWsAddressingTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
activemq/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesWsAddressingTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/client-WsAddressingContext.xml
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/client-WsAddressingContext.xml?rev=678734&view=auto
==============================================================================
---
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/client-WsAddressingContext.xml
(added)
+++
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/client-WsAddressingContext.xml
Tue Jul 22 05:19:04 2008
@@ -0,0 +1,54 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+ http://cxf.apache.org/core
http://cxf.apache.org/schemas/core.xsd
+ http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
+ http://cxf.apache.org/policy
http://cxf.apache.org/schemas/policy.xsd
+ http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring-1.3.0.xsd
+ http://cxf.apache.org/transports/camel
http://cxf.apache.org/transports/camel.xsd">
+
+ <import resource="classpath:META-INF/cxf/cxf.xml" />
+ <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
+ <import resource="classpath:META-INF/cxf/cxf-extension-camel.xml" />
+
+ <import resource="classpath:spring-config/jms-applicationContext.xml" />
+
+
+ <client
+ id="org.apache.camel.itest.customerrelations.CustomerServiceV1"
+ xmlns="http://cxf.apache.org/jaxws"
+ xmlns:customer="http://camel.apache.org/itest/customerrelations"
+ serviceName="customer:CustomerServiceV1"
+ endpointName="customer:CustomerServiceV1CamelPort"
+
serviceClass="org.apache.camel.itest.customerrelations.CustomerServiceV1"
+
wsdlLocation="./src/main/resources/wsdl/CustomerService_noSoapAction.wsdl">
+ <!-- properties>
+ <entry
xmlns="http://www.springframework.org/schema/beans"
+ key="mtom-enabled" value="true" />
+ </properties-->
+ <features>
+ <!-- Enable logging of SOAP messages. -->
+ <logging xmlns="http://cxf.apache.org/core" />
+ <!-- Enable WS-Addressing -->
+ <addressing xmlns="http://cxf.apache.org/ws/addressing"
/>
+ </features>
+
+ </client>
+
+ <conduit xmlns="http://cxf.apache.org/transports/camel"
+
name="{http://www.mycompany.com/examples/customerrelations}CustomerServiceV1CamelPort.camel-conduit">
+ <camelContextRef>camelContext</camelContextRef>
+ </conduit>
+
+ <camelContext id="camelContext"
+ xmlns="http://activemq.apache.org/camel/schema/spring">
+ <route>
+ <from
+ uri="direct:clientOutbound" />
+ <to
+
uri="jms://org.apache.camel.itest.customerrelations.Addressing" />
+ </route>
+ </camelContext>
+
+
+</beans>
Propchange:
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/client-WsAddressingContext.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/client-WsAddressingContext.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/client-WsAddressingContext.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified:
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/client-applicationContext.xml
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/client-applicationContext.xml?rev=678734&r1=678733&r2=678734&view=diff
==============================================================================
---
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/client-applicationContext.xml
(original)
+++
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/client-applicationContext.xml
Tue Jul 22 05:19:04 2008
@@ -34,6 +34,7 @@
serviceName="customer:CustomerServiceV1"
endpointName="customer:CustomerServiceV1CamelPort"
serviceClass="org.apache.camel.itest.customerrelations.CustomerServiceV1"
+
wsdlLocation="./src/main/resources/wsdl/CustomerService-1.0.0.wsdl"
address="camel://direct:clientOutbound">
<properties>
<entry xmlns="http://www.springframework.org/schema/beans"
key="mtom-enabled" value="true" />
Added:
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/server-WsAddressingContext.xml
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/server-WsAddressingContext.xml?rev=678734&view=auto
==============================================================================
---
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/server-WsAddressingContext.xml
(added)
+++
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/server-WsAddressingContext.xml
Tue Jul 22 05:19:04 2008
@@ -0,0 +1,61 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:broker="http://activemq.apache.org/schema/core"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
+ http://cxf.apache.org/core
http://cxf.apache.org/schemas/core.xsd
+ http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
+ http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core-5.1.0.xsd
+ http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring-1.3.0.xsd
+ http://cxf.apache.org/transports/camel
http://cxf.apache.org/transports/camel.xsd">
+
+ <import resource="classpath:META-INF/cxf/cxf.xml" />
+ <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
+ <import resource="classpath:META-INF/cxf/cxf-extension-camel.xml" />
+
+ <broker:broker useJmx="false" persistent="false" brokerName="localhost">
+ <broker:transportConnectors>
+ <broker:transportConnector name="tcp" uri="tcp://localhost:61616"/>
+ </broker:transportConnectors>
+ </broker:broker>
+
+ <import resource="classpath:spring-config/jms-applicationContext.xml" />
+
+ <endpoint xmlns="http://cxf.apache.org/jaxws"
+ id="org.apache.camel.itest.customerrelations.CustomerServiceV1"
+ xmlns:customer="http://camel.apache.org/itest/customerrelations"
+ serviceName="customer:CustomerServiceV1"
+ endpointName="customer:CustomerServiceV1CamelPort"
+ address="camel://direct:serverInbound"
+
wsdlLocation="./src/main/resources/wsdl/CustomerService_noSoapAction.wsdl"
+
implementor="org.apache.camel.itest.customerrelations.CustomerServiceV1Impl">
+ <!-- properties>
+ <entry
xmlns="http://www.springframework.org/schema/beans"
+ key="mtom-enabled" value="true" />
+ </properties -->
+ <features>
+ <!-- Enables logging of SOAP messages. -->
+ <logging xmlns="http://cxf.apache.org/core" />
+ <!-- Enables WS-Addressing. -->
+ <addressing xmlns="http://cxf.apache.org/ws/addressing"
/>
+ <!-- policies xmlns="http://cxf.apache.org/policy"
ignoreUnknownAssertions="true" /-->
+ </features>
+
+ </endpoint>
+
+ <destination xmlns="http://cxf.apache.org/transports/camel"
+
name="{http://camel.apache.org/itest/customerrelations}CustomerServiceV1CamelPort.camel-destination">
+ <camelContextRef>camelContext</camelContextRef>
+ </destination>
+
+ <camelContext id="camelContext"
+ xmlns="http://activemq.apache.org/camel/schema/spring">
+ <route>
+ <from
+
uri="jms://org.apache.camel.itest.customerrelations.Addressing" />
+ <to
+ uri="direct:serverInbound" />
+ </route>
+ </camelContext>
+
+</beans>
Propchange:
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/server-WsAddressingContext.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/server-WsAddressingContext.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/server-WsAddressingContext.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified:
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/server-applicationContext.xml
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/server-applicationContext.xml?rev=678734&r1=678733&r2=678734&view=diff
==============================================================================
---
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/server-applicationContext.xml
(original)
+++
activemq/camel/trunk/tests/camel-itest/src/test/resources/spring-config/server-applicationContext.xml
Tue Jul 22 05:19:04 2008
@@ -43,6 +43,7 @@
serviceName="customer:CustomerServiceV1"
endpointName="customer:CustomerServiceV1CamelPort"
address="camel://direct:serverInbound"
+
wsdlLocation="./src/main/resources/wsdl/CustomerService-1.0.0.wsdl"
implementor="org.apache.camel.itest.customerrelations.CustomerServiceV1Impl">
<properties>
<entry
xmlns="http://www.springframework.org/schema/beans" key="mtom-enabled"
value="true" />