[jboss-svn-commits] JBL Code SVN: r27400 - in labs/jbossesb/workspace/dward/wsproxy/product: samples/quickstarts/webservice_wsproxy_basic/src and 2 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Jul 1 13:33:37 EDT 2009
Author: dward
Date: 2009-07-01 13:33:37 -0400 (Wed, 01 Jul 2009)
New Revision: 27400
Removed:
labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/response.xsl
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:
removed transformation capability, and also JMS involvement in webservice_wsproxy_basic quickstart
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-01 17:30:38 UTC (rev 27399)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/build.xml 2009-07-01 17:33:37 UTC (rev 27400)
@@ -75,7 +75,7 @@
<target name="runtest">
<echo>Calling JBossWS webservice via WSProxy.</echo>
- <property name="runtest.arg.url" value="http://127.0.0.1:8765"/>
+ <property name="runtest.arg.url" value="http://127.0.0.1:9090"/>
<antcall target="runinternal"/>
</target>
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-01 17:30:38 UTC (rev 27399)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jboss-esb.xml 2009-07-01 17:33:37 UTC (rev 27400)
@@ -1,31 +1,21 @@
<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.1.0.xsd" parameterReloadSecs="5">
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
<providers>
- <jbr-provider name="JBR-Http" protocol="http" host="localhost">
- <jbr-bus busid="Http-1" port="8765"/>
+ <jbr-provider name="JBR-Http" protocol="http">
+ <jbr-bus busid="Http-1" port="9090"/>
</jbr-provider>
- <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
- <jms-bus busid="quickstartEsbChannel">
- <jms-message-filter
- dest-type="QUEUE"
- dest-name="queue/quickstart_webservice_wsproxy_basic_esb"
- />
- </jms-bus>
- </jms-provider>
</providers>
<services>
<service category="WSProxy_Basic" name="WSProxy"
- description="Basic WebService Proxy" >
+ description="Basic WebService Proxy"
+ invmScope="GLOBAL" >
<listeners>
<jbr-listener name="Http-Gateway"
busidref="Http-1"
is-gateway="true"
/>
- <jms-listener name="JMS-ESBListener"
- busidref="quickstartEsbChannel"
- />
</listeners>
<actions mep="RequestResponse">
<action name="echo-request"
@@ -34,15 +24,6 @@
<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"/>
- <!-- tcpmon testing -->
- <!--
- <property name="endpointUrl" value="http://127.0.0.1:8888/Quickstart_webservice_wsproxy_basic/HelloWorldWS"/>
- -->
- <!-- xsl testing -->
- <!--
- <property name="request-xsl" value="..."/>
- <property name="response-xsl" value="/response.xsl"/>
- -->
</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-01 17:30:38 UTC (rev 27399)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt 2009-07-01 17:33:37 UTC (rev 27400)
@@ -46,19 +46,6 @@
[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>
- - If you want to test a response xsl transform, uncomment this line:
- <property name="response-xsl" value="/response.xsl"/>
- , and you will get output similar to this (notice <return> is now <transformedReturn>):
-
-[java] **** RESPONSE BODY: <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
-[java] <env:Header/>
-[java] <env:Body>
-[java] <ns2:sayHelloResponse xmlns:ns2="http://webservice_wsproxy_basic/helloworld">
-[java] <transformedReturn>Hello 'dward' on Fri Jun 26 18:11:24 GMT-05:00 2009</transformedReturn>
-[java] </ns2:sayHelloResponse>
-[java] </env:Body>
-[java] </env:Envelope>
-
Project file descriptions:
==========================
jboss-esb.xml:
@@ -73,10 +60,6 @@
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.
- - request-xsl (optional): The filepath/classpath/url XSL which will transform the request
- message payload (the SOAP Envelope) before the external endpoint is invoked.
- - response-xsl (optional): The filepath/classpath/url XSL which will transform the response
- message payload (the SOAP Envelope) after the external endpoint is invoked.
For other possible configuration properties, see the specific SOAPProxyTransport
implementations themselves.
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-01 17:30:38 UTC (rev 27399)
+++ 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-01 17:33:37 UTC (rev 27400)
@@ -53,7 +53,7 @@
if (args.length < 2)
{
// for testing main method from Eclipse (ant will pass these args in)
- args = new String[]{"http://127.0.0.1:8765", System.getProperty("user.name")};
+ args = new String[]{"http://127.0.0.1:9090", System.getProperty("user.name")};
}
String url = args[0];
Deleted: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/response.xsl
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/response.xsl 2009-07-01 17:30:38 UTC (rev 27399)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/response.xsl 2009-07-01 17:33:37 UTC (rev 27400)
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
- <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
-
- <xsl:template match="return">
- <transformedReturn><xsl:value-of select="."/></transformedReturn>
- </xsl:template>
-
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="comment()|processing-instruction()">
- <xsl:copy/>
- </xsl:template>
-
-</xsl:stylesheet>
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-01 17:30:38 UTC (rev 27399)
+++ labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxy.java 2009-07-01 17:33:37 UTC (rev 27400)
@@ -20,26 +20,15 @@
package org.jboss.soa.esb.actions.soap.proxy;
import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
import java.io.IOException;
import java.io.StringReader;
-import java.io.StringWriter;
-import java.io.Writer;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.jboss.internal.soa.esb.publish.Publish;
-import org.jboss.internal.soa.esb.util.StreamUtils;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
import org.jboss.soa.esb.actions.ActionLifecycleException;
@@ -75,10 +64,6 @@
* <li><b>wsdl</b> (required): The original wsdl {@link URL url} whose WS endpoint will get re-written and exposed as new wsdl from
* the ESB. Depending upon the <definitions><service><port><soap:address location attribute's protocol (for
* example "http"), a protocol-specific {@link SOAPProxyTransport} implementation is used.</li>
- * <li><b>request-xsl</b> (optional): The {@link File file}path/{@link Class class}path/{@link URL url} XSL which will transform
- * the request message payload (the SOAP Envelope) <i>before</i> the external endpoint is invoked.</li>
- * <li><b>response-xsl</b> (optional): The {@link File file}path/{@link Class class}path/{@link URL url} XSL which will transform
- * the response message payload (the SOAP Envelope) <i>after</i> the external endpoint is invoked.</li>
* </ol>
* For other possible configuration properties, see the specific {@link SOAPProxyTransport} implementations themselves.<p/>
*
@@ -86,8 +71,6 @@
* <pre>
* <action name="wsproxy" class="org.jboss.soa.esb.actions.soap.proxy.SOAPProxy">
* <property name="wsdl" value="http://127.0.0.1:8080/path/HelloWorldWebService?wsdl"/> <!-- required -->
- * <property name="request-xsl" value="/request.xsl"/> <!-- optional -->
- * <property name="response-xsl" value="/response.xsl"/> <!-- optional -->
* </action>
* </pre>
*
@@ -98,13 +81,9 @@
{
private static Logger logger = Logger.getLogger(SOAPProxy.class);
- private static TransformerFactory transformerFactory = TransformerFactory.newInstance();
private MessagePayloadProxy payloadProxy;
- private byte[] request_xsl_bytes = null;
- private byte[] response_xsl_bytes = null;
-
private Map<String,String> soapaction_to_binding = new HashMap<String,String>();
private Map<String,String> operation_to_binding = new HashMap<String,String>();
private Map<String,SOAPProxyTransport> binding_to_transport = new HashMap<String,SOAPProxyTransport>();
@@ -174,16 +153,6 @@
}
}
}
- String request_xsl = config.getAttribute("request-xsl");
- if (request_xsl != null)
- {
- request_xsl_bytes = StreamUtils.getResourceAsBytes(request_xsl);
- }
- String response_xsl = config.getAttribute("response-xsl");
- if (response_xsl != null)
- {
- response_xsl_bytes = StreamUtils.getResourceAsBytes(response_xsl);
- }
}
public void initialise() throws ActionLifecycleException
@@ -217,16 +186,7 @@
{
logger.debug("using transport [" + transport.getClass().getName() + "] with endpoint address: [" + transport.getEndpointAddress() + "] for binding [" + binding + "]");
}
- // TODO: should the message be cloned before the request or response transforms?
- if (request_xsl_bytes != null)
- {
- transformPayload(message, request_xsl_bytes);
- }
message = transport.process(message);
- if (response_xsl_bytes != null)
- {
- transformPayload(message, response_xsl_bytes);
- }
return message;
}
@@ -238,57 +198,6 @@
}
}
- private void transformPayload(Message message, byte[] xsl_bytes) throws ActionProcessingException
- {
- ByteArrayInputStream xsl_input_stream = new ByteArrayInputStream(xsl_bytes);
- ByteArrayOutputStream xsl_output_stream = null;
- Writer xsl_output_writer = null;
- try
- {
- StreamSource xsl_input = null;
- Object payload = payloadProxy.getPayload(message);
- if (payload instanceof byte[])
- {
- xsl_input = new StreamSource( new ByteArrayInputStream((byte[])payload) );
- xsl_output_stream = new ByteArrayOutputStream();
- }
- else if (payload instanceof String)
- {
- xsl_input = new StreamSource( new StringReader((String)payload) );
- xsl_output_writer = new StringWriter();
- }
- else
- {
- throw new ActionProcessingException( "unsupported payload type: " + payload.getClass().getName() );
- }
- Transformer transformer = transformerFactory.newTransformer( new StreamSource(xsl_input_stream) );
- if (xsl_output_stream != null)
- {
- transformer.transform( xsl_input, new StreamResult(xsl_output_stream) );
- payloadProxy.setPayload( message, xsl_output_stream.toByteArray() );
- }
- else
- {
- transformer.transform( xsl_input, new StreamResult(xsl_output_writer) );
- payloadProxy.setPayload( message, xsl_output_writer.toString() );
- }
- }
- catch (MessageDeliverException mde)
- {
- throw new ActionProcessingException(mde);
- }
- catch (TransformerException te)
- {
- throw new ActionProcessingException(te);
- }
- finally
- {
- try { if (xsl_input_stream != null) xsl_input_stream.close(); } catch (Throwable t) {}
- try { if (xsl_output_stream != null) xsl_output_stream.close(); } catch (Throwable t) {}
- try { if (xsl_output_writer != null) xsl_output_writer.close(); } catch (Throwable t) {}
- }
- }
-
// This is a best (and potentially expensive) guess! See logger.warn(String) warning in process(Message) above.
private String getOperation(Message message) throws ActionProcessingException
{
More information about the jboss-svn-commits
mailing list