[jboss-svn-commits] JBL Code SVN: r27425 - in labs/jbossesb/workspace/dward/wsproxy/product: samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test and 1 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Jul 2 03:36:07 EDT 2009
Author: dward
Date: 2009-07-02 03:36:07 -0400 (Thu, 02 Jul 2009)
New Revision: 27425
Modified:
labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/build.xml
labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jboss-esb.xml
labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt
labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/SendWSMessage.java
labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxy.java
Log:
more wsproxy fixes
Modified: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/build.xml
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/build.xml 2009-07-02 07:14:37 UTC (rev 27424)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/build.xml 2009-07-02 07:36:07 UTC (rev 27425)
@@ -67,16 +67,23 @@
</java>
</target>
- <target name="rundirect">
+ <target name="runws">
<echo>Calling JBossWS webservice directly.</echo>
- <property name="runtest.arg.url" value="http://127.0.0.1:8080/Quickstart_webservice_wsproxy_basic/HelloWorldWS"/>
+ <property name="runtest.arg.url" value="http://localhost:8080/Quickstart_webservice_wsproxy_basic/HelloWorldWS"/>
<antcall target="runinternal"/>
</target>
- <target name="runtest">
- <echo>Calling JBossWS webservice via WSProxy.</echo>
- <property name="runtest.arg.url" value="http://127.0.0.1:9090"/>
+ <target name="runjbr">
+ <echo>Calling JBossWS webservice via JBossRemotingGatewayListener and WSProxy.</echo>
+ <property name="runtest.arg.url" value="http://localhost:9090"/>
<antcall target="runinternal"/>
</target>
+ <target name="runtest" depends="runjbr"/>
+ <target name="runhttp">
+ <echo>Calling JBossWS webservice via HttpGatewayListener and WSProxy.</echo>
+ <property name="runtest.arg.url" value="http://localhost:9999/WSProxy_Basic/HelloWorldWS/"/>
+ <antcall target="runinternal"/>
+ </target>
+
</project>
Modified: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jboss-esb.xml 2009-07-02 07:14:37 UTC (rev 27424)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jboss-esb.xml 2009-07-02 07:36:07 UTC (rev 27425)
@@ -2,9 +2,12 @@
<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.1.0.xsd" parameterReloadSecs="5">
<providers>
- <jbr-provider name="JBR-Http" protocol="http" host="localhost">
- <jbr-bus busid="Http-1" port="9090"/>
+ <jbr-provider name="JBR-PROVIDER" protocol="http" host="localhost">
+ <jbr-bus busid="JBR-BUS" port="9090"/>
</jbr-provider>
+ <http-provider name="HTTP-PROVIDER" host="localhost" port="9999">
+ <http-bus busid="HTTP-BUS" context="/WSProxy_Basic/HelloWorldWS"/>
+ </http-provider>
</providers>
<services>
@@ -12,10 +15,14 @@
description="Basic WebService Proxy"
invmScope="GLOBAL" >
<listeners>
- <jbr-listener name="Http-Gateway"
- busidref="Http-1"
+ <jbr-listener name="JBR-GATEWAY"
+ busidref="JBR-BUS"
is-gateway="true"
/>
+ <http-listener name="HTTP-GATEWAY"
+ busidref="HTTP-BUS"
+ is-gateway="true"
+ />
</listeners>
<actions mep="RequestResponse">
<action name="echo-request"
@@ -23,7 +30,7 @@
/>
<action name="wsproxy"
class="org.jboss.soa.esb.actions.soap.proxy.SOAPProxy">
- <property name="wsdl" value="http://127.0.0.1:8080/Quickstart_webservice_wsproxy_basic/HelloWorldWS?wsdl"/>
+ <property name="wsdl" value="http://localhost:8080/Quickstart_webservice_wsproxy_basic/HelloWorldWS?wsdl"/>
</action>
<action name="echo-response"
class="org.jboss.soa.esb.actions.SystemPrintln"
Modified: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt 2009-07-02 07:14:37 UTC (rev 27424)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt 2009-07-02 07:36:07 UTC (rev 27425)
@@ -15,37 +15,57 @@
To Run '.esb' archive mode:
===========================
1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+ - In your server console, you will see output like this:
+
+02:21:53,792 INFO [SOAPProxy] mapped soapaction [] to binding [HelloWorldBinding]
+02:21:53,792 INFO [SOAPProxy] also mapped soapaction [""] to binding [HelloWorldBinding]
+02:21:53,793 INFO [SOAPProxy] mapped operation [sayHello] to binding [HelloWorldBinding]
+02:21:53,807 INFO [SOAPProxy] mapped binding [HelloWorldBinding] to transport [org.jboss.soa.esb.actions.soap.proxy.HttpSOAPProxyTransport] with endpoint address: [http://localhost:8080/Quickstart_webservice_wsproxy_basic/HelloWorldWS]
+
2. Open another command terminal window in this folder ("Window2"), type
'ant runtest'.
+
3. Switch back to Application Server console to see the output from the ESB
+
4. In this folder ("Window1"), type 'ant undeploy'.
- 'rundirect' target description:
+ 'runws' target description:
- This simply calls the target JBossWS webservice directly.
+ - The request url is: http://localhost:8080/Quickstart_webservice_wsproxy_basic/HelloWorldWS
+ - Running it will create output similar to the runjbr output below.
- 'runtest' target description:
- - This will exercise the target webservice *via* the SOAPProxy.
- - Running it will create output similar to this:
-
-[java] **** REQUEST URL: http://127.0.0.1:8765
-[java] **** REQUEST BODY: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://webservice_wsproxy_basic/helloworld"><soapenv:Header/><soapenv:Body><hel:sayHello><toWhom>dward</toWhom></hel:sayHello></soapenv:Body></soapenv:Envelope>
-[java] 18:10:10,664 DEBUG [main][header] >> "POST / HTTP/1.1[\r][\n]"
-[java] 18:10:10,699 DEBUG [main][header] >> "SOAPAction: ""[\r][\n]"
-[java] 18:10:10,699 DEBUG [main][header] >> "User-Agent: Jakarta Commons-HttpClient/3.0.1[\r][\n]"
-[java] 18:10:10,700 DEBUG [main][header] >> "Host: 127.0.0.1:8765[\r][\n]"
-[java] 18:10:10,700 DEBUG [main][header] >> "Content-Length: 247[\r][\n]"
-[java] 18:10:10,700 DEBUG [main][header] >> "[\r][\n]"
-[java] 18:10:10,701 DEBUG [main][content] >> "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://webservice_wsproxy_basic/helloworld"><soapenv:Header/><soapenv:Body><hel:sayHello><toWhom>dward</toWhom></hel:sayHello></soapenv:Body></soapenv:Envelope>"
-[java] 18:10:10,829 DEBUG [main][header] << "HTTP/1.1 200 OK[\r][\n]"
-[java] 18:10:10,832 DEBUG [main][header] << "Server: Apache-Coyote/1.1[\r][\n]"
-[java] 18:10:10,832 DEBUG [main][header] << "Content-Type: text/xml[\r][\n]"
-[java] 18:10:10,832 DEBUG [main][header] << "Content-Length: 297[\r][\n]"
-[java] 18:10:10,832 DEBUG [main][header] << "Date: Fri, 26 Jun 2009 23:10:10 GMT[\r][\n]"
+ 'runjbr' (alias 'runtest') target description:
+ - This will exercise the target webservice *via* the SOAPProxy, first going
+ through a JBoss Remoting Gateway Listener.
+ - The request url is: http://localhost:9090
+ - Running it will create output like this:
+[java] **** REQUEST URL: http://localhost:9090
+[java] **** REQUEST BODY: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://webservice_wsproxy_basic/helloworld"><soapenv:Header/><soapenv:Body><hel:sayHello><toWhom>jdoe</toWhom></hel:sayHello></soapenv:Body></soapenv:Envelope>
+[java] 02:26:12,389 DEBUG [main][header] >> "POST / HTTP/1.1[\r][\n]"
+[java] 02:26:12,414 DEBUG [main][header] >> "Content-Type: text/xml;charset=UTF-8[\r][\n]"
+[java] 02:26:12,414 DEBUG [main][header] >> "SOAPAction: [\r][\n]"
+[java] 02:26:12,415 DEBUG [main][header] >> "User-Agent: Jakarta Commons-HttpClient/3.0.1[\r][\n]"
+[java] 02:26:12,415 DEBUG [main][header] >> "Host: localhost:9090[\r][\n]"
+[java] 02:26:12,415 DEBUG [main][header] >> "Content-Length: 247[\r][\n]"
+[java] 02:26:12,415 DEBUG [main][header] >> "[\r][\n]"
+[java] 02:26:12,415 DEBUG [main][content] >> "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://webservice_wsproxy_basic/helloworld"><soapenv:Header/><soapenv:Body><hel:sayHello><toWhom>jdoe</toWhom></hel:sayHello></soapenv:Body></soapenv:Envelope>"
+[java] 02:26:12,431 DEBUG [main][header] << "HTTP/1.1 200 OK[\r][\n]"
+[java] 02:26:12,433 DEBUG [main][header] << "Server: Apache-Coyote/1.1[\r][\n]"
+[java] 02:26:12,433 DEBUG [main][header] << "X-Powered-By: Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0[\r][\n]"
+[java] 02:26:12,434 DEBUG [main][header] << "Date: Thu, 02 Jul 2009 07:26:12 GMT[\r][\n]"
+[java] 02:26:12,434 DEBUG [main][header] << "Content-Type: text/xml;charset=UTF-8[\r][\n]"
+[java] 02:26:12,434 DEBUG [main][header] << "Content-Length: 297[\r][\n]"
[java] **** RESPONSE CODE: 200
-[java] 18:10:10,835 DEBUG [main][content] << "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:sayHelloResponse xmlns:ns2="http://webservice_wsproxy_basic/helloworld"><return>Hello 'dward' on Fri Jun 26 18:10:10 GMT-05:00 2009</return></ns2:sa"
-[java] 18:10:10,835 DEBUG [main][content] << "yHelloResponse></env:Body></env:Envelope>"
-[java] **** RESPONSE BODY: <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:sayHelloResponse xmlns:ns2="http://webservice_wsproxy_basic/helloworld"><return>Hello 'dward' on Fri Jun 26 18:10:10 GMT-05:00 2009</return></ns2:sayHelloResponse></env:Body></env:Envelope>
+[java] 02:26:12,438 DEBUG [main][content] << "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:sayHelloResponse xmlns:ns2="http://webservice_wsproxy_basic/helloworld"><return>Hello 'jdoe' on Thu Jul 02 02:26:12 GMT-05:00 2009</return></ns2:sa"
+[java] 02:26:12,438 DEBUG [main][content] << "yHelloResponse></env:Body></env:Envelope>"
+[java] **** RESPONSE BODY: <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:sayHelloResponse xmlns:ns2="http://webservice_wsproxy_basic/helloworld"><return>Hello 'jdoe' on Thu Jul 02 02:26:12 GMT-05:00 2009</return></ns2:sayHelloResponse></env:Body></env:Envelope>
+ 'runhttp' target description:
+ - This will exercise the target webservice *via* the SOAPProxy, first going
+ through an HTTP Gateway Listener.
+ - The request url is: http://localhost:9999/WSProxy_Basic/HelloWorldWS/
+ - Running it will create output similar to the runjbr output above.
+
Project file descriptions:
==========================
jboss-esb.xml:
@@ -60,27 +80,30 @@
new wsdl from the ESB. Depending upon the <definitions><service><port><soap:address location
attribute's protocol (for example "http"), a protocol-specific SOAPProxyTransport
implementation is used.
- For other possible configuration properties, see the specific SOAPProxyTransport
- implementations themselves.
+ For other possible configuration properties, see the specific SOAPProxyTransport implementations
+ themselves.
log4j.xml:
Needed to configure log4J used by the quickstart.
src/../SendWSMessage.java:
- Sends a SOAP message to the target webservice endpoint (see "ant rundirect" and "ant runtest"
- below).
+ Sends a SOAP message to the target webservice endpoint (see "ant run*" above).
- org.jboss.soa.esb.actions.soap.proxy.SOAPProxy
- This class is used to proxy the call to the original webservice.
-
build.xml:
Targets and structure description:
- * the rundirect task calls the
- org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_basic.test.SendWSMessage class and
- passes in and argument representing the *ORIGINAL* webservice endpoint and an argument
- representing the string-based message to invoke the webserivce with.
- * the runtest task calls the
+
+ * the runws task calls the
org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_basic.test.SendWSMessage class and
- passes in and argument representing the *PROXIED* webservice endpoint and an argument
- representing the string-based message to invoke the webserivce with.
+ passes in and argument representing the *ORIGINAL* webservice endpoint
+ and an argument representing the string-based message to invoke the webservice with.
+ * the runjbr (also runtest) task calls the
+ org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_basic.test.SendWSMessage class and
+ passes in and argument representing the *PROXIED* webservice endpoint (via JBoss Remoting)
+ and an argument representing the string-based message to invoke the webservice with.
+
+ * the runhttp task calls the
+ org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_basic.test.SendWSMessage class and
+ passes in and argument representing the *PROXIED* webservice endpoint (via HTTP Gateway)
+ and an argument representing the string-based message to invoke the webservice with.
+
Modified: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/SendWSMessage.java
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/SendWSMessage.java 2009-07-02 07:14:37 UTC (rev 27424)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/SendWSMessage.java 2009-07-02 07:36:07 UTC (rev 27425)
@@ -47,21 +47,26 @@
"</soapenv:Body>" +
"</soapenv:Envelope>";
- // product/samples/quickstarts/webservice_wsproxy_basic/build.xml - see ant targets: "rundirect" and "runtest"
+ // see product/samples/quickstarts/webservice_wsproxy_basic/build.xml
public static void main(String... args) throws Exception
{
if (args.length < 2)
{
- // for testing main method from Eclipse (ant will pass these args in)
- args = new String[]{"http://127.0.0.1:9090", System.getProperty("user.name")};
+ // for testing main method from Eclipse (build.xml passes these args in)
+ args = new String[2];
+ //args[0] = "http://localhost:8080/Quickstart_webservice_wsproxy_basic/HelloWorldWS"; // original ws ("ant runws")
+ args[0] = "http://localhost:9090"; // jbr gateway ("ant runjbr" or "ant runtest")
+ //args[0] = "http://localhost:9999/WSProxy_Basic/HelloWorldWS/"; // http gateway ("ant runhttp")
+ args[1] = System.getProperty("user.name");
}
String url = args[0];
System.out.println("**** REQUEST URL: " + url);
PostMethod method = new PostMethod(url);
+ method.setRequestHeader("Content-Type", "text/xml;charset=UTF-8");
- // this line should be used for better performance
- method.setRequestHeader("SOAPAction", "\"\"");
+ // this line should be used for better performance but is not necessary
+ method.setRequestHeader("SOAPAction", "");
String request = SOAP_PRE + args[1] + SOAP_POST;
System.out.println("**** REQUEST BODY: " + request);
Modified: labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxy.java
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxy.java 2009-07-02 07:14:37 UTC (rev 27424)
+++ labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxy.java 2009-07-02 07:36:07 UTC (rev 27425)
@@ -104,13 +104,21 @@
String soapaction = wsdl_bind_oper.getSOAPAction();
if (soapaction != null)
{
- // TODO: do SOAPActions always have quotes around them?
- soapaction = '"' + soapaction + '"';
soapaction_to_binding.put(soapaction, binding);
if ( logger.isInfoEnabled() )
{
logger.info("mapped soapaction [" + soapaction + "] to binding [" + binding + "]");
}
+ // TODO: do SOAPActions always have quotes around them?
+ if ( !soapaction.startsWith("\"") && !soapaction.endsWith("\"") )
+ {
+ soapaction = '"' + soapaction + '"';
+ soapaction_to_binding.put(soapaction, binding);
+ if ( logger.isInfoEnabled() )
+ {
+ logger.info("also mapped soapaction [" + soapaction + "] to binding [" + binding + "]");
+ }
+ }
}
String operation = wsdl_bind_oper.getRef().getLocalPart();
if (operation != null)
More information about the jboss-svn-commits
mailing list