| Commit in servicemix/base/src/main/release/examples on MAIN | |||
| http-binding/servicemix.xml | +30 | added 1.1 | |
| /request.xml | +3 | added 1.1 | |
| /README.txt | +19 | added 1.1 | |
| /HttpClient.java | +52 | added 1.1 | |
| /build.xml | +35 | added 1.1 | |
| file-binding/build.xml | -35 | 1.1 removed | |
| jms-binding/build.xml | +1 | -1 | 1.1 -> 1.2 |
| vfs-binding/build.xml | -35 | 1.1 removed | |
| +140 | -71 | ||
- minor cleanups - brought in the http server example.
servicemix/base/src/main/release/examples/http-binding
servicemix.xml added at 1.1
diff -N servicemix.xml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ servicemix.xml 1 Aug 2005 17:33:42 -0000 1.1 @@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?> +<beans xmlns:my="http://servicemix.org/demo/"> + <!-- the JBI container --> + <container id="jbi"> + <property name="createMBeanServer" value="true"/> + <property name="dumpStats" value="true"/> + <property name="statsInterval" value="10"/> + + <components> + + <!-- Create a http server binding on port 8912 and have it forward to the foo:stockQuote --> + <component id="httpReceiver" service="foo:httpBinding" endpoint="httpReceiver" class="org.servicemix.components.http.HttpConnector" destinationService="foo:stockQuote"> + <property name="host" value="localhost"/> + <property name="port" value="8912"/> + </component> + + <!-- This just invokes another service --> + <component id="stockQuote" service="foo:stockQuote" endpoint="stockQuote" class="org.servicemix.components.saaj.SaajBinding"> + <property name="soapEndpoint"> + <bean class="javax.xml.messaging.URLEndpoint"> + <constructor-arg value="http://64.124.140.30/soap"/> + </bean> + </property> + </component> + + </components> + + </container> + +</beans>
servicemix/base/src/main/release/examples/http-binding
request.xml added at 1.1
diff -N request.xml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ request.xml 1 Aug 2005 17:33:42 -0000 1.1 @@ -0,0 +1,3 @@
+<ns1:getQuote xmlns:ns1="urn:xmethods-delayed-quotes" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:se="http://schemas.xmlsoap.org/soap/envelope/" se:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> + <symbol xsi:type="xsd:string">IBM</symbol> +</ns1:getQuote>
servicemix/base/src/main/release/examples/http-binding
README.txt added at 1.1
diff -N README.txt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ README.txt 1 Aug 2005 17:33:42 -0000 1.1 @@ -0,0 +1,19 @@
+Welcome to the ServiceMix HTTP Server Binding Example +===================================================== + +This example shows how to use the HTTP bindings to handle a simple http +post. + +To start the servicemix server using the sample configuration, just run: + +../../bin/servicemix servicemix.xml + +This will start http server on port 8912 and wait for a request to come in +which It then forwards to http://64.124.140.30/soap for processing. + +A simple JMS client is provided so that a simple ost gan be set to the server. +The client is built and run from source using Ant, http://ant.apache.org. +Just execute 'ant' from the current directory to run the HTTP client. + +For more information see: +http://servicemix.org/HTTP
\ No newline at end of file
servicemix/base/src/main/release/examples/http-binding
HttpClient.java added at 1.1
diff -N HttpClient.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ HttpClient.java 1 Aug 2005 17:33:42 -0000 1.1 @@ -0,0 +1,52 @@
+/**
+ *
+ * Copyright 2005 LogicBlaze, Inc. http://www.logicblaze.com
+ *
+ * Licensed 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.
+ *
+ **/
+
+import java.io.*;
+import java.net.URL;
+import java.net.URLConnection;
+
+/**
+ * @version $Revision$
+ */
+public class HttpClient {
+
+ public static void main(String[] args) throws Exception {
+
+ URLConnection connection = new URL("http://localhost:8912").openConnection();
+ connection.setDoOutput(true);
+ OutputStream os = connection.getOutputStream();
+
+ // Post the request file.
+ FileInputStream fis = new FileInputStream("request.xml");
+ int c;
+ while ((c = fis.read()) >= 0) {
+ os.write(c);
+ }
+ os.close();
+ fis.close();
+
+ // Read the response.
+ BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+ String inputLine;
+ while ((inputLine = in.readLine()) != null) {
+ System.out.println(inputLine);
+ }
+ in.close();
+
+ }
+}
servicemix/base/src/main/release/examples/http-binding
build.xml added at 1.1
diff -N build.xml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ build.xml 1 Aug 2005 17:33:42 -0000 1.1 @@ -0,0 +1,35 @@
+<project name="jms-binding" default="run" basedir=".">
+
+ <property name="class.dir" value="classes"/>
+
+ <target name="clean">
+ <delete dir="target" quiet="true"/>
+ <delete dir="${class.dir}" quiet="true"/>
+ </target>
+
+ <target name="init">
+ <mkdir dir="${class.dir}"/>
+ <mkdir dir="src/ddl"/>
+
+ <path id="javac.classpath">
+ <pathelement path="${class.dir}"/>
+ <fileset dir="../../lib">
+ <include name="**/*.jar"/>
+ </fileset>
+ </path>
+ </target>
+
+ <target name="compile" depends="init" description="Compile all Java">
+ <javac srcdir="." destdir="${class.dir}">
+ <classpath refid="javac.classpath"/>
+ </javac>
+ </target>
+
+ <target name="run" depends="compile" description="Runs the example client">
+ <echo>Running example client</echo>
+ <java classname="HttpClient" fork="yes" maxmemory="100M">
+ <classpath refid="javac.classpath"/>
+ </java>
+ </target>
+
+</project>
servicemix/base/src/main/release/examples/file-binding
build.xml removed after 1.1
diff -N build.xml --- build.xml 29 Jul 2005 07:59:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,35 +0,0 @@
-<project name="jms-binding" default="run" basedir=".">
-
- <property name="class.dir" value="classes"/>
-
- <target name="clean">
- <delete dir="target" quiet="true"/>
- <delete dir="${class.dir}" quiet="true"/>
- </target>
-
- <target name="init">
- <mkdir dir="${class.dir}"/>
- <mkdir dir="src/ddl"/>
-
- <path id="javac.classpath">
- <pathelement path="${class.dir}"/>
- <fileset dir="../../lib">
- <include name="**/*.jar"/>
- </fileset>
- </path>
- </target>
-
- <target name="compile" depends="init" description="Compile all Java">
- <javac srcdir="." destdir="${class.dir}">
- <classpath refid="javac.classpath"/>
- </javac>
- </target>
-
- <target name="run" depends="compile" description="Runs the example client">
- <echo>Running exsample client</echo>
- <java classname="JMSClient" fork="yes" maxmemory="100M">
- <classpath refid="javac.classpath"/>
- </java>
- </target>
-
-</project>
servicemix/base/src/main/release/examples/jms-binding
diff -u -r1.1 -r1.2 --- build.xml 28 Jul 2005 23:44:49 -0000 1.1 +++ build.xml 1 Aug 2005 17:33:43 -0000 1.2 @@ -26,7 +26,7 @@
</target> <target name="run" depends="compile" description="Runs the example client">
- <echo>Running exsample client</echo>
+ <echo>Running example client</echo>
<java classname="JMSClient" fork="yes" maxmemory="100M">
<classpath refid="javac.classpath"/>
</java>
servicemix/base/src/main/release/examples/vfs-binding
build.xml removed after 1.1
diff -N build.xml --- build.xml 28 Jul 2005 23:44:49 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,35 +0,0 @@
-<project name="jms-binding" default="run" basedir=".">
-
- <property name="class.dir" value="classes"/>
-
- <target name="clean">
- <delete dir="target" quiet="true"/>
- <delete dir="${class.dir}" quiet="true"/>
- </target>
-
- <target name="init">
- <mkdir dir="${class.dir}"/>
- <mkdir dir="src/ddl"/>
-
- <path id="javac.classpath">
- <pathelement path="${class.dir}"/>
- <fileset dir="../../lib">
- <include name="**/*.jar"/>
- </fileset>
- </path>
- </target>
-
- <target name="compile" depends="init" description="Compile all Java">
- <javac srcdir="." destdir="${class.dir}">
- <classpath refid="javac.classpath"/>
- </javac>
- </target>
-
- <target name="run" depends="compile" description="Runs the example client">
- <echo>Running exsample client</echo>
- <java classname="JMSClient" fork="yes" maxmemory="100M">
- <classpath refid="javac.classpath"/>
- </java>
- </target>
-
-</project>
