http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-jaxrs/pom.xml ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-jaxrs/pom.xml b/examples/cxf/cxf-jaxrs/pom.xml deleted file mode 100644 index b452946..0000000 --- a/examples/cxf/cxf-jaxrs/pom.xml +++ /dev/null @@ -1,86 +0,0 @@ -<?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/xsd/maven-4.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>cxf</artifactId> - <version>4.6.0-SNAPSHOT</version> - </parent> - - <artifactId>cxf-jaxrs</artifactId> - <packaging>bundle</packaging> - <name>Apache ServiceMix :: Features :: Examples :: CXF JAX-RS OSGI</name> - <description>CXF Example using JAX-RS</description> - - <dependencies> - <dependency> - <groupId>org.apache.servicemix.specs</groupId> - <artifactId>org.apache.servicemix.specs.jsr311-api-1.1.1</artifactId> - </dependency> - <dependency> - <groupId>org.apache.servicemix.specs</groupId> - <artifactId>org.apache.servicemix.specs.jaxb-api-${jaxb.api.version}</artifactId> - </dependency> - <dependency> - <groupId>org.apache.servicemix.bundles</groupId> - <artifactId>org.apache.servicemix.bundles.commons-httpclient</artifactId> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <configuration> - <instructions> - <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> - <Bundle-Description>${project.description}</Bundle-Description> - <Import-Package> - javax.wsdl, - javax.xml.bind, - javax.xml.bind.annotation, - javax.ws.rs, - javax.ws.rs.core, - org.springframework.beans.factory.config, - org.apache.commons.httpclient, - org.apache.commons.httpclient.methods - </Import-Package> - <Export-Package> - org.apache.servicemix.examples.cxf.jaxrs - </Export-Package> - </instructions> - </configuration> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <configuration> - <mainClass>org.apache.servicemix.examples.cxf.jaxrs.client.Client</mainClass> - <includePluginDependencies>false</includePluginDependencies> - </configuration> - </plugin> - </plugins> - </build> - -</project>
http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/Customer.java ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/Customer.java b/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/Customer.java deleted file mode 100644 index d96d7ff..0000000 --- a/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/Customer.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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.jaxrs; - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "Customer") -public class Customer { - private long id; - private String name; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/CustomerService.java ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/CustomerService.java b/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/CustomerService.java deleted file mode 100644 index c8fab24..0000000 --- a/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/CustomerService.java +++ /dev/null @@ -1,118 +0,0 @@ -/** - * 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.jaxrs; - -import java.util.HashMap; -import java.util.Map; - -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Response; - -@Path("/customerservice/") -public class CustomerService { - long currentId = 123; - Map<Long, Customer> customers = new HashMap<Long, Customer>(); - Map<Long, Order> orders = new HashMap<Long, Order>(); - - public CustomerService() { - init(); - } - - @GET - @Path("/customers/{id}/") - @Produces("application/xml") - public Customer getCustomer(@PathParam("id") String id) { - System.out.println("----invoking getCustomer, Customer id is: " + id); - long idNumber = Long.parseLong(id); - Customer c = customers.get(idNumber); - return c; - } - - @PUT - @Path("/customers/") - public Response updateCustomer(Customer customer) { - System.out.println("----invoking updateCustomer, Customer name is: " + customer.getName()); - Customer c = customers.get(customer.getId()); - Response r; - if (c != null) { - customers.put(customer.getId(), customer); - r = Response.ok().build(); - } else { - r = Response.notModified().build(); - } - - return r; - } - - @POST - @Path("/customers/") - public Response addCustomer(Customer customer) { - System.out.println("----invoking addCustomer, Customer name is: " + customer.getName()); - customer.setId(++currentId); - - customers.put(customer.getId(), customer); - - return Response.ok().type("application/xml").entity(customer).build(); - } - - @DELETE - @Path("/customers/{id}/") - public Response deleteCustomer(@PathParam("id") String id) { - System.out.println("----invoking deleteCustomer, Customer id is: " + id); - long idNumber = Long.parseLong(id); - Customer c = customers.get(idNumber); - - Response r; - if (c != null) { - r = Response.ok().build(); - customers.remove(idNumber); - } else { - r = Response.notModified().build(); - } - - return r; - } - - @Path("/orders/{orderId}/") - public Order getOrder(@PathParam("orderId") String orderId) { - System.out.println("----invoking getOrder, Order id is: " + orderId); - long idNumber = Long.parseLong(orderId); - Order c = orders.get(idNumber); - return c; - } - - final void init() { - Customer c = new Customer(); - c.setName("John"); - c.setId(123); - customers.put(c.getId(), c); - - Order o = new Order(); - o.setDescription("order 223"); - o.setId(223); - orders.put(o.getId(), o); - } - -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/Order.java ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/Order.java b/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/Order.java deleted file mode 100644 index ea19c73..0000000 --- a/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/Order.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * 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.jaxrs; - -import java.util.HashMap; -import java.util.Map; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "Order") -public class Order { - private long id; - private String description; - private Map<Long, Product> products = new HashMap<Long, Product>(); - - public Order() { - init(); - } - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getDescription() { - return description; - } - - public void setDescription(String d) { - this.description = d; - } - - @GET - @Path("products/{productId}/") - @Produces("application/xml") - public Product getProduct(@PathParam("productId")int productId) { - System.out.println("----invoking getProduct with id: " + productId); - Product p = products.get(new Long(productId)); - return p; - } - - final void init() { - Product p = new Product(); - p.setId(323); - p.setDescription("product 323"); - products.put(p.getId(), p); - } -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/Product.java ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/Product.java b/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/Product.java deleted file mode 100644 index cfd8b8c..0000000 --- a/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/Product.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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.jaxrs; - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "Product") -public class Product { - private long id; - private String description; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getDescription() { - return description; - } - - public void setDescription(String d) { - this.description = d; - } -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/client/Client.java ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/client/Client.java b/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/client/Client.java deleted file mode 100644 index b3962f5..0000000 --- a/examples/cxf/cxf-jaxrs/src/main/java/org/apache/servicemix/examples/cxf/jaxrs/client/Client.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - * 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.jaxrs.client; - -import java.io.File; -import java.io.ByteArrayOutputStream; -import java.io.InputStream; -import java.net.URL; - -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.methods.FileRequestEntity; -import org.apache.commons.httpclient.methods.PostMethod; -import org.apache.commons.httpclient.methods.PutMethod; -import org.apache.commons.httpclient.methods.RequestEntity; - -public final class Client { - - private Client() { - } - - public static void main(String args[]) throws Exception { - // Sent HTTP GET request to query all customer info - - // Sent HTTP GET request to query customer info - System.out.println("Sent HTTP GET request to query customer info"); - URL url = new URL("http://localhost:8181/cxf/crm/customerservice/customers/123"); - InputStream in = url.openStream(); - System.out.println(getStringFromInputStream(in)); - - // Sent HTTP GET request to query sub resource product info - System.out.println("\n"); - System.out.println("Sent HTTP GET request to query sub resource product info"); - url = new URL("http://localhost:8181/cxf/crm/customerservice/orders/223/products/323"); - in = url.openStream(); - System.out.println(getStringFromInputStream(in)); - - // Sent HTTP PUT request to update customer info - System.out.println("\n"); - System.out.println("Sent HTTP PUT request to update customer info"); - Client client = new Client(); - String inputFile = client.getClass().getResource("update_customer.xml").getFile(); - File input = new File(inputFile); - PutMethod put = new PutMethod("http://localhost:8181/cxf/crm/customerservice/customers"); - RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1"); - put.setRequestEntity(entity); - HttpClient httpclient = new HttpClient(); - - try { - int result = httpclient.executeMethod(put); - System.out.println("Response status code: " + result); - System.out.println("Response body: "); - System.out.println(put.getResponseBodyAsString()); - } finally { - // Release current connection to the connection pool once you are - // done - put.releaseConnection(); - } - - // Sent HTTP POST request to add customer - System.out.println("\n"); - System.out.println("Sent HTTP POST request to add customer"); - inputFile = client.getClass().getResource("add_customer.xml").getFile(); - input = new File(inputFile); - PostMethod post = new PostMethod("http://localhost:8181/cxf/crm/customerservice/customers"); - post.addRequestHeader("Accept" , "text/xml"); - entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1"); - post.setRequestEntity(entity); - httpclient = new HttpClient(); - - try { - int result = httpclient.executeMethod(post); - System.out.println("Response status code: " + result); - System.out.println("Response body: "); - System.out.println(post.getResponseBodyAsString()); - } finally { - // Release current connection to the connection pool once you are - // done - post.releaseConnection(); - } - - System.out.println("\n"); - System.exit(0); - } - - private static String getStringFromInputStream(InputStream in) throws Exception { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - int c = 0; - while ((c = in.read()) != -1) { - bos.write(c); - } - in.close(); - bos.close(); - return bos.toString(); - } - -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-jaxrs/src/main/resources/META-INF/spring/beans.xml ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-jaxrs/src/main/resources/META-INF/spring/beans.xml b/examples/cxf/cxf-jaxrs/src/main/resources/META-INF/spring/beans.xml deleted file mode 100644 index 18ad89c..0000000 --- a/examples/cxf/cxf-jaxrs/src/main/resources/META-INF/spring/beans.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?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:jaxrs="http://cxf.apache.org/jaxrs" - xmlns:osgi="http://www.springframework.org/schema/osgi" - xsi:schemaLocation=" -http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd -http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd -http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd"> - - - <jaxrs:server id="customerService" address="/crm"> - <jaxrs:serviceBeans> - <ref bean="customerSvc"/> - </jaxrs:serviceBeans> - </jaxrs:server> - - <bean id="customerSvc" class=" org.apache.servicemix.examples.cxf.jaxrs.CustomerService"/> - -</beans> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-jaxrs/src/main/resources/org/apache/servicemix/examples/cxf/jaxrs/client/add_customer.xml ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-jaxrs/src/main/resources/org/apache/servicemix/examples/cxf/jaxrs/client/add_customer.xml b/examples/cxf/cxf-jaxrs/src/main/resources/org/apache/servicemix/examples/cxf/jaxrs/client/add_customer.xml deleted file mode 100644 index 0b2af7f..0000000 --- a/examples/cxf/cxf-jaxrs/src/main/resources/org/apache/servicemix/examples/cxf/jaxrs/client/add_customer.xml +++ /dev/null @@ -1,3 +0,0 @@ -<Customer> - <name>Jack</name> -</Customer> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-jaxrs/src/main/resources/org/apache/servicemix/examples/cxf/jaxrs/client/update_customer.xml ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-jaxrs/src/main/resources/org/apache/servicemix/examples/cxf/jaxrs/client/update_customer.xml b/examples/cxf/cxf-jaxrs/src/main/resources/org/apache/servicemix/examples/cxf/jaxrs/client/update_customer.xml deleted file mode 100644 index 9bdb64b..0000000 --- a/examples/cxf/cxf-jaxrs/src/main/resources/org/apache/servicemix/examples/cxf/jaxrs/client/update_customer.xml +++ /dev/null @@ -1,4 +0,0 @@ -<Customer> - <name>Mary</name> - <id>123</id> -</Customer> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-jaxws-blueprint/README.txt ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-jaxws-blueprint/README.txt b/examples/cxf/cxf-jaxws-blueprint/README.txt deleted file mode 100755 index c7ddc46..0000000 --- a/examples/cxf/cxf-jaxws-blueprint/README.txt +++ /dev/null @@ -1,243 +0,0 @@ -/* - * 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. - */ - -CXF OSGi HTTP WEB SERVICE -========================= - -Purpose -------- -Create a web service with CXF and expose it through the OSGi HTTP -Service. - - -Explanation ------------ -The web service is a simple JAX-WS web service called HelloWorld. The -interface and the implementation are located in the src/main/java/org/ -apache/servicemix/examples/cxf directory of this example. - -The beans.xml file, located in the src/main/resources/META-INF/spring -directory: - -1. Imports the configuration files needed to enable CXF and OSGi work - together. - -2. Configures the web service endpoint as follows: - - <jaxws:endpoint id="helloWorld" - implementor="org.apache.servicemix.examples.cxf.HelloWorldImpl" - address="/HelloWorld"/> - - -Prerequisites for Running the Example -------------------------------------- -1. You must have the following installed on your machine: - - - JDK 1.6 or higher - - - Maven 2.2.1 or higher - - For more information, see the README in the top-level examples - directory. - - -2. Start ServiceMix by running the following command: - - <servicemix_home>/bin/servicemix (on UNIX) - <servicemix_home>\bin\servicemix (on Windows) - - -Running the Example -------------------- -You can run the example in two ways: - -- A. Using a Prebuilt Deployment Bundle: Quick and Easy -This option is useful if you want to see the example up and -running as quickly as possible. - -- B. Building the Example Bundle Yourself -This option is useful if you want to change the example in any -way. It tells you how to build and deploy the example. This -option might be slower than option A because, if you do not -already have the required bundles in your local Maven -repository, Maven will have to download the bundles it needs. - -A. Using a Prebuilt Deployment Bundle: Quick and Easy ------------------------------------------------------ -To install and run a prebuilt version of this example, enter -the following command in the ServiceMix console: - - features:install examples-cxf-osgi - -This command makes use of the ServiceMix features facility. For -more information about the features facility, see the README.txt -file in the examples parent directory. - -To view the service WSDL, open your browser and go to the following -URL: - - http://localhost:8181/cxf/HelloWorld?wsdl - -Note, if you use Safari, right click the window and select -'Show Source'. - -Running a Client ----------------- -To run the web client: - -1. Open the client.html, which is located in the same directory as - this README file, in your favorite browser. - -2. Click the Send button to send a request. - - Once the request has been successfully sent, a response similar - to the following should appear in the right-hand panel of the - web page: - - STATUS: 200 - <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> - <soap:Body><ns2:sayHiResponse xmlns:ns2="http://cxf.examples. - servicemix.apache.org/"><return>Hello John Doe</return> - </ns2:sayHiResponse> - </soap:Body> - </soap:Envelope> - -To run the java code client: - -1. Change to the <servicemix_home>/examples/cxf/cxf-osgi - directory. - -2. Run the following command: - - mvn compile exec:java - - If the client request is successful, a response similar to the - following should appear in the ServiceMix console: - - <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> - <soap:Body><ns2:sayHiResponse xmlns:ns2="http://cxf.examples. - servicemix.apache.org/"><return>Hello John Doe</return> - </ns2:sayHiResponse> - </soap:Body> - </soap:Envelope> - - -Changing /cxf servlet alias ---------------------------- -By default CXF Servlet is assigned a '/cxf' alias. You can -change it in a couple of ways - -a. Add org.apache.cxf.osgi.cfg to the /etc directory and set - the 'org.apache.cxf.servlet.context' property, for example: - - org.apache.cxf.servlet.context=/custom - -b. Use shell config commands, for example : - - config:edit org.apache.cxf.osgi - config:propset org.apache.cxf.servlet.context /super - config:update - - -B. Building the Example Bundle Yourself ---------------------------------------- -To install and run the example where you build the example bundle -yourself, complete the following steps: - -1. If you have already run the example using the prebuilt version as - described above, you must first uninstall the examples-cxf-osgi - feature by entering the following command in the ServiceMix console: - - features:uninstall examples-cxf-osgi - - -2. Build the example by opening a command prompt, changing directory to - examples/cxf-osgi (this example) and entering the following Maven - command: - - mvn install - - If all of the required OSGi bundles are available in your local - Maven repository, the example will build very quickly. Otherwise - it may take some time for Maven to download everything it needs. - - The mvn install command builds the example deployment bundle and - copies it to your local Maven repository and to the target directory - of this example. - -3. Install the example by entering the following command in - the ServiceMix console: - - features:install examples-cxf-osgi - - It makes use of the ServiceMix features facility. For more - information about the features facility, see the README.txt file - in the examples parent directory. - -To view the service WSDL, open your browser and go to the following -URL: - - http://localhost:8181/cxf/HelloWorld?wsdl - -Note, if you use Safari, right click the window and select -'Show Source'. - -You can try running a client against your service by following the -instructions in the "Running a Client" section above. - - -Stopping and Uninstalling the Example -------------------------------------- -To stop the example, you must first know the bundle ID that ServiceMix -has assigned to it. To get the bundle ID, enter the following command -at the ServiceMix console: - - osgi:list - -At the end of the listing, you should see an entry similar to the -following: - - [170] [Active ] [Started] [ 60] Apache ServiceMix Example :: CXF OSGi (4.2.0.0) - -In this case, the bundle ID is 170. - -To stop the example, enter the following command at the ServiceMix -console: - - osgi:stop <bundle_id> - -For example: - - osgi:stop 170 - -To uninstall the example, enter one of the following commands in -the ServiceMix console: - - features:uninstall examples-cxf-osgi - -or - - osgi:uninstall <bundle_id> - - -Viewing the Log Entries ------------------------ -You can view the entries in the log file in the data/log -directory of your ServiceMix installation, or by typing -the following command in the ServiceMix console: - - log:display http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-jaxws-blueprint/client.html ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-jaxws-blueprint/client.html b/examples/cxf/cxf-jaxws-blueprint/client.html deleted file mode 100755 index bc88440..0000000 --- a/examples/cxf/cxf-jaxws-blueprint/client.html +++ /dev/null @@ -1,136 +0,0 @@ -<!-- - - 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. - ---> -<html> -<head> -<title>ServiceMix 4 CXF-OSGi Example</title> -<script type="text/javascript"> -var urlToOpen = "http://localhost:8181/cxf/HelloWorld"; //default URL to open - -function getHTTPObject() { - var xmlhttp = false; - - /* Compilation conditionnelle d'IE */ - /* Check if we are using IE */ - /*@cc_on - @if (@_jscript_version >= 5) - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @else - xmlhttp = false; - @end @*/ - - /* on essaie de cr�er l'objet si ce n'est pas d�j� fait */ - /* Create the xmlhttp object if it is not yet defined */ - if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { - try { - xmlhttp = new XMLHttpRequest(); - } catch (e) { - xmlhttp = false; - } - } - - if (xmlhttp) { - /* on d�finit ce qui doit se passer quand la page r�pondra */ - /* Define the callback function for the response */ - xmlhttp.onreadystatechange=function() { - if (xmlhttp.readyState == 4) { /* 4 : �tat "complete" */ - var response = document.getElementById("response"); - var responseStatus = ""; - try { - responseStatus = xmlhttp.status + ""; - } catch (e) { - responseStatus = "ERROR WHILE RETRIEVING STATUS; MAYBE UNABLE TO CONNECT."; - } - response.value = "STATUS: " + responseStatus + "\n" + xmlhttp.responseText; - } - } - } - return xmlhttp; -} - -function send() { - if ((document.getElementById("urlToOpen").value != urlToOpen) && (document.getElementById("urlToOpen").value != "")) { - // use user entry if it is not the empty string - urlToOpen = document.getElementById("urlToOpen").value; - } - var xmlhttp = getHTTPObject(); - if (!xmlhttp) { - alert('cound not create XMLHttpRequest object'); - return; - } - var request = document.getElementById("request"); - var response = document.getElementById("response"); - try { - netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead UniversalBrowserWrite"); - } catch (e) { - } - try { - xmlhttp.open("POST", urlToOpen, true); - } catch (e) { - alert('error opening'); - } - xmlhttp.send(request.value); -} - -</script> -</head> - -<body> - -<h1>ServiceMix 4 CXF-OSGi Example</h1> - -<p>Welcome to the CXF-OSGi example for ServiceMix 4</p> - -<p>Perform a POST into the HTTP binding. This requires JavaScript.</p> -<p>Target: <input type="text" size="50" id="urlToOpen" value=""><script type="text/javascript">document.getElementById("urlToOpen").value = urlToOpen;</script>.</p> - -<table> - <tr> - <td> - <textarea id="request" style="width:600px;height:400px"><?xml version="1.0" encoding="UTF-8"?> -<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> - <soap:Body> - <ns2:sayHi xmlns:ns2="http://cxf.examples.servicemix.apache.org/"> - <arg0>John Doe</arg0> - </ns2:sayHi> - </soap:Body> -</soap:Envelope> - - </textarea> - </td> - <td> - <textarea id="response" style="width:600px;height:400px"> - </textarea> - </td> - </tr> - <tr> - <td colspan=2> - <input type="button" value="Send" onClick="send();"/> - </td> - </tr> -</table> -</body> -</html> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-jaxws-blueprint/pom.xml ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-jaxws-blueprint/pom.xml b/examples/cxf/cxf-jaxws-blueprint/pom.xml deleted file mode 100644 index a356b9f..0000000 --- a/examples/cxf/cxf-jaxws-blueprint/pom.xml +++ /dev/null @@ -1,86 +0,0 @@ -<?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/xsd/maven-4.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>cxf</artifactId> - <version>4.6.0-SNAPSHOT</version> - </parent> - - <artifactId>cxf-jaxws-blueprint</artifactId> - <packaging>bundle</packaging> - <name>Apache ServiceMix :: Features :: Examples :: CXF JAXWS Blueprint</name> - <description>CXF JAXWS example using OSGi and Blueprint</description> - - <dependencies> - <dependency> - <groupId>org.apache.geronimo.specs</groupId> - <artifactId>geronimo-ws-metadata_2.0_spec</artifactId> - </dependency> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-api</artifactId> - <version>${cxf.version}</version> - </dependency> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-rt-transports-http</artifactId> - <version>${cxf.version}</version> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <configuration> - <instructions> - <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> - <Bundle-Description>${project.description}</Bundle-Description> - <Import-Package> - javax.jws, - javax.wsdl, - javax.xml.namespace, - org.apache.cxf.helpers, - org.osgi.service.blueprint, - * - </Import-Package> - <Export-Package> - org.apache.servicemix.examples.cxf - </Export-Package> - </instructions> - </configuration> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <configuration> - <mainClass>org.apache.servicemix.samples.cxf_osgi.Client</mainClass> - <includePluginDependencies>false</includePluginDependencies> - </configuration> - </plugin> - </plugins> - </build> - -</project> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-jaxws-blueprint/src/main/java/org/apache/servicemix/examples/cxf/EnableCORSInterceptor.java ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-jaxws-blueprint/src/main/java/org/apache/servicemix/examples/cxf/EnableCORSInterceptor.java b/examples/cxf/cxf-jaxws-blueprint/src/main/java/org/apache/servicemix/examples/cxf/EnableCORSInterceptor.java deleted file mode 100644 index 9cf28b1..0000000 --- a/examples/cxf/cxf-jaxws-blueprint/src/main/java/org/apache/servicemix/examples/cxf/EnableCORSInterceptor.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * 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; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -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.transport.http.Headers; - -public class EnableCORSInterceptor extends AbstractPhaseInterceptor<Message> { - - public EnableCORSInterceptor() { - super(Phase.PRE_PROTOCOL); - } - - @Override - public void handleMessage(Message message) throws Fault { - Map<String, List<String>> headers = Headers.getSetProtocolHeaders(message); - try { - //Access-Control-Allow-Origin:* Access-Control-Allow-Methods:POST,GET - headers.put("Access-Control-Allow-Origin", Arrays.asList("*")); - headers.put("Access-Control-Allow-Methods", Arrays.asList("POST", "GET")); - } catch (Exception ce) { - throw new Fault(ce); - } - } -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-jaxws-blueprint/src/main/java/org/apache/servicemix/examples/cxf/HelloWorld.java ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-jaxws-blueprint/src/main/java/org/apache/servicemix/examples/cxf/HelloWorld.java b/examples/cxf/cxf-jaxws-blueprint/src/main/java/org/apache/servicemix/examples/cxf/HelloWorld.java deleted file mode 100755 index 14dad3a..0000000 --- a/examples/cxf/cxf-jaxws-blueprint/src/main/java/org/apache/servicemix/examples/cxf/HelloWorld.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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: service -package org.apache.servicemix.examples.cxf; - -import javax.jws.WebService; - -@WebService -public interface HelloWorld { - String sayHi(String text); -} -// END SNIPPET: service http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-jaxws-blueprint/src/main/java/org/apache/servicemix/examples/cxf/HelloWorldImpl.java ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-jaxws-blueprint/src/main/java/org/apache/servicemix/examples/cxf/HelloWorldImpl.java b/examples/cxf/cxf-jaxws-blueprint/src/main/java/org/apache/servicemix/examples/cxf/HelloWorldImpl.java deleted file mode 100755 index 85fd25f..0000000 --- a/examples/cxf/cxf-jaxws-blueprint/src/main/java/org/apache/servicemix/examples/cxf/HelloWorldImpl.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 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: service -package org.apache.servicemix.examples.cxf; - -import javax.jws.WebService; - -@WebService(endpointInterface = "org.apache.servicemix.examples.cxf.HelloWorld") -public class HelloWorldImpl implements HelloWorld { - - public String sayHi(String text) { - return "Hello " + text; - } -} -// END SNIPPET: service http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-jaxws-blueprint/src/main/java/org/apache/servicemix/samples/cxf_osgi/Client.java ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-jaxws-blueprint/src/main/java/org/apache/servicemix/samples/cxf_osgi/Client.java b/examples/cxf/cxf-jaxws-blueprint/src/main/java/org/apache/servicemix/samples/cxf_osgi/Client.java deleted file mode 100755 index ac2b1dd..0000000 --- a/examples/cxf/cxf-jaxws-blueprint/src/main/java/org/apache/servicemix/samples/cxf_osgi/Client.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.samples.cxf_osgi; - -import java.io.InputStream; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLConnection; - -import org.apache.cxf.helpers.IOUtils; - -public class Client{ - public static void main(String[] args) { - try { - new Client().sendRequest(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void sendRequest() throws Exception { - URLConnection connection = new URL("http://localhost:8181/cxf/HelloWorld") - .openConnection(); - connection.setDoInput(true); - connection.setDoOutput(true); - OutputStream os = connection.getOutputStream(); - // Post the request file. - InputStream fis = getClass().getClassLoader().getResourceAsStream("org/apache/servicemix/samples/cxf_osgi/request.xml"); - IOUtils.copy(fis, os); - // Read the response. - InputStream is = connection.getInputStream(); - System.out.println("the response is ====> "); - System.out.println(IOUtils.toString(is)); - - } - -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-jaxws-blueprint/src/main/resources/OSGI-INF/blueprint/blueprint.xml ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-jaxws-blueprint/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/examples/cxf/cxf-jaxws-blueprint/src/main/resources/OSGI-INF/blueprint/blueprint.xml deleted file mode 100755 index 254f72d..0000000 --- a/examples/cxf/cxf-jaxws-blueprint/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?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 --> -<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws" - xmlns:cxf="http://cxf.apache.org/blueprint/core" - xsi:schemaLocation=" -http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd -http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd -http://cxf.apache.org/blueprint/jaxws http://cxf.apache.org/schemas/blueprint/jaxws.xsd"> - - <cxf:bus> - <cxf:features> - <cxf:logging/> - </cxf:features> - </cxf:bus> - <jaxws:endpoint id="helloWorld" - implementor="org.apache.servicemix.examples.cxf.HelloWorldImpl" - address="/HelloWorld"> - <jaxws:outInterceptors> - <bean class="org.apache.servicemix.examples.cxf.EnableCORSInterceptor"/> - </jaxws:outInterceptors> - </jaxws:endpoint> - -</blueprint> -<!-- END SNIPPET: beans --> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-jaxws-blueprint/src/main/resources/org/apache/servicemix/samples/cxf_osgi/request.xml ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-jaxws-blueprint/src/main/resources/org/apache/servicemix/samples/cxf_osgi/request.xml b/examples/cxf/cxf-jaxws-blueprint/src/main/resources/org/apache/servicemix/samples/cxf_osgi/request.xml deleted file mode 100755 index 3381802..0000000 --- a/examples/cxf/cxf-jaxws-blueprint/src/main/resources/org/apache/servicemix/samples/cxf_osgi/request.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> - <soap:Body> - <ns2:sayHi xmlns:ns2="http://cxf.examples.servicemix.apache.org/"> - <arg0>John Doe</arg0> - </ns2:sayHi> - </soap:Body> -</soap:Envelope> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-osgi/README.txt ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-osgi/README.txt b/examples/cxf/cxf-osgi/README.txt deleted file mode 100644 index c7ddc46..0000000 --- a/examples/cxf/cxf-osgi/README.txt +++ /dev/null @@ -1,243 +0,0 @@ -/* - * 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. - */ - -CXF OSGi HTTP WEB SERVICE -========================= - -Purpose -------- -Create a web service with CXF and expose it through the OSGi HTTP -Service. - - -Explanation ------------ -The web service is a simple JAX-WS web service called HelloWorld. The -interface and the implementation are located in the src/main/java/org/ -apache/servicemix/examples/cxf directory of this example. - -The beans.xml file, located in the src/main/resources/META-INF/spring -directory: - -1. Imports the configuration files needed to enable CXF and OSGi work - together. - -2. Configures the web service endpoint as follows: - - <jaxws:endpoint id="helloWorld" - implementor="org.apache.servicemix.examples.cxf.HelloWorldImpl" - address="/HelloWorld"/> - - -Prerequisites for Running the Example -------------------------------------- -1. You must have the following installed on your machine: - - - JDK 1.6 or higher - - - Maven 2.2.1 or higher - - For more information, see the README in the top-level examples - directory. - - -2. Start ServiceMix by running the following command: - - <servicemix_home>/bin/servicemix (on UNIX) - <servicemix_home>\bin\servicemix (on Windows) - - -Running the Example -------------------- -You can run the example in two ways: - -- A. Using a Prebuilt Deployment Bundle: Quick and Easy -This option is useful if you want to see the example up and -running as quickly as possible. - -- B. Building the Example Bundle Yourself -This option is useful if you want to change the example in any -way. It tells you how to build and deploy the example. This -option might be slower than option A because, if you do not -already have the required bundles in your local Maven -repository, Maven will have to download the bundles it needs. - -A. Using a Prebuilt Deployment Bundle: Quick and Easy ------------------------------------------------------ -To install and run a prebuilt version of this example, enter -the following command in the ServiceMix console: - - features:install examples-cxf-osgi - -This command makes use of the ServiceMix features facility. For -more information about the features facility, see the README.txt -file in the examples parent directory. - -To view the service WSDL, open your browser and go to the following -URL: - - http://localhost:8181/cxf/HelloWorld?wsdl - -Note, if you use Safari, right click the window and select -'Show Source'. - -Running a Client ----------------- -To run the web client: - -1. Open the client.html, which is located in the same directory as - this README file, in your favorite browser. - -2. Click the Send button to send a request. - - Once the request has been successfully sent, a response similar - to the following should appear in the right-hand panel of the - web page: - - STATUS: 200 - <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> - <soap:Body><ns2:sayHiResponse xmlns:ns2="http://cxf.examples. - servicemix.apache.org/"><return>Hello John Doe</return> - </ns2:sayHiResponse> - </soap:Body> - </soap:Envelope> - -To run the java code client: - -1. Change to the <servicemix_home>/examples/cxf/cxf-osgi - directory. - -2. Run the following command: - - mvn compile exec:java - - If the client request is successful, a response similar to the - following should appear in the ServiceMix console: - - <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> - <soap:Body><ns2:sayHiResponse xmlns:ns2="http://cxf.examples. - servicemix.apache.org/"><return>Hello John Doe</return> - </ns2:sayHiResponse> - </soap:Body> - </soap:Envelope> - - -Changing /cxf servlet alias ---------------------------- -By default CXF Servlet is assigned a '/cxf' alias. You can -change it in a couple of ways - -a. Add org.apache.cxf.osgi.cfg to the /etc directory and set - the 'org.apache.cxf.servlet.context' property, for example: - - org.apache.cxf.servlet.context=/custom - -b. Use shell config commands, for example : - - config:edit org.apache.cxf.osgi - config:propset org.apache.cxf.servlet.context /super - config:update - - -B. Building the Example Bundle Yourself ---------------------------------------- -To install and run the example where you build the example bundle -yourself, complete the following steps: - -1. If you have already run the example using the prebuilt version as - described above, you must first uninstall the examples-cxf-osgi - feature by entering the following command in the ServiceMix console: - - features:uninstall examples-cxf-osgi - - -2. Build the example by opening a command prompt, changing directory to - examples/cxf-osgi (this example) and entering the following Maven - command: - - mvn install - - If all of the required OSGi bundles are available in your local - Maven repository, the example will build very quickly. Otherwise - it may take some time for Maven to download everything it needs. - - The mvn install command builds the example deployment bundle and - copies it to your local Maven repository and to the target directory - of this example. - -3. Install the example by entering the following command in - the ServiceMix console: - - features:install examples-cxf-osgi - - It makes use of the ServiceMix features facility. For more - information about the features facility, see the README.txt file - in the examples parent directory. - -To view the service WSDL, open your browser and go to the following -URL: - - http://localhost:8181/cxf/HelloWorld?wsdl - -Note, if you use Safari, right click the window and select -'Show Source'. - -You can try running a client against your service by following the -instructions in the "Running a Client" section above. - - -Stopping and Uninstalling the Example -------------------------------------- -To stop the example, you must first know the bundle ID that ServiceMix -has assigned to it. To get the bundle ID, enter the following command -at the ServiceMix console: - - osgi:list - -At the end of the listing, you should see an entry similar to the -following: - - [170] [Active ] [Started] [ 60] Apache ServiceMix Example :: CXF OSGi (4.2.0.0) - -In this case, the bundle ID is 170. - -To stop the example, enter the following command at the ServiceMix -console: - - osgi:stop <bundle_id> - -For example: - - osgi:stop 170 - -To uninstall the example, enter one of the following commands in -the ServiceMix console: - - features:uninstall examples-cxf-osgi - -or - - osgi:uninstall <bundle_id> - - -Viewing the Log Entries ------------------------ -You can view the entries in the log file in the data/log -directory of your ServiceMix installation, or by typing -the following command in the ServiceMix console: - - log:display http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-osgi/client.html ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-osgi/client.html b/examples/cxf/cxf-osgi/client.html deleted file mode 100644 index 1b8e145..0000000 --- a/examples/cxf/cxf-osgi/client.html +++ /dev/null @@ -1,136 +0,0 @@ -<!-- - - 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. - ---> -<html> -<head> -<title>ServiceMix 4 CXF-OSGi Example</title> -<script type="text/javascript"> -var urlToOpen = "http://localhost:8181/cxf/HelloWorld"; //default URL to open - -function getHTTPObject() { - var xmlhttp = false; - - /* Compilation conditionnelle d'IE */ - /* Check if we are using IE */ - /*@cc_on - @if (@_jscript_version >= 5) - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @else - xmlhttp = false; - @end @*/ - - /* on essaie de cr�er l'objet si ce n'est pas d�j� fait */ - /* Create the xmlhttp object if it is not yet defined */ - if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { - try { - xmlhttp = new XMLHttpRequest(); - } catch (e) { - xmlhttp = false; - } - } - - if (xmlhttp) { - /* on d�finit ce qui doit se passer quand la page r�pondra */ - /* Define the callback function for the response */ - xmlhttp.onreadystatechange=function() { - if (xmlhttp.readyState == 4) { /* 4 : �tat "complete" */ - var response = document.getElementById("response"); - var responseStatus = ""; - try { - responseStatus = xmlhttp.status + ""; - } catch (e) { - responseStatus = "ERROR WHILE RETRIEVING STATUS; MAYBE UNABLE TO CONNECT."; - } - response.value = "STATUS: " + responseStatus + "\n" + xmlhttp.responseText; - } - } - } - return xmlhttp; -} - -function send() { - if ((document.getElementById("urlToOpen").value != urlToOpen) && (document.getElementById("urlToOpen").value != "")) { - // use user entry if it is not the empty string - urlToOpen = document.getElementById("urlToOpen").value; - } - var xmlhttp = getHTTPObject(); - if (!xmlhttp) { - alert('cound not create XMLHttpRequest object'); - return; - } - var request = document.getElementById("request"); - var response = document.getElementById("response"); - try { - netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead UniversalBrowserWrite"); - } catch (e) { - } - try { - xmlhttp.open("POST", urlToOpen, true); - } catch (e) { - alert('error opening'); - } - xmlhttp.send(request.value); -} - -</script> -</head> - -<body> - -<h1>ServiceMix 4 CXF-OSGi Example</h1> - -<p>Welcome to the CXF-OSGi example for ServiceMix 4</p> - -<p>Perform a POST into the HTTP binding. This requires JavaScript.</p> -<p>Target: <input type="text" size="50" id="urlToOpen" value=""><script type="text/javascript">document.getElementById("urlToOpen").value = urlToOpen;</script>.</p> - -<table> - <tr> - <td> - <textarea id="request" style="width:600px;height:400px"><?xml version="1.0" encoding="UTF-8"?> -<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> - <soap:Body> - <ns2:sayHi xmlns:ns2="http://cxf.examples.servicemix.apache.org/"> - <arg0>John Doe</arg0> - </ns2:sayHi> - </soap:Body> -</soap:Envelope> - - </textarea> - </td> - <td> - <textarea id="response" style="width:600px;height:400px"> - </textarea> - </td> - </tr> - <tr> - <td colspan=2> - <input type="button" value="Send" onClick="send();"/> - </td> - </tr> -</table> -</body> -</html> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-osgi/pom.xml ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-osgi/pom.xml b/examples/cxf/cxf-osgi/pom.xml deleted file mode 100644 index 47e60ab..0000000 --- a/examples/cxf/cxf-osgi/pom.xml +++ /dev/null @@ -1,90 +0,0 @@ -<?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/xsd/maven-4.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>cxf</artifactId> - <version>4.6.0-SNAPSHOT</version> - </parent> - - <artifactId>cxf-osgi</artifactId> - <packaging>bundle</packaging> - <name>Apache ServiceMix :: Features :: Examples :: CXF OSGi</name> - <description>CXF example using OSGi instead of JBI</description> - - <dependencies> - <dependency> - <groupId>org.apache.geronimo.specs</groupId> - <artifactId>geronimo-ws-metadata_2.0_spec</artifactId> - </dependency> - <dependency> - <groupId>org.apache.servicemix</groupId> - <artifactId>servicemix-utils</artifactId> - </dependency> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-rt-transports-http</artifactId> - <version>${cxf.version}</version> - </dependency> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-rt-ws-security</artifactId> - <version>${cxf.version}</version> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <configuration> - <instructions> - <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> - <Bundle-Description>${project.description}</Bundle-Description> - <Import-Package> - javax.jws, - javax.wsdl, - javax.xml.namespace, - org.apache.servicemix.util, - org.springframework.beans.factory.config, - * - </Import-Package> - <Export-Package> - org.apache.servicemix.examples.cxf - </Export-Package> - </instructions> - </configuration> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <configuration> - <mainClass>org.apache.servicemix.samples.cxf_osgi.Client</mainClass> - <includePluginDependencies>false</includePluginDependencies> - </configuration> - </plugin> - </plugins> - </build> - -</project> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-osgi/src/main/java/org/apache/servicemix/examples/cxf/EnableCORSInterceptor.java ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-osgi/src/main/java/org/apache/servicemix/examples/cxf/EnableCORSInterceptor.java b/examples/cxf/cxf-osgi/src/main/java/org/apache/servicemix/examples/cxf/EnableCORSInterceptor.java deleted file mode 100644 index 9cf28b1..0000000 --- a/examples/cxf/cxf-osgi/src/main/java/org/apache/servicemix/examples/cxf/EnableCORSInterceptor.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * 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; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -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.transport.http.Headers; - -public class EnableCORSInterceptor extends AbstractPhaseInterceptor<Message> { - - public EnableCORSInterceptor() { - super(Phase.PRE_PROTOCOL); - } - - @Override - public void handleMessage(Message message) throws Fault { - Map<String, List<String>> headers = Headers.getSetProtocolHeaders(message); - try { - //Access-Control-Allow-Origin:* Access-Control-Allow-Methods:POST,GET - headers.put("Access-Control-Allow-Origin", Arrays.asList("*")); - headers.put("Access-Control-Allow-Methods", Arrays.asList("POST", "GET")); - } catch (Exception ce) { - throw new Fault(ce); - } - } -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-osgi/src/main/java/org/apache/servicemix/examples/cxf/HelloWorld.java ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-osgi/src/main/java/org/apache/servicemix/examples/cxf/HelloWorld.java b/examples/cxf/cxf-osgi/src/main/java/org/apache/servicemix/examples/cxf/HelloWorld.java deleted file mode 100644 index 14dad3a..0000000 --- a/examples/cxf/cxf-osgi/src/main/java/org/apache/servicemix/examples/cxf/HelloWorld.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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: service -package org.apache.servicemix.examples.cxf; - -import javax.jws.WebService; - -@WebService -public interface HelloWorld { - String sayHi(String text); -} -// END SNIPPET: service http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-osgi/src/main/java/org/apache/servicemix/examples/cxf/HelloWorldImpl.java ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-osgi/src/main/java/org/apache/servicemix/examples/cxf/HelloWorldImpl.java b/examples/cxf/cxf-osgi/src/main/java/org/apache/servicemix/examples/cxf/HelloWorldImpl.java deleted file mode 100644 index 85fd25f..0000000 --- a/examples/cxf/cxf-osgi/src/main/java/org/apache/servicemix/examples/cxf/HelloWorldImpl.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 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: service -package org.apache.servicemix.examples.cxf; - -import javax.jws.WebService; - -@WebService(endpointInterface = "org.apache.servicemix.examples.cxf.HelloWorld") -public class HelloWorldImpl implements HelloWorld { - - public String sayHi(String text) { - return "Hello " + text; - } -} -// END SNIPPET: service http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-osgi/src/main/java/org/apache/servicemix/samples/cxf_osgi/Client.java ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-osgi/src/main/java/org/apache/servicemix/samples/cxf_osgi/Client.java b/examples/cxf/cxf-osgi/src/main/java/org/apache/servicemix/samples/cxf_osgi/Client.java deleted file mode 100644 index d875c2b..0000000 --- a/examples/cxf/cxf-osgi/src/main/java/org/apache/servicemix/samples/cxf_osgi/Client.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.samples.cxf_osgi; - -import java.io.ByteArrayOutputStream; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLConnection; - -import org.apache.servicemix.util.FileUtil; - -public class Client{ - public static void main(String[] args) { - try { - new Client().sendRequest(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void sendRequest() throws Exception { - URLConnection connection = new URL("http://localhost:8181/cxf/HelloWorld") - .openConnection(); - connection.setDoInput(true); - connection.setDoOutput(true); - OutputStream os = connection.getOutputStream(); - // Post the request file. - InputStream fis = getClass().getClassLoader().getResourceAsStream("org/apache/servicemix/samples/cxf_osgi/request.xml"); - FileUtil.copyInputStream(fis, os); - // Read the response. - InputStream is = connection.getInputStream(); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - FileUtil.copyInputStream(is, baos); - System.out.println("the response is =====>"); - System.out.println(baos.toString()); - } - -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-osgi/src/main/resources/META-INF/spring/beans.xml ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-osgi/src/main/resources/META-INF/spring/beans.xml b/examples/cxf/cxf-osgi/src/main/resources/META-INF/spring/beans.xml deleted file mode 100644 index ddd6b0b..0000000 --- a/examples/cxf/cxf-osgi/src/main/resources/META-INF/spring/beans.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?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" - xsi:schemaLocation=" -http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd -http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> - - - <jaxws:endpoint id="helloWorld" - implementor="org.apache.servicemix.examples.cxf.HelloWorldImpl" - address="/HelloWorld"> - <jaxws:outInterceptors> - <bean class="org.apache.servicemix.examples.cxf.EnableCORSInterceptor"/> - </jaxws:outInterceptors> - </jaxws:endpoint> - -</beans> -<!-- END SNIPPET: beans --> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/cxf/cxf-osgi/src/main/resources/org/apache/servicemix/samples/cxf_osgi/request.xml ---------------------------------------------------------------------- diff --git a/examples/cxf/cxf-osgi/src/main/resources/org/apache/servicemix/samples/cxf_osgi/request.xml b/examples/cxf/cxf-osgi/src/main/resources/org/apache/servicemix/samples/cxf_osgi/request.xml deleted file mode 100644 index 3381802..0000000 --- a/examples/cxf/cxf-osgi/src/main/resources/org/apache/servicemix/samples/cxf_osgi/request.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> - <soap:Body> - <ns2:sayHi xmlns:ns2="http://cxf.examples.servicemix.apache.org/"> - <arg0>John Doe</arg0> - </ns2:sayHi> - </soap:Body> -</soap:Envelope>
