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 2008/08/16 13:48:25 UTC
svn commit: r686482 - in /servicemix/smx4/features/trunk/examples: ./
cxf-ws-addressing/ cxf-ws-addressing/src/ cxf-ws-addressing/src/main/
cxf-ws-addressing/src/main/java/ cxf-ws-addressing/src/main/java/org/
cxf-ws-addressing/src/main/java/org/apache...
Author: ffang
Date: Sat Aug 16 04:48:24 2008
New Revision: 686482
URL: http://svn.apache.org/viewvc?rev=686482&view=rev
Log:
[SMX4-85]Add WS-Addressing osgi tests
Added:
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/pom.xml (with props)
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/servicemix/
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/servicemix/examples/
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/servicemix/examples/cxf/
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/servicemix/examples/cxf/wsaddressing/
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/servicemix/examples/cxf/wsaddressing/ConciseFormatter.java (with props)
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/servicemix/examples/cxf/wsaddressing/GreeterImpl.java (with props)
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/META-INF/
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/META-INF/spring/
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/META-INF/spring/beans.xml (with props)
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/wsdl/
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/wsdl/cxf-servlet.xml (with props)
servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/wsdl/hello_world_addr.wsdl (with props)
Modified:
servicemix/smx4/features/trunk/examples/itests/pom.xml
servicemix/smx4/features/trunk/examples/itests/src/test/java/org/apache/servicemix/examples/IntegrationTest.java
servicemix/smx4/features/trunk/examples/pom.xml
Added: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/cxf-ws-addressing/pom.xml?rev=686482&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/cxf-ws-addressing/pom.xml (added)
+++ servicemix/smx4/features/trunk/examples/cxf-ws-addressing/pom.xml Sat Aug 16 04:48:24 2008
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <!--
+
+ 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.
+ -->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix.examples</groupId>
+ <artifactId>examples</artifactId>
+ <version>4.0-m2-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.servicemix.examples</groupId>
+ <artifactId>cxf-ws-addressing</artifactId>
+ <packaging>bundle</packaging>
+ <version>4.0-m2-SNAPSHOT</version>
+ <name>Apache ServiceMix Example :: CXF WS-ADDRESSING OSGI</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxws</artifactId>
+ <version>${cxf.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
+ <version>${geronimo.wsmetadata.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-codegen-plugin</artifactId>
+ <version>${cxf.version}</version>
+ <executions>
+ <execution>
+ <id>generate-test-sources</id>
+ <phase>generate-sources</phase>
+ <configuration>
+ <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
+ <wsdlOptions>
+ <wsdlOption>
+ <wsdl>${basedir}/src/main/resources/wsdl/hello_world_addr.wsdl</wsdl>
+ </wsdlOption>
+ </wsdlOptions>
+ </configuration>
+ <goals>
+ <goal>wsdl2java</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+ <Import-Package>
+ javax.jws,
+ javax.wsdl,
+ javax.xml.bind,
+ javax.xml.bind.annotation,
+ javax.xml.namespace,
+ javax.xml.soap,
+ javax.xml.transform,
+ javax.xml.ws,
+ javax.xml.ws.handler,
+ javax.xml.ws.handler.soap,
+ META-INF.cxf,
+ META-INF.cxf.osgi,
+ org.apache.cxf.bus,
+ org.apache.cxf.bus.spring,
+ org.apache.cxf.bus.resource,
+ org.apache.cxf.configuration.spring,
+ org.apache.cxf.resource,
+ org.apache.servicemix.cxf.transport.http_osgi,
+ org.springframework.beans.factory.config
+ </Import-Package>
+ <Require-Bundle>org.apache.cxf.cxf-bundle</Require-Bundle>
+ <Export-Package>org.apache.servicemix.examples.cxf.wsaddressing,
+ org.apache.hello_world_soap_http,
+ org.apache.hello_world_soap_http.types,
+ </Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Propchange: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/servicemix/examples/cxf/wsaddressing/ConciseFormatter.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/servicemix/examples/cxf/wsaddressing/ConciseFormatter.java?rev=686482&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/servicemix/examples/cxf/wsaddressing/ConciseFormatter.java (added)
+++ servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/servicemix/examples/cxf/wsaddressing/ConciseFormatter.java Sat Aug 16 04:48:24 2008
@@ -0,0 +1,33 @@
+/**
+ * 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.examples.cxf.wsaddressing;
+
+import java.util.logging.LogRecord;
+import java.util.logging.SimpleFormatter;
+
+public class ConciseFormatter extends SimpleFormatter {
+ public synchronized String format(LogRecord record) {
+ String longForm = super.format(record);
+ String shortForm = longForm.indexOf("INFO: ") > 0
+ ? longForm.substring(longForm.indexOf("INFO: ") + 6)
+ : longForm;
+ return shortForm;
+ }
+}
Propchange: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/servicemix/examples/cxf/wsaddressing/ConciseFormatter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/servicemix/examples/cxf/wsaddressing/ConciseFormatter.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/servicemix/examples/cxf/wsaddressing/GreeterImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/servicemix/examples/cxf/wsaddressing/GreeterImpl.java?rev=686482&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/servicemix/examples/cxf/wsaddressing/GreeterImpl.java (added)
+++ servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/servicemix/examples/cxf/wsaddressing/GreeterImpl.java Sat Aug 16 04:48:24 2008
@@ -0,0 +1,79 @@
+/**
+ * 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.examples.cxf.wsaddressing;
+
+import java.util.logging.Logger;
+
+import javax.jws.WebService;
+
+import org.apache.hello_world_soap_http.Greeter;
+import org.apache.hello_world_soap_http.PingMeFault;
+import org.apache.hello_world_soap_http.types.FaultDetail;
+
+@WebService(name = "SoapPort",
+ portName = "SoapPort",
+ serviceName = "SOAPService",
+ targetNamespace = "http://apache.org/hello_world_soap_http",
+ wsdlLocation = "wsdl/hello_world_addr.wsdl")
+
+public class GreeterImpl implements Greeter {
+
+ private static final Logger LOG =
+ Logger.getLogger(GreeterImpl.class.getPackage().getName());
+
+ /* (non-Javadoc)
+ * @see org.apache.hello_world_soap_http.Greeter#greetMe(java.lang.String)
+ */
+ public String greetMe(String me) {
+ LOG.info("Executing operation greetMe");
+ System.out.println("Executing operation greetMe");
+ System.out.println("Message received: " + me + "\n");
+ return "Hello " + me;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.hello_world_soap_http.Greeter#greetMeOneWay(java.lang.String)
+ */
+ public void greetMeOneWay(String me) {
+ LOG.info("Executing operation greetMeOneWay");
+ System.out.println("Executing operation greetMeOneWay\n");
+ System.out.println("Hello there " + me);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.hello_world_soap_http.Greeter#sayHi()
+ */
+ public String sayHi() {
+ LOG.info("Executing operation sayHi");
+ System.out.println("Executing operation sayHi\n");
+ return "Bonjour";
+ }
+
+ public void pingMe() throws PingMeFault {
+ FaultDetail faultDetail = new FaultDetail();
+ faultDetail.setMajor((short)2);
+ faultDetail.setMinor((short)1);
+ LOG.info("Executing operation pingMe, throwing PingMeFault exception");
+ System.out.println("Executing operation pingMe, throwing PingMeFault exception\n");
+ throw new PingMeFault("PingMeFault raised by server", faultDetail);
+ }
+
+
+}
Propchange: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/servicemix/examples/cxf/wsaddressing/GreeterImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/java/org/apache/servicemix/examples/cxf/wsaddressing/GreeterImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/META-INF/spring/beans.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/META-INF/spring/beans.xml?rev=686482&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/META-INF/spring/beans.xml (added)
+++ servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/META-INF/spring/beans.xml Sat Aug 16 04:48:24 2008
@@ -0,0 +1,105 @@
+<?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.
+-->
+<!-- START SNIPPET: beans -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:jaxws="http://cxf.apache.org/jaxws"
+ xmlns:cxf="http://cxf.apache.org/core"
+ xmlns:osgi="http://www.springframework.org/schema/osgi"
+ xmlns:wsa="http://cxf.apache.org/ws/addressing"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.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://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.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-http.xml" />
+ <import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
+
+ <jaxws:endpoint id="WsAddressingEndpoint"
+ implementor="org.apache.servicemix.examples.cxf.wsaddressing.GreeterImpl"
+ address="/SoapContext/SoapPort"
+ wsdlLocation="wsdl/hello_world_addr.wsdl"
+ endpointName="e:SoapPort"
+ serviceName="s:SOAPService"
+ xmlns:e="http://apache.org/hello_world_soap_http"
+ xmlns:s="http://apache.org/hello_world_soap_http">
+ <jaxws:features>
+ <bean class="org.apache.cxf.feature.LoggingFeature"/>
+ </jaxws:features>
+ </jaxws:endpoint>
+
+
+ <jaxws:client id="client"
+ serviceClass="org.apache.hello_world_soap_http.Greeter"
+ endpointName="e:SoapPort"
+ serviceName="s:SOAPService"
+ xmlns:e="http://apache.org/hello_world_soap_http"
+ xmlns:s="http://apache.org/hello_world_soap_http"
+ wsdlLocation="wsdl/hello_world_addr.wsdl"
+ address="http://localhost:8080/cxf/SoapContext/SoapPort">
+ </jaxws:client>
+
+ <osgi:service id="testWSAddressing" ref="client"
+ interface="org.apache.hello_world_soap_http.Greeter"/>
+
+ <osgi:service id="businstance" ref="cxf"
+ interface="org.apache.cxf.bus.CXFBusImpl"/>
+
+
+ <bean id="mapAggregator" class="org.apache.cxf.ws.addressing.MAPAggregator"/>
+ <bean id="mapCodec" class="org.apache.cxf.ws.addressing.soap.MAPCodec"/>
+ <bean id="logInbound" class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+ <bean id="logOutbound" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+ <!-- We are adding the interceptors to the bus as we will have only one endpoint/service/bus. -->
+
+ <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl">
+ <property name="inInterceptors">
+ <list>
+ <ref bean="mapAggregator"/>
+ <ref bean="mapCodec"/>
+ </list>
+ </property>
+ <property name="inFaultInterceptors">
+ <list>
+ <ref bean="mapAggregator"/>
+ <ref bean="mapCodec"/>
+ <ref bean="logInbound"/>
+ </list>
+ </property>
+ <property name="outInterceptors">
+ <list>
+ <ref bean="mapAggregator"/>
+ <ref bean="mapCodec"/>
+ </list>
+ </property>
+ <property name="outFaultInterceptors">
+ <list>
+ <ref bean="mapAggregator"/>
+ <ref bean="mapCodec"/>
+ </list>
+ </property>
+ </bean>
+
+
+</beans>
+<!-- END SNIPPET: beans -->
Propchange: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/META-INF/spring/beans.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/META-INF/spring/beans.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/META-INF/spring/beans.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/wsdl/cxf-servlet.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/wsdl/cxf-servlet.xml?rev=686482&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/wsdl/cxf-servlet.xml (added)
+++ servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/wsdl/cxf-servlet.xml Sat Aug 16 04:48:24 2008
@@ -0,0 +1,40 @@
+<?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:jaxws="http://cxf.apache.org/jaxws"
+ xmlns:soap="http://cxf.apache.org/bindings/soap"
+ xmlns:wsa="http://cxf.apache.org/ws/addressing"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd
+http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
+
+ <jaxws:endpoint
+ id="hello_world"
+ implementor="demo.ws_addressing.server.GreeterImpl"
+ wsdlLocation="WEB-INF/wsdl/hello_world_addr.wsdl"
+ address="/hello_world">
+ <jaxws:features>
+ <bean class="org.apache.cxf.feature.LoggingFeature"/>
+ <wsa:addressing/>
+ </jaxws:features>
+ </jaxws:endpoint>
+</beans>
Propchange: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/wsdl/cxf-servlet.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/wsdl/cxf-servlet.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/wsdl/cxf-servlet.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/wsdl/hello_world_addr.wsdl
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/wsdl/hello_world_addr.wsdl?rev=686482&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/wsdl/hello_world_addr.wsdl (added)
+++ servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/wsdl/hello_world_addr.wsdl Sat Aug 16 04:48:24 2008
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<wsdl:definitions name="HelloWorld" targetNamespace="http://apache.org/hello_world_soap_http"
+ 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">
+ <wsdl:types>
+ <schema targetNamespace="http://apache.org/hello_world_soap_http/types"
+ xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <element name="sayHi">
+ <complexType/>
+ </element>
+ <element name="sayHiResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMe">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeOneWay">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="pingMe">
+ <complexType/>
+ </element>
+ <element name="pingMeResponse">
+ <complexType/>
+ </element>
+ <element name="faultDetail">
+ <complexType>
+ <sequence>
+ <element name="minor" type="xsd:short"/>
+ <element name="major" type="xsd:short"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </wsdl:types>
+ <wsdl:message name="sayHiRequest">
+ <wsdl:part element="x1:sayHi" name="in"/>
+ </wsdl:message>
+ <wsdl:message name="sayHiResponse">
+ <wsdl:part element="x1:sayHiResponse" name="out"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeRequest">
+ <wsdl:part element="x1:greetMe" name="in"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeResponse">
+ <wsdl:part element="x1:greetMeResponse" name="out"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeOneWayRequest">
+ <wsdl:part element="x1:greetMeOneWay" name="in"/>
+ </wsdl:message>
+ <wsdl:message name="pingMeRequest">
+ <wsdl:part name="in" element="x1:pingMe"/>
+ </wsdl:message>
+ <wsdl:message name="pingMeResponse">
+ <wsdl:part name="out" element="x1:pingMeResponse"/>
+ </wsdl:message>
+ <wsdl:message name="pingMeFault">
+ <wsdl:part name="faultDetail" element="x1:faultDetail"/>
+ </wsdl:message>
+
+ <wsdl:portType name="Greeter">
+ <wsdl:operation name="sayHi">
+ <wsdl:input message="tns:sayHiRequest" name="sayHiRequest"/>
+ <wsdl:output message="tns:sayHiResponse" name="sayHiResponse"/>
+ </wsdl:operation>
+
+ <wsdl:operation name="greetMe">
+ <wsdl:input message="tns:greetMeRequest" name="greetMeRequest"/>
+ <wsdl:output message="tns:greetMeResponse" name="greetMeResponse"/>
+ </wsdl:operation>
+
+ <wsdl:operation name="greetMeOneWay">
+ <wsdl:input message="tns:greetMeOneWayRequest" name="greetMeOneWayRequest"/>
+ </wsdl:operation>
+
+ <wsdl:operation name="pingMe">
+ <wsdl:input name="pingMeRequest" message="tns:pingMeRequest"/>
+ <wsdl:output name="pingMeResponse" message="tns:pingMeResponse"/>
+ <wsdl:fault name="pingMeFault" message="tns:pingMeFault"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <wsdl:operation name="sayHi">
+ <soap:operation soapAction="" style="document"/>
+ <wsdl:input name="sayHiRequest">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="sayHiResponse">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="greetMe">
+ <soap:operation soapAction="" style="document"/>
+ <wsdl:input name="greetMeRequest">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="greetMeResponse">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="greetMeOneWay">
+ <soap:operation soapAction="" style="document"/>
+ <wsdl:input name="greetMeOneWayRequest">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ </wsdl:operation>
+
+ <wsdl:operation name="pingMe">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="pingMeFault">
+ <soap:fault name="pingMeFault" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+
+ </wsdl:binding>
+ <wsdl:service name="SOAPService">
+ <wsdl:port binding="tns:Greeter_SOAPBinding" name="SoapPort">
+ <soap:address location="http://localhost:8080/cxf/SoapContext/SoapPort"/>
+ <wswa:UsingAddressing xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
+
Propchange: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/wsdl/hello_world_addr.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/wsdl/hello_world_addr.wsdl
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: servicemix/smx4/features/trunk/examples/cxf-ws-addressing/src/main/resources/wsdl/hello_world_addr.wsdl
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: servicemix/smx4/features/trunk/examples/itests/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/itests/pom.xml?rev=686482&r1=686481&r2=686482&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/examples/itests/pom.xml (original)
+++ servicemix/smx4/features/trunk/examples/itests/pom.xml Sat Aug 16 04:48:24 2008
@@ -196,6 +196,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.servicemix.examples</groupId>
+ <artifactId>cxf-ws-addressing</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.servicemix.examples</groupId>
<artifactId>cxf-nmr</artifactId>
<version>${project.version}</version>
@@ -270,6 +275,11 @@
<artifactId>pax-web-ex-whiteboard</artifactId>
<version>${pax.web.extender.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>2.5.5</version>
+ </dependency>
</dependencies>
<build>
Modified: servicemix/smx4/features/trunk/examples/itests/src/test/java/org/apache/servicemix/examples/IntegrationTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/itests/src/test/java/org/apache/servicemix/examples/IntegrationTest.java?rev=686482&r1=686481&r2=686482&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/examples/itests/src/test/java/org/apache/servicemix/examples/IntegrationTest.java (original)
+++ servicemix/smx4/features/trunk/examples/itests/src/test/java/org/apache/servicemix/examples/IntegrationTest.java Sat Aug 16 04:48:24 2008
@@ -16,11 +16,14 @@
*/
package org.apache.servicemix.examples;
+import java.io.ByteArrayOutputStream;
import java.io.File;
+import java.io.PrintWriter;
import java.util.jar.Manifest;
import java.util.Properties;
import java.util.List;
+import org.apache.cxf.Bus;
import org.apache.servicemix.examples.cxf.HelloWorld;
import org.apache.servicemix.kernel.testing.support.AbstractIntegrationTest;
import org.springframework.osgi.test.platform.OsgiPlatform;
@@ -92,6 +95,7 @@
getBundle("org.apache.servicemix.examples", "cxf-http-osgi"),
getBundle("org.apache.servicemix.examples", "cxf-soap-handler-osgi"),
getBundle("org.apache.servicemix.examples", "cxf-handler-cfg"),
+ getBundle("org.apache.servicemix.examples", "cxf-ws-addressing"),
};
}
@@ -119,13 +123,21 @@
protected Manifest getManifest() {
Manifest mf = super.getManifest();
+ String importP = mf.getMainAttributes().getValue(Constants.IMPORT_PACKAGE);
+ mf.getMainAttributes().putValue(Constants.IMPORT_PACKAGE,
+ importP + ",META-INF.cxf");
String exportP = mf.getMainAttributes().getValue(Constants.EXPORT_PACKAGE);
mf.getMainAttributes().putValue(Constants.EXPORT_PACKAGE,
exportP + ",org.apache.handlers, "
+ "org.apache.springcfg.handlers, "
+ "org.apache.handlers.types,org.apache.servicemix.examples.cxf,"
- + "org.apache.servicemix.examples.cxf.soaphandler"
- + "org.apache.servicemix.examples.cxf.springcfghandler");
+ + "org.apache.servicemix.examples.cxf.soaphandler,"
+ + "org.apache.servicemix.examples.cxf.springcfghandler,"
+ + "org.apache.servicemix.examples.cxf.wsaddressing,"
+ + "org.apache.hello_world_soap_http,"
+ + "org.apache.cxf,"
+ + "org.apache.cxf.bus,"
+ + "org.apache.cxf.interceptor");
return mf;
}
@@ -162,4 +174,41 @@
assertEquals(1016, addNumbers.addNumbers(10, 16));
}
+ public void testWsAddressingOsgi() throws Exception {
+ Thread.sleep(5000);
+ waitOnContextCreation("cxf-ws-addressing");
+
+ ServiceReference busref = bundleContext.getServiceReference(org.apache.cxf.bus.CXFBusImpl.class.getName());
+ assertNotNull("Bus Reference is null", busref);
+
+ Bus bus = (Bus)bundleContext.getService(busref);
+
+ ByteArrayOutputStream input = new ByteArrayOutputStream();
+ PrintWriter writer = new PrintWriter(input, true);
+ org.apache.cxf.interceptor.LoggingInInterceptor in = new org.apache.cxf.interceptor.LoggingInInterceptor(writer);
+ bus.getInInterceptors().add(in);
+
+ ByteArrayOutputStream output = new ByteArrayOutputStream();
+ PrintWriter outwriter = new PrintWriter(output, true);
+ org.apache.cxf.interceptor.LoggingOutInterceptor out = new org.apache.cxf.interceptor.LoggingOutInterceptor(outwriter);
+ bus.getOutInterceptors().add(out);
+
+ ServiceReference ref = bundleContext.getServiceReference(org.apache.hello_world_soap_http.Greeter.class.getName());
+ assertNotNull("Service Reference is null", ref);
+
+
+ org.apache.hello_world_soap_http.Greeter greeter = null;
+
+ greeter = (org.apache.hello_world_soap_http.Greeter) bundleContext.getService(ref);
+ assertNotNull("Cannot find the service", greeter);
+
+ assertEquals("Bonjour", greeter.sayHi());
+
+ String expectedOut = "<Address>http://www.w3.org/2005/08/addressing/anonymous</Address>";
+ String expectedIn = "<RelatesTo xmlns=\"http://www.w3.org/2005/08/addressing\">";
+
+ assertTrue(output.toString().indexOf(expectedOut) != -1);
+ assertTrue(input.toString().indexOf(expectedIn) != -1);
+ }
+
}
Modified: servicemix/smx4/features/trunk/examples/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/pom.xml?rev=686482&r1=686481&r2=686482&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/examples/pom.xml (original)
+++ servicemix/smx4/features/trunk/examples/pom.xml Sat Aug 16 04:48:24 2008
@@ -46,6 +46,7 @@
<module>cxf-http-osgi</module>
<module>cxf-soap-handler-osgi</module>
<module>cxf-handler-cfg</module>
+ <module>cxf-ws-addressing</module>
<module>itests</module>
</modules>