You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by jl...@apache.org on 2006/11/20 12:13:48 UTC
svn commit: r477144 - in
/incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca:
common/ hello_world_soap_http/ hello_world_soap_http/src/demo/client/
hello_world_soap_http/src/demo/servlet/ inbound/
Author: jliu
Date: Mon Nov 20 03:13:42 2006
New Revision: 477144
URL: http://svn.apache.org/viewvc?view=rev&rev=477144
Log:
apply patch cxf-256 on behalf of Unreal Jiang
Modified:
incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/common/build.xml
incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/README.txt
incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/build.xml
incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/src/demo/client/Client.java
incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/src/demo/servlet/HelloWorldServlet.java
incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/inbound/README.txt
incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/inbound/build.xml
Modified: incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/common/build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/common/build.xml?view=diff&rev=477144&r1=477143&r2=477144
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/common/build.xml (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/common/build.xml Mon Nov 20 03:13:42 2006
@@ -22,10 +22,12 @@
<property name="demos.current.dir" value="."/>
<property name="common.build.classes" value="${basedir}/build/classes"/>
<property name="common.build.src" value="${basedir}/src"/>
+ <property environment="env"/>
+ <property name="cxf.home" value="${env.CXF_HOME}"/>
<path id="build.classpath">
<path location="${common.build.classes}"/>
- <path location="${basedir}/../../../../lib/servlet-api-2.4.jar"/>
+ <path location="${cxf.home}/lib/servlet-api-2.4.jar"/>
</path>
<target name="init">
@@ -53,4 +55,4 @@
<delete file="${basedir}/common.jar"/>
</target>
- </project>
\ No newline at end of file
+ </project>
Modified: incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/README.txt
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/README.txt?view=diff&rev=477144&r1=477143&r2=477144
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/README.txt (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/README.txt Mon Nov 20 03:13:42 2006
@@ -14,6 +14,7 @@
. Update jboss endorsed jars
. Set Jboss environment
+ . Set CXF environment
. Build CXF J2EE Connector rar file
. Launch the application server
. Deploy the CXF J2EE Connector
@@ -26,14 +27,14 @@
==========================
(Unix) % cd $CXF_HOME/lib/
% cp activation-1.1.jar jaxb-api-2.0.jar jaxb-impl-2.0.3.jar
- jaxb-xjc-2.0.3.jar jsr173_api-1.0.jar
- jsr181-api-2.0-JAXWS-2.0-EA3.jar
+ jaxb-xjc-2.0.3.jar stax-api-1.0.1.jar
+ jsr181-api-1.0-MR1.jar
saaj-api-1.3.jar saaj-impl-1.3.jar
<jboss-home>/lib/endorsed\
(Windows) > cd %CXF_HOME%\lib\
> copy activation-1.1.jar jaxb-api-2.0.jar jaxb-impl-2.0.3.jar
- jaxb-xjc-2.0.3.jar jsr173_api-1.0.jar
- jsr181-api-2.0-JAXWS-2.0-EA3.jar
+ jaxb-xjc-2.0.3.jar stax-api-1.0.1.jar
+ jsr181-api-1.0-MR1.jar
saaj-api-1.3.jar saaj-impl-1.3.jar
<jboss-home>\lib\endorsed\
@@ -42,6 +43,12 @@
(Unix) % export JBOSS_HOME=<jboss-home>
(Windows) > set JBOSS_HOME=<jboss-home>
+Set CXF environment
+=====================
+ (Unix) % export CXF_HOME=<cxf-home>
+ (Windows) > set CXF_HOME=<cxf-home>
+
+
Build CXF J2EE Connector rar file
=================================
Before build CXF J2EE Connector, must update value of
@@ -120,7 +127,7 @@
Launch the Apache CXF Service
========================
-Run the Apache CXF service provided by the hello_world_soap_http
+Run the Apache CXF service provided by the hello_world
demo.
To launch the service:
Modified: incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/build.xml?view=diff&rev=477144&r1=477143&r2=477144
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/build.xml (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/build.xml Mon Nov 20 03:13:42 2006
@@ -22,13 +22,13 @@
<!-- overload some properties to customize this build -->
<property name="wsdl.dir" value="${basedir}/etc/wsdl"/>
- <property name="cxf.home" value="../../../.."/>
<property name="wsdl.location" value="${wsdl.dir}/hello_world.wsdl"/>
<property name="war.name" value="helloworld.war"/>
<property name="j2ee.resources.dir" location="${basedir}/../common/resources"/>
<property environment="env"/>
+ <property name="cxf.home" value="${env.CXF_HOME}"/>
<property name="jboss.home" value="${env.JBOSS_HOME}"/>
- <property file="${basedir}/../../../../etc/version.properties"/>
+ <property file="${cxf.home}/etc/version.properties"/>
<!--property name="thirdparty.classpath" value="${basedir}/../common/common.jar"/-->
<path id="thirdParth.classpath">
@@ -37,18 +37,18 @@
<path id="other.classpath">
- <pathelement location="${basedir}/../../../../lib/servlet-api-2.4.jar"/>
+ <pathelement location="${cxf.home}/lib/servlet-api-2.4.jar"/>
<pathelement location="${basedir}/../common/common.jar"/>
- <pathelement location="${basedir}/../../../../lib/cxf-integration-jca-${cxf.version}.jar"/>
+ <pathelement location="${cxf.home}/lib/cxf-integration-jca-${cxf.version}.jar"/>
<pathelement location="${jboss.home}/client/jboss-j2ee.jar"/>
</path>
- <import file="../../../common_build.xml"/>
+ <import file="${cxf.home}/samples/common_build.xml"/>
<target name="generate.rar" depends="init">
- <copy file="${basedir}/../../../../etc/ra.xml" todir="${build.classes.dir}/cxf-rar/META-INF"/>
+ <copy file="${cxf.home}/etc/ra.xml" todir="${build.classes.dir}/cxf-rar/META-INF"/>
<copy todir="${build.classes.dir}/cxf-rar">
- <fileset dir="${basedir}/../../../../lib">
+ <fileset dir="${cxf.home}/lib">
<include name="activation*.jar"/>
<include name="aopalliance*.jar"/>
<include name="cxf-api*.jar"/>
@@ -73,7 +73,7 @@
<include name="XmlSchema*.jar"/>
</fileset>
</copy>
- <jar destfile="${basedir}/../../../../lib/cxf.rar"
+ <jar destfile="${cxf.home}/lib/cxf.rar"
basedir="${build.classes.dir}/cxf-rar"/>
</target>
@@ -146,7 +146,7 @@
<target name="client" description="run demo client" depends="build">
<property name="param" value=""/>
- <cxfrun classname="demo.client.Client"/>
+ <cxfrun classname="demo.client.Client" param1="${op}"/>
</target>
<target name="clean">
Modified: incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/src/demo/client/Client.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/src/demo/client/Client.java?view=diff&rev=477144&r1=477143&r2=477144
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/src/demo/client/Client.java (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/src/demo/client/Client.java Mon Nov 20 03:13:42 2006
@@ -20,8 +20,10 @@
package demo.client;
import java.io.BufferedReader;
+import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
@@ -31,36 +33,71 @@
protected Client() {
}
+
public static void main(String[] args) throws Exception {
+ invokeServlet("sayHi", null);
+ invokeServlet("greetMe", "CXF");
+ }
+
+ public static void invokeServlet(String op, String user) throws Exception {
+ boolean isSayHi = true;
try {
- URL url = new URL("http://localhost:8080/helloworld/*.do?Operation=sayHi&User=abc");
+ if (!"sayHi".equals(op)) {
+ isSayHi = false;
+ }
+ URL url = new URL("http://localhost:8080/helloworld/*.do");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+ conn.setRequestMethod("POST");
conn.setDoOutput(true);
- conn.connect();
-
- BufferedReader in =
+
+ BufferedWriter out =
+ new BufferedWriter(new OutputStreamWriter(conn.getOutputStream()));
+
+ out.write("Operation=" + op);
+ if (!isSayHi) {
+ out.write("&User=" + user);
+ }
+ out.flush();
+ out.close();
+
+ BufferedReader in =
new BufferedReader(new InputStreamReader(conn.getInputStream()));
+
boolean correctReturn = false;
String response;
- while ((response = in.readLine()) != null) {
- if (response.contains("Bonjour")) {
- System.out.println(" server return: Bonjour");
- correctReturn = true;
- break;
+ if (isSayHi) {
+ while ((response = in.readLine()) != null) {
+
+ if (response.contains("Bonjour")) {
+ System.out.println(" sayHi server return: Bonjour");
+ correctReturn = true;
+ break;
+ }
+ }
+ } else {
+ while ((response = in.readLine()) != null) {
+ if (response.contains("Hello CXF")) {
+ System.out.println(" greetMe server return: Hello CXF");
+ correctReturn = true;
+ break;
+ }
}
}
+
if (!correctReturn) {
System.out.println("Can't got correct return from server.");
}
in.close();
-
+
} catch (MalformedURLException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
+ } catch (Exception e) {
+ e.printStackTrace();
}
}
}
Modified: incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/src/demo/servlet/HelloWorldServlet.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/src/demo/servlet/HelloWorldServlet.java?view=diff&rev=477144&r1=477143&r2=477144
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/src/demo/servlet/HelloWorldServlet.java (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/hello_world_soap_http/src/demo/servlet/HelloWorldServlet.java Mon Nov 20 03:13:42 2006
@@ -56,6 +56,9 @@
}
+ public void doPost(HttpServletRequest req, HttpServletResponse resp) {
+ doGet(req, resp);
+ }
/**
* get a connection to the SOAP service
Modified: incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/inbound/README.txt
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/inbound/README.txt?view=diff&rev=477144&r1=477143&r2=477144
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/inbound/README.txt (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/inbound/README.txt Mon Nov 20 03:13:42 2006
@@ -15,6 +15,7 @@
. Update jboss endorsed jars
. Set Jboss environment
+ . Set CXF environment
. Build CXF J2EE Connector rar file
. Launch the application server
. Deploy the CXF J2EE Connector
@@ -27,14 +28,14 @@
==========================
(Unix) % cd $CXF_HOME/lib/
% cp activation-1.1.jar jaxb-api-2.0.jar jaxb-impl-2.0.3.jar
- jaxb-xjc-2.0.3.jar jsr173_api-1.0.jar
- jsr181-api-2.0-JAXWS-2.0-EA3.jar
+ jaxb-xjc-2.0.3.jar stax-api-1.0.1.jar
+ jsr181-api-1.0-MR1.jar
saaj-api-1.3.jar saaj-impl-1.3.jar
<jboss-home>/lib/endorsed\
(Windows) > cd %CXF_HOME%\lib\
> copy activation-1.1.jar jaxb-api-2.0.jar jaxb-impl-2.0.3.jar
- jaxb-xjc-2.0.3.jar jsr173_api-1.0.jar
- jsr181-api-2.0-JAXWS-2.0-EA3.jar
+ jaxb-xjc-2.0.3.jar stax-api-1.0.1.jar
+ jsr181-api-1.0-MR1.jar
saaj-api-1.3.jar saaj-impl-1.3.jar
<jboss-home>\lib\endorsed\
@@ -44,6 +45,11 @@
(Unix) % export JBOSS_HOME=<jboss-home>
(Windows) > set JBOSS_HOME=<jboss-home>
+Set CXF environment
+=====================
+ (Unix) % export CXF_HOME=<cxf-home>
+ (Windows) > set CXF_HOME=<cxf-home>
+
Build CXF J2EE Connector rar file
=================================
Before build CXF J2EE Connector, must update value of
@@ -72,7 +78,7 @@
How to deploy the CXF J2EE Connector is dependent on your
application server. Please consult your vendor documentation
on connector deployment. Here are basic instructions to deploy
- the connector in JBoss, WebLogic and WebSphere application
+ the connector in JBoss application
servers.
Modified: incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/inbound/build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/inbound/build.xml?view=diff&rev=477144&r1=477143&r2=477144
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/inbound/build.xml (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/integration/jca/inbound/build.xml Mon Nov 20 03:13:42 2006
@@ -24,29 +24,30 @@
<property environment="env"/>
<property name="demos.current.dir" value="."/>
<property name="build.classes.dir" value="${basedir}/build"/>
- <property name="cxf.home" value="../../../.."/>
+ <property name="cxf.home" value="${env.CXF_HOME}"/>
<property name="wsdl.dir" value="${basedir}/wsdl"/>
<property name="wsdl.location" value="${basedir}/wsdl/hello_world.wsdl"/>
<property name="build.archives" value="${basedir}/j2ee-archives"/>
<property name="ejb.xml" location="./etc/ejb.xml"/>
<property name="j2ee.resources.dir" location="${basedir}/../common/resources"/>
- <property name="servants.props.file" location="${basedir}/../../../../etc/ejb_servants.properties"/>
+ <property name="servants.props.file" location="${cxf.home}/etc/ejb_servants.properties"/>
<property file="${servants.props.file}"/>
<property name="j2ee.archives" value="j2ee-archives"/>
+
<property name="jboss.home" value="${env.JBOSS_HOME}"/>
- <property file="${basedir}/../../../../etc/version.properties"/>
+ <property file="${cxf.home}/etc/version.properties"/>
<path id="other.classpath">
- <pathelement location="${basedir}/../../../../lib/cxf-integration-jca-${cxf.version}.jar"/>
+ <pathelement location="${cxf.home}/lib/cxf-integration-jca-${cxf.version}.jar"/>
<pathelement location="${jboss.home}/client/jbossall-client.jar"/>
</path>
<target name="generate.rar" depends="init">
- <copy file="${basedir}/../../../../etc/ra.xml" todir="${build.classes.dir}/cxf-rar/META-INF"/>
+ <copy file="${cxf.home}/etc/ra.xml" todir="${build.classes.dir}/cxf-rar/META-INF"/>
<copy todir="${build.classes.dir}/cxf-rar">
- <fileset dir="${basedir}/../../../../lib">
+ <fileset dir="${cxf.home}/lib">
<include name="activation*.jar"/>
<include name="aopalliance*.jar"/>
<include name="cxf-api*.jar"/>
@@ -71,7 +72,7 @@
<include name="XmlSchema*.jar"/>
</fileset>
</copy>
- <jar destfile="${basedir}/../../../../lib/cxf.rar"
+ <jar destfile="${cxf.home}/lib/cxf.rar"
basedir="${build.classes.dir}/cxf-rar"/>
</target>
@@ -138,7 +139,7 @@
<arg value="${wsdl.location}"/>
<classpath>
<pathelement location="${build.classes.dir}"/>
- <pathelement path="../../../../lib/cxf-incubator.jar"/>
+ <pathelement path="${cxf.home}/lib/cxf-incubator.jar"/>
</classpath>
</java>
</target>