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/09/24 12:09:13 UTC
svn commit: r698502 - in /servicemix/smx4/features/trunk/examples: bridge/
bridge/client/ bridge/client/src/ bridge/client/src/main/
bridge/client/src/main/java/ bridge/client/src/main/java/org/
bridge/client/src/main/java/org/apache/ bridge/client/src...
Author: ffang
Date: Wed Sep 24 03:09:12 2008
New Revision: 698502
URL: http://svn.apache.org/viewvc?rev=698502&view=rev
Log:
[SMX4-113/SMX4-114/SMX4-115]Provide java based client to bridge/cxf-wsdl-first/cxf-osgi example
Added:
servicemix/smx4/features/trunk/examples/bridge/client/
servicemix/smx4/features/trunk/examples/bridge/client/pom.xml (with props)
servicemix/smx4/features/trunk/examples/bridge/client/src/
servicemix/smx4/features/trunk/examples/bridge/client/src/main/
servicemix/smx4/features/trunk/examples/bridge/client/src/main/java/
servicemix/smx4/features/trunk/examples/bridge/client/src/main/java/org/
servicemix/smx4/features/trunk/examples/bridge/client/src/main/java/org/apache/
servicemix/smx4/features/trunk/examples/bridge/client/src/main/java/org/apache/servicemix/
servicemix/smx4/features/trunk/examples/bridge/client/src/main/java/org/apache/servicemix/samples/
servicemix/smx4/features/trunk/examples/bridge/client/src/main/java/org/apache/servicemix/samples/bridge/
servicemix/smx4/features/trunk/examples/bridge/client/src/main/java/org/apache/servicemix/samples/bridge/Client.java (with props)
servicemix/smx4/features/trunk/examples/bridge/client/src/main/resources/
servicemix/smx4/features/trunk/examples/bridge/client/src/main/resources/org/
servicemix/smx4/features/trunk/examples/bridge/client/src/main/resources/org/apache/
servicemix/smx4/features/trunk/examples/bridge/client/src/main/resources/org/apache/servicemix/
servicemix/smx4/features/trunk/examples/bridge/client/src/main/resources/org/apache/servicemix/samples/
servicemix/smx4/features/trunk/examples/bridge/client/src/main/resources/org/apache/servicemix/samples/bridge/
servicemix/smx4/features/trunk/examples/bridge/client/src/main/resources/org/apache/servicemix/samples/bridge/request.xml (with props)
servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/java/org/apache/servicemix/samples/
servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/java/org/apache/servicemix/samples/cxf_osgi/
servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/java/org/apache/servicemix/samples/cxf_osgi/Client.java (with props)
servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/resources/org/
servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/resources/org/apache/
servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/resources/org/apache/servicemix/
servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/resources/org/apache/servicemix/samples/
servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/resources/org/apache/servicemix/samples/cxf_osgi/
servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/resources/org/apache/servicemix/samples/cxf_osgi/request.xml (with props)
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/pom.xml (with props)
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/java/
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/java/org/
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/java/org/apache/
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/java/org/apache/servicemix/
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/java/org/apache/servicemix/samples/
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/java/org/apache/servicemix/samples/wsdl_first/
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/java/org/apache/servicemix/samples/wsdl_first/Client.java (with props)
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/resources/
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/resources/org/
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/resources/org/apache/
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/resources/org/apache/servicemix/
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/resources/org/apache/servicemix/samples/
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/resources/org/apache/servicemix/samples/wsdl_first/
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/resources/org/apache/servicemix/samples/wsdl_first/request.xml (with props)
Modified:
servicemix/smx4/features/trunk/examples/bridge/README.txt
servicemix/smx4/features/trunk/examples/bridge/pom.xml
servicemix/smx4/features/trunk/examples/cxf-osgi/README.txt
servicemix/smx4/features/trunk/examples/cxf-osgi/pom.xml
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/README.txt
servicemix/smx4/features/trunk/examples/cxf-wsdl-first/pom.xml
Modified: servicemix/smx4/features/trunk/examples/bridge/README.txt
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/bridge/README.txt?rev=698502&r1=698501&r2=698502&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/examples/bridge/README.txt (original)
+++ servicemix/smx4/features/trunk/examples/bridge/README.txt Wed Sep 24 03:09:12 2008
@@ -38,6 +38,8 @@
and send an HTTP request which will be transformed in a JMS
message. After the JMS message has been sent to the bridge.output queue successfully,
you will receive an HTTP STATUS 202 response code from the ESB.
+Or you can launch java code client to send the request
+cd client; mvn compile exec:java
For more information on running this example please see:
http://servicemix.apache.org/bridge.html
Added: servicemix/smx4/features/trunk/examples/bridge/client/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/bridge/client/pom.xml?rev=698502&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/bridge/client/pom.xml (added)
+++ servicemix/smx4/features/trunk/examples/bridge/client/pom.xml Wed Sep 24 03:09:12 2008
@@ -0,0 +1,61 @@
+<?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>bridge</artifactId>
+ <version>4.0-m2-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.servicemix.examples.bridge</groupId>
+ <artifactId>bridge-client</artifactId>
+ <name>ServiceMix :: Samples :: Bridge :: Client</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-utils</artifactId>
+ <version>${servicemix-utils.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <configuration>
+ <mainClass>org.apache.servicemix.samples.bridge.Client</mainClass>
+ <includePluginDependencies>false</includePluginDependencies>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: servicemix/smx4/features/trunk/examples/bridge/client/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/features/trunk/examples/bridge/client/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: servicemix/smx4/features/trunk/examples/bridge/client/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: servicemix/smx4/features/trunk/examples/bridge/client/src/main/java/org/apache/servicemix/samples/bridge/Client.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/bridge/client/src/main/java/org/apache/servicemix/samples/bridge/Client.java?rev=698502&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/bridge/client/src/main/java/org/apache/servicemix/samples/bridge/Client.java (added)
+++ servicemix/smx4/features/trunk/examples/bridge/client/src/main/java/org/apache/servicemix/samples/bridge/Client.java Wed Sep 24 03:09:12 2008
@@ -0,0 +1,60 @@
+/*
+ * 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.bridge;
+
+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:8192/bridge/")
+ .openConnection();
+ connection.setDoInput(true);
+ connection.setDoOutput(true);
+ OutputStream os = connection.getOutputStream();
+ // Post the request file.
+ InputStream fis = getClass().getClassLoader().getResourceAsStream("org/apache/servicemix/samples/bridge/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());
+ if (connection instanceof HttpURLConnection) {
+ int retCode = ((HttpURLConnection)connection).getResponseCode();
+ System.out.println("the response code is =====>");//expected is 202 for this example
+ System.out.println(retCode);
+ }
+
+ }
+
+}
Propchange: servicemix/smx4/features/trunk/examples/bridge/client/src/main/java/org/apache/servicemix/samples/bridge/Client.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/features/trunk/examples/bridge/client/src/main/java/org/apache/servicemix/samples/bridge/Client.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/features/trunk/examples/bridge/client/src/main/resources/org/apache/servicemix/samples/bridge/request.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/bridge/client/src/main/resources/org/apache/servicemix/samples/bridge/request.xml?rev=698502&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/bridge/client/src/main/resources/org/apache/servicemix/samples/bridge/request.xml (added)
+++ servicemix/smx4/features/trunk/examples/bridge/client/src/main/resources/org/apache/servicemix/samples/bridge/request.xml Wed Sep 24 03:09:12 2008
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<e:Envelope xmlns:e="http://schemas.xmlsoap.org/soap/envelope/">
+ <e:Body>
+ <ping>
+ <pingRequest>
+ <message xmlns="http://soap">hel lo</message>
+ </pingRequest>
+ </ping>
+ </e:Body>
+</e:Envelope>
Propchange: servicemix/smx4/features/trunk/examples/bridge/client/src/main/resources/org/apache/servicemix/samples/bridge/request.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/features/trunk/examples/bridge/client/src/main/resources/org/apache/servicemix/samples/bridge/request.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: servicemix/smx4/features/trunk/examples/bridge/client/src/main/resources/org/apache/servicemix/samples/bridge/request.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: servicemix/smx4/features/trunk/examples/bridge/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/bridge/pom.xml?rev=698502&r1=698501&r2=698502&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/examples/bridge/pom.xml (original)
+++ servicemix/smx4/features/trunk/examples/bridge/pom.xml Wed Sep 24 03:09:12 2008
@@ -38,6 +38,7 @@
<module>bridge-xslt-su</module>
<module>bridge-jms-su</module>
<module>bridge-sa</module>
+ <module>client</module>
</modules>
<!-- Add ServiceMix repositories for snaphots and releases -->
Modified: servicemix/smx4/features/trunk/examples/cxf-osgi/README.txt
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/cxf-osgi/README.txt?rev=698502&r1=698501&r2=698502&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/examples/cxf-osgi/README.txt (original)
+++ servicemix/smx4/features/trunk/examples/cxf-osgi/README.txt Wed Sep 24 03:09:12 2008
@@ -58,6 +58,9 @@
You can also open the client.html page in a browser to try sending a request
to the service.
+Or you can launch java code client to send the request
+mvn compile exec:java
+
How does it work?
-----------------
Modified: servicemix/smx4/features/trunk/examples/cxf-osgi/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/cxf-osgi/pom.xml?rev=698502&r1=698501&r2=698502&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/examples/cxf-osgi/pom.xml (original)
+++ servicemix/smx4/features/trunk/examples/cxf-osgi/pom.xml Wed Sep 24 03:09:12 2008
@@ -39,6 +39,11 @@
<artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
<version>${geronimo.wsmetadata.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-utils</artifactId>
+ <version>${servicemix-utils.version}</version>
+ </dependency>
</dependencies>
<build>
@@ -70,6 +75,14 @@
</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>
Added: servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/java/org/apache/servicemix/samples/cxf_osgi/Client.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/java/org/apache/servicemix/samples/cxf_osgi/Client.java?rev=698502&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/java/org/apache/servicemix/samples/cxf_osgi/Client.java (added)
+++ servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/java/org/apache/servicemix/samples/cxf_osgi/Client.java Wed Sep 24 03:09:12 2008
@@ -0,0 +1,54 @@
+/*
+ * 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:8080/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());
+ }
+
+}
Propchange: servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/java/org/apache/servicemix/samples/cxf_osgi/Client.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/java/org/apache/servicemix/samples/cxf_osgi/Client.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/resources/org/apache/servicemix/samples/cxf_osgi/request.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/resources/org/apache/servicemix/samples/cxf_osgi/request.xml?rev=698502&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/resources/org/apache/servicemix/samples/cxf_osgi/request.xml (added)
+++ servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/resources/org/apache/servicemix/samples/cxf_osgi/request.xml Wed Sep 24 03:09:12 2008
@@ -0,0 +1,8 @@
+<?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>
Propchange: servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/resources/org/apache/servicemix/samples/cxf_osgi/request.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/resources/org/apache/servicemix/samples/cxf_osgi/request.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: servicemix/smx4/features/trunk/examples/cxf-osgi/src/main/resources/org/apache/servicemix/samples/cxf_osgi/request.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: servicemix/smx4/features/trunk/examples/cxf-wsdl-first/README.txt
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/cxf-wsdl-first/README.txt?rev=698502&r1=698501&r2=698502&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/examples/cxf-wsdl-first/README.txt (original)
+++ servicemix/smx4/features/trunk/examples/cxf-wsdl-first/README.txt Wed Sep 24 03:09:12 2008
@@ -39,4 +39,6 @@
You can also open the client.html page in a browser
to send a request to the service.
+Or you can launch a java client to send request
+cd client; mvn compile exec:java
Added: servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/pom.xml?rev=698502&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/pom.xml (added)
+++ servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/pom.xml Wed Sep 24 03:09:12 2008
@@ -0,0 +1,61 @@
+<?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>cxf-wsdl-first</artifactId>
+ <version>4.0-m2-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.servicemix.examples.cxf-wsdl-first</groupId>
+ <artifactId>wsdl-first-client</artifactId>
+ <name>ServiceMix :: Samples :: WSDL first :: Client</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-utils</artifactId>
+ <version>${servicemix-utils.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <configuration>
+ <mainClass>org.apache.servicemix.samples.wsdl_first.Client</mainClass>
+ <includePluginDependencies>false</includePluginDependencies>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/java/org/apache/servicemix/samples/wsdl_first/Client.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/java/org/apache/servicemix/samples/wsdl_first/Client.java?rev=698502&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/java/org/apache/servicemix/samples/wsdl_first/Client.java (added)
+++ servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/java/org/apache/servicemix/samples/wsdl_first/Client.java Wed Sep 24 03:09:12 2008
@@ -0,0 +1,53 @@
+/*
+ * 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.wsdl_first;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+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:8092/PersonService/")
+ .openConnection();
+ connection.setDoInput(true);
+ connection.setDoOutput(true);
+ OutputStream os = connection.getOutputStream();
+ // Post the request file.
+ InputStream fis = getClass().getClassLoader().getResourceAsStream("org/apache/servicemix/samples/wsdl_first/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());
+ }
+
+}
Propchange: servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/java/org/apache/servicemix/samples/wsdl_first/Client.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/java/org/apache/servicemix/samples/wsdl_first/Client.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/resources/org/apache/servicemix/samples/wsdl_first/request.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/resources/org/apache/servicemix/samples/wsdl_first/request.xml?rev=698502&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/resources/org/apache/servicemix/samples/wsdl_first/request.xml (added)
+++ servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/resources/org/apache/servicemix/samples/wsdl_first/request.xml Wed Sep 24 03:09:12 2008
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:tns="http://servicemix.apache.org/samples/wsdl-first/types">
+ <env:Body>
+ <tns:GetPerson>
+ <tns:personId>world</tns:personId>
+ </tns:GetPerson>
+ </env:Body>
+</env:Envelope>
Propchange: servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/resources/org/apache/servicemix/samples/wsdl_first/request.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/resources/org/apache/servicemix/samples/wsdl_first/request.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: servicemix/smx4/features/trunk/examples/cxf-wsdl-first/client/src/main/resources/org/apache/servicemix/samples/wsdl_first/request.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: servicemix/smx4/features/trunk/examples/cxf-wsdl-first/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/cxf-wsdl-first/pom.xml?rev=698502&r1=698501&r2=698502&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/examples/cxf-wsdl-first/pom.xml (original)
+++ servicemix/smx4/features/trunk/examples/cxf-wsdl-first/pom.xml Wed Sep 24 03:09:12 2008
@@ -86,6 +86,7 @@
<module>wsdl-first-cxfse-su</module>
<module>wsdl-first-cxfbc-su</module>
<module>wsdl-first-cxf-sa</module>
+ <module>client</module>
</modules>
<build>