[jboss-svn-commits] JBL Code SVN: r20989 - in labs/jbossesb/workspace/jimma/product: samples/quickstarts and 13 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Jul 10 03:17:12 EDT 2008
Author: jim.ma
Date: 2008-07-10 03:17:11 -0400 (Thu, 10 Jul 2008)
New Revision: 20989
Added:
labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/webservice/Constants.java
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/build.xml
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/deployment.xml
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/fault.xsd
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jbm-queue-service.xml
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jbmq-queue-service.xml
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jboss-esb.xml
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jbossesb-properties.xml
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jndi.properties
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/juddi.properties
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/lib/
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/listener.log
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/log4j.xml
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/readme.txt
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/request.xsd
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/response.xsd
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/.classpath
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/.project
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/helloworld/
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/helloworld/MyJMSListenerAction.java
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SOAPTest.java
labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java
labs/jbossesb/workspace/jimma/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPBase.java
labs/jbossesb/workspace/jimma/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPIn.java
labs/jbossesb/workspace/jimma/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPOut.java
labs/jbossesb/workspace/jimma/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/helloworld.wsdl
Removed:
labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/
Modified:
labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBServiceContractPublisher.java
labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayBaseWebService.java
labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseBaseWebService.java
labs/jbossesb/workspace/jimma/product/samples/quickstarts/readme.txt
labs/jbossesb/workspace/jimma/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SoapUIInvoker.java
labs/jbossesb/workspace/jimma/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java
labs/jbossesb/workspace/jimma/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientServiceMBean.java
labs/jbossesb/workspace/jimma/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/SoapUIClientServiceMBeanUnitTest.java
Log:
* Add SOAPIn and SOAPOut actions to transfer the soap message to esb message
* Rename the helloworld_pub_service sample to publish_as_webservice sample
Added: labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/webservice/Constants.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/webservice/Constants.java (rev 0)
+++ labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/webservice/Constants.java 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.internal.soa.esb.webservice;
+
+public final class Constants {
+ public static final String SOAP_IN_LOC = "SoapIn";
+ public static final String SOAP_OUT_LOC = "SoapOut";
+}
Modified: labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBServiceContractPublisher.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBServiceContractPublisher.java 2008-07-10 06:54:27 UTC (rev 20988)
+++ labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBServiceContractPublisher.java 2008-07-10 07:17:11 UTC (rev 20989)
@@ -13,12 +13,13 @@
import org.jboss.wsf.spi.management.EndpointRegistry;
import org.jboss.wsf.spi.management.EndpointRegistryFactory;
-
-
public class ESBServiceContractPublisher implements ContractPublisher {
- String endpointName;
+ private static String address;
+ private String endpointName;
+
public ESBServiceContractPublisher(String jaxwsEndpoint) {
endpointName = jaxwsEndpoint;
+ address = null;
}
public ContractInfo getContractInfo(EPR epr) {
@@ -26,7 +27,10 @@
}
public String getEndpointAddress() {
-
+ if (address != null) {
+ return address;
+ }
+
SPIProvider spiProv = SPIProviderResolver.getInstance().getProvider();
EndpointRegistryFactory factory = spiProv
.getSPI(EndpointRegistryFactory.class);
@@ -39,11 +43,16 @@
if (endpoint != null && endpoint.equals(endpointName)) {
Endpoint ep = registry.getEndpoint(objectName);
- return ep.getAddress();
+ address = ep.getAddress();
+ return address;
}
}
return null;
}
+
+ public String getEndpointName() {
+ return this.endpointName;
+ }
}
Modified: labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayBaseWebService.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayBaseWebService.java 2008-07-10 06:54:27 UTC (rev 20988)
+++ labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayBaseWebService.java 2008-07-10 07:17:11 UTC (rev 20989)
@@ -23,9 +23,11 @@
import java.io.ByteArrayOutputStream;
+import javax.annotation.Resource;
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.WebServiceContext;
import org.jboss.soa.esb.client.ServiceInvoker;
import org.jboss.soa.esb.couriers.FaultMessageException;
@@ -39,7 +41,7 @@
*/
public class OneWayBaseWebService
{
- private static final QName SERVER_FAULT_QN = new QName("http://schemas.xmlsoap.org/soap/envelope/", "Server") ;
+ private static final QName SERVER_FAULT_QN = new QName("http://schemas.xmlsoap.org/soap/envelope/", "Server") ;
private final ServiceInvoker serviceInvoker ;
protected OneWayBaseWebService(final String category, final String name)
@@ -57,7 +59,7 @@
final Message msg = MessageFactory.getInstance().getMessage() ;
final ByteArrayOutputStream byteStream = new ByteArrayOutputStream() ;
request.writeTo(byteStream) ;
- msg.getBody().add(byteStream.toString()) ;
+ msg.getBody().add(Constants.SOAP_IN_LOC, request) ;
byteStream.close() ;
serviceInvoker.deliverAsync(msg) ;
}
Modified: labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseBaseWebService.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseBaseWebService.java 2008-07-10 06:54:27 UTC (rev 20988)
+++ labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseBaseWebService.java 2008-07-10 07:17:11 UTC (rev 20989)
@@ -21,6 +21,7 @@
*/
package org.jboss.internal.soa.esb.webservice;
+import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import javax.xml.namespace.QName;
@@ -52,18 +53,18 @@
throws SOAPException
{
final SOAPMessage request = (SOAPMessage)obj;
+ final SOAPMessage response;
try
{
final Message msg = MessageFactory.getInstance().getMessage() ;
final ByteArrayOutputStream byteStream = new ByteArrayOutputStream() ;
- request.writeTo(byteStream) ;
- msg.getBody().add(byteStream.toString()) ;
+ request.writeTo(byteStream);
+ msg.getBody().add(Constants.SOAP_IN_LOC, byteStream.toString()) ;
byteStream.close() ;
- final Message response = serviceInvoker.deliverSync(msg, (long)30000) ;
-// template.setAttribute("InvokeMethod", "");
-// //TODO: when the ESB actions mep is request-response
-// template.setAttribute("Result", "request");
-// template.setAttribute("ReturnFaultMsg", "return faultMsg;");
+ Message esbRes = serviceInvoker.deliverSync(msg, (long)30000) ;
+ String soapRes = (String)esbRes.getBody().get(Constants.SOAP_OUT_LOC);
+ ByteArrayInputStream bin = new java.io.ByteArrayInputStream(soapRes.getBytes());
+ response = javax.xml.soap.MessageFactory.newInstance().createMessage(null, bin);
}
catch (final Exception ex)
{
@@ -78,6 +79,6 @@
}
return faultMsg ;
}
- return request;
+ return response;
}
}
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/build.xml
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/build.xml (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/build.xml 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,55 @@
+<project name="Quickstart_publish_as_webservice" default="run" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+ <target name="runtest" depends="compile"
+ description="sends a soap message to published web service">
+ <echo>Send soap message to published web service</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.helloworld.test.SOAPTest" failonerror="true">
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
+ <target name="sendesb" depends="compile"
+ description="Will send an esb Message">
+ <echo>Runs Test ESB Message Sender</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.helloworld.test.SendEsbMessage" failonerror="true">
+ <arg value="ESBServiceSample"/> <!-- service category -->
+ <arg value="HelloWorldPubService"/> <!-- service name -->
+ <arg value="Hello World - Straight to ESB listener - no Gateway"/> <!-- Message text -->
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
+ <target name="copy-metainf">
+ <mkdir dir="${build.dir}/META-INF" />
+ <copy todir="${build.dir}/META-INF">
+ <fileset dir="${basedir}" includes="jboss-esb.xml" />
+ <fileset dir="${basedir}" includes="deployment.xml" />
+ </copy>
+ <copy todir="${build.dir}">
+ <fileset dir="${basedir}" includes="*.xsd" />
+ </copy>
+ </target>
+
+ <target name="package-deployment">
+ <mkdir dir="lib"/>
+ <jar destfile="${build.dir}/${ant.project.name}.esb">
+ <fileset dir="${build.dir}/classes" />
+ <fileset dir="${build.dir}" includes="*.xsd"/>
+ <fileset dir="${build.dir}" includes="*.jar,*.war"/>
+ <fileset dir="${build.dir}" includes="deployment.xml"/>
+ <fileset dir="${build.dir}" includes="META-INF/**" />
+ <fileset dir="${basedir}/src" excludes="**/*.java" /> <!-- Please leave the src dir in here! -->
+ <fileset dir="${basedir}" includes="${jms.service.file} ${additional.deploys}" excludes="build/**" />
+ <fileset dir="${basedir}/lib" includes="*.jar"/>
+ </jar>
+ </target>
+
+
+</project>
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/deployment.xml
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/deployment.xml (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/deployment.xml 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,5 @@
+<jbossesb-deployment>
+ <depends>jboss.esb:deployment=soap.esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_pub_service_Request_esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_pub_service_Request_esb_reply</depends>
+</jbossesb-deployment>
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/fault.xsd
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/fault.xsd (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/fault.xsd 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,9 @@
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" xmlns:x1="http://www.jboss.org/sayHi" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <xs:element name="sayFault" type="x1:fault"/>
+ <xs:complexType name="fault">
+ <xs:sequence>
+ <xs:element name="code" type="xs:string"/>
+ <xs:element name="faultString" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
\ No newline at end of file
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jbm-queue-service.xml 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_pub_service_Request_esb"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_pub_service_Request_esb_reply"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jbmq-queue-service.xml (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jbmq-queue-service.xml 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_pub_service_Request_esb">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_pub_service_Request_esb_reply">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jboss-esb.xml (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jboss-esb.xml 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,39 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
+
+ <providers>
+ <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_helloworld_pub_service_Request_esb"
+ />
+ </jms-bus>
+
+ </jms-provider>
+ </providers>
+
+ <services>
+ <service
+ category="ESBServiceSample"
+ name="HelloWorldPubService"
+ description="Hello world ESB Service">
+ <listeners>
+ <jms-listener name="helloWorld"
+ busidref="quickstartEsbChannel"
+ maxThreads="1"
+ />
+ </listeners>
+ <actions inXsd="/request.xsd" outXsd="/response.xsd" faultXsd="/fault.xsd">
+ <action name="action1" class="org.jboss.soa.esb.actions.soap.SOAPIn"/>
+
+ <action name="action2"
+ class="org.jboss.soa.esb.samples.quickstart.helloworld.MyJMSListenerAction"
+ process="displayMessage"
+ />
+ <action name="action3" class="org.jboss.soa.esb.actions.soap.SOAPOut"/>
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jbossesb-properties.xml 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2006, JBoss Inc., and others contributors as indicated
+ by the @authors tag. All rights reserved.
+ See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+ This copyrighted material is made available to anyone wishing to use,
+ modify, copy, or redistribute it subject to the terms and conditions
+ of the GNU Lesser General Public License, v. 2.1.
+ This program is distributed in the hope that it will be useful, but WITHOUT A
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ You should have received a copy of the GNU Lesser General Public License,
+ v.2.1 along with this distribution; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA.
+
+ (C) 2005-2006,
+ @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI"
+ value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
+ value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+ <property name="org.jboss.soa.esb.registry.implementationClass"
+ value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+ <property name="org.jboss.soa.esb.registry.factoryClass"
+ value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+ <property name="org.jboss.soa.esb.registry.user"
+ value="jbossesb"/>
+ <property name="org.jboss.soa.esb.registry.password"
+ value="password"/>
+ <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+ <property name="org.jboss.soa.esb.scout.proxy.transportClass"
+ value="org.apache.ws.scout.transport.RMITransport"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+ <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+ <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+ </properties>
+ <properties name="connection">
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool=size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
+ <properties name="dbstore">
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
+ <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+ <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
+ <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
+ <!--table managed by pool to test for valid connections - created by pool automatically -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
+ <!-- # of milliseconds to timeout waiting for a connection from pool -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+</esb>
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jndi.properties
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jndi.properties (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/jndi.properties 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/juddi.properties
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/juddi.properties (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/juddi.properties 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/listener.log
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/listener.log (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/listener.log 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,75 @@
+2008-07-10 14:40:01,045 DEBUG [main][httpclient.wire.header] >> "POST /Quickstart_publish_as_webservice/ESBServiceSample/HelloWorldPubService?wsdl HTTP/1.1[\r][\n]"
+2008-07-10 14:40:01,059 DEBUG [main][httpclient.wire.header] >> "User-Agent: Jakarta Commons-HttpClient/3.0.1[\r][\n]"
+2008-07-10 14:40:01,059 DEBUG [main][httpclient.wire.header] >> "Host: 127.0.0.1:8080[\r][\n]"
+2008-07-10 14:40:01,060 DEBUG [main][httpclient.wire.header] >> "Content-Length: 239[\r][\n]"
+2008-07-10 14:40:01,060 DEBUG [main][httpclient.wire.header] >> "[\r][\n]"
+2008-07-10 14:40:01,060 DEBUG [main][httpclient.wire.content] >> "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:say="http://www.jboss.org/sayHi"><soapenv:Header/> <soapenv:Body> <say:sayHi> <say:arg0>hello world</say:arg0></say:sayHi></soapenv:Body> </soapenv:Envelope>"
+2008-07-10 14:40:01,472 DEBUG [main][httpclient.wire.header] << "HTTP/1.1 200 OK[\r][\n]"
+2008-07-10 14:40:01,474 DEBUG [main][httpclient.wire.header] << "Server: Apache-Coyote/1.1[\r][\n]"
+2008-07-10 14:40:01,475 DEBUG [main][httpclient.wire.header] << "X-Powered-By: Servlet 2.4; JBoss-4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)/Tomcat-5.5[\r][\n]"
+2008-07-10 14:40:01,475 DEBUG [main][httpclient.wire.header] << "Content-Type: text/xml;charset=UTF-8[\r][\n]"
+2008-07-10 14:40:01,475 DEBUG [main][httpclient.wire.header] << "Transfer-Encoding: chunked[\r][\n]"
+2008-07-10 14:40:01,475 DEBUG [main][httpclient.wire.header] << "Date: Thu, 10 Jul 2008 06:40:01 GMT[\r][\n]"
+2008-07-10 14:40:01,479 DEBUG [main][httpclient.wire.content] << "e"
+2008-07-10 14:40:01,479 DEBUG [main][httpclient.wire.content] << "d"
+2008-07-10 14:40:01,479 DEBUG [main][httpclient.wire.content] << "[\r]"
+2008-07-10 14:40:01,479 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,479 DEBUG [main][httpclient.wire.content] << "<soapenv:Envelope xmlns:say='http://www.jboss.org/sayHi' xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'><soapenv:Header></soapenv:Header><soapenv:Body>[\n]"
+2008-07-10 14:40:01,479 DEBUG [main][httpclient.wire.content] << " <say:sayHiResponse xmlns:say='http://www.jboss.org/sayHi'>[\n]"
+2008-07-10 14:40:01,479 DEBUG [main][httpclient.wire.content] << " "
+2008-07-10 14:40:01,479 DEBUG [main][httpclient.wire.content] << "[\r]"
+2008-07-10 14:40:01,479 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,479 DEBUG [main][httpclient.wire.content] << "1"
+2008-07-10 14:40:01,479 DEBUG [main][httpclient.wire.content] << "0"
+2008-07-10 14:40:01,479 DEBUG [main][httpclient.wire.content] << "[\r]"
+2008-07-10 14:40:01,479 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,480 DEBUG [main][httpclient.wire.content] << "<!--Optional:-->"
+2008-07-10 14:40:01,480 DEBUG [main][httpclient.wire.content] << "[\r]"
+2008-07-10 14:40:01,480 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,500 DEBUG [main][httpclient.wire.content] << "a"
+2008-07-10 14:40:01,500 DEBUG [main][httpclient.wire.content] << "[\r]"
+2008-07-10 14:40:01,500 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,500 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,500 DEBUG [main][httpclient.wire.content] << " "
+2008-07-10 14:40:01,500 DEBUG [main][httpclient.wire.content] << "[\r]"
+2008-07-10 14:40:01,500 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,500 DEBUG [main][httpclient.wire.content] << "5"
+2008-07-10 14:40:01,500 DEBUG [main][httpclient.wire.content] << "8"
+2008-07-10 14:40:01,500 DEBUG [main][httpclient.wire.content] << "[\r]"
+2008-07-10 14:40:01,500 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << "<say:arg0 xmlns:say='http://www.jboss.org/sayHi'>Response from ESB Service : hello world"
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << "[\r]"
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << "b"
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << "[\r]"
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << "</say:arg0>"
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << "[\r]"
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << "7"
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << "[\r]"
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << " "
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << "[\r]"
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << "1"
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << "4"
+2008-07-10 14:40:01,501 DEBUG [main][httpclient.wire.content] << "[\r]"
+2008-07-10 14:40:01,502 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,502 DEBUG [main][httpclient.wire.content] << "</say:sayHiResponse>"
+2008-07-10 14:40:01,502 DEBUG [main][httpclient.wire.content] << "[\r]"
+2008-07-10 14:40:01,502 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,502 DEBUG [main][httpclient.wire.content] << "2"
+2008-07-10 14:40:01,502 DEBUG [main][httpclient.wire.content] << "6"
+2008-07-10 14:40:01,502 DEBUG [main][httpclient.wire.content] << "[\r]"
+2008-07-10 14:40:01,502 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,502 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,502 DEBUG [main][httpclient.wire.content] << " </soapenv:Body></soapenv:Envelope>"
+2008-07-10 14:40:01,502 DEBUG [main][httpclient.wire.content] << "[\r]"
+2008-07-10 14:40:01,502 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,502 DEBUG [main][httpclient.wire.content] << "0"
+2008-07-10 14:40:01,502 DEBUG [main][httpclient.wire.content] << "[\r]"
+2008-07-10 14:40:01,502 DEBUG [main][httpclient.wire.content] << "[\n]"
+2008-07-10 14:40:01,502 DEBUG [main][httpclient.wire.content] << "[\r]"
+2008-07-10 14:40:01,502 DEBUG [main][httpclient.wire.content] << "[\n]"
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/log4j.xml
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/log4j.xml (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/log4j.xml 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="INFO"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A size based file rolling appender -->
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="./listener.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jboss">
+ <priority value="WARN"/>
+ </category>
+ <category name="org.jboss.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.jboss.internal.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.apache">
+ <priority value="ERROR"/>
+ </category>
+ <category name="quickstart">
+ <priority value="DEBUG"/>
+ </category>
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/readme.txt
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/readme.txt (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/readme.txt 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,29 @@
+Overview:
+=========
+ The purpose of the publish_as_webservice quickstart sample is to demonstrate how to
+ publish a esb service as a web service.
+
+Running this quickstart:
+========================
+ Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+ and a more detailed descripton of the different ways to run the quickstarts.
+
+To Run standalone mode:
+=======================
+ 1. In a command terminal window in the quickstart folder type
+ 'ant deploy'.
+ 2. Open another command terminal window in this folder ("Window1"), type
+ 'ant runtest'. It will send soap request to published web service for
+ this esb service and disply the output.
+ 3. Open another command terminal window in this folder ("Window2"), type
+ 'ant sendesb'. This task will send esb message to esb service and disply
+ the output.
+
+To Run '.esb' archive mode:
+===========================
+ 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+ 2. Open another command terminal window in this folder ("Window2"), type
+ 'ant runtest'.
+ 3. Open another command terminal window in this folder ("Window2"), type
+ 'ant sendesb'.
+ 4. In this folder ("Window1"), type 'ant undeploy'.
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/request.xsd
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/request.xsd (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/request.xsd 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,8 @@
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" xmlns:x1="http://www.jboss.org/sayHi" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <xs:element name="sayHi" type="x1:sayHi"/>
+ <xs:complexType name="sayHi">
+ <xs:sequence>
+ <xs:element name="arg0" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/response.xsd
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/response.xsd (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/response.xsd 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,8 @@
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" xmlns:x1="http://www.jboss.org/sayHi" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <xs:element name="sayHiResponse" type="x1:sayHiResponse"/>
+ <xs:complexType name="sayHiResponse">
+ <xs:sequence>
+ <xs:element name="arg0" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/.classpath
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/.classpath (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/.classpath 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path=""/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/.project
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/.project (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/.project 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>pubservice-sample</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/helloworld/MyJMSListenerAction.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/helloworld/MyJMSListenerAction.java (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/helloworld/MyJMSListenerAction.java 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.helloworld;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class MyJMSListenerAction extends AbstractActionLifecycle
+{
+ protected ConfigTree _config;
+ public MyJMSListenerAction(ConfigTree config) { _config = config; }
+ public Message displayMessage(Message message) throws Exception
+ {
+ java.util.Map paras = (java.util.Map)message.getBody().get();
+ String request = (String)paras.get("sayHi.arg0");
+ String responseMsg = "Response from ESB Service : " + request;
+ java.util.Map responsePara = new java.util.HashMap();
+ responsePara.put("sayHiResponse.arg0", responseMsg);
+ message.getBody().add(responsePara);
+ return message;
+ }
+}
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SOAPTest.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SOAPTest.java (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SOAPTest.java 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.helloworld.test;
+import java.io.IOException;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.StringRequestEntity;
+
+public class SOAPTest {
+ public static void main(String args[]) {
+
+ String request = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:say=\"http://www.jboss.org/sayHi\">"
+ + "<soapenv:Header/> <soapenv:Body> <say:sayHi> <say:arg0>hello world</say:arg0></say:sayHi>"
+ + "</soapenv:Body> </soapenv:Envelope>";
+ HttpClient client = new HttpClient();
+ PostMethod postMethod = new PostMethod(
+ "http://127.0.0.1:8080/Quickstart_publish_as_webservice/ESBServiceSample/HelloWorldPubService?wsdl");
+
+ StringRequestEntity requestEntity = new StringRequestEntity(request);
+ postMethod.setRequestEntity(requestEntity);
+ try {
+ client.executeMethod(postMethod);
+ System.out.println("Response from web service");
+ System.out.println(postMethod.getResponseBodyAsString());
+ } catch (HttpException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+
+ }
+
+}
Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.samples.quickstart.helloworld.test;
+
+import java.util.Map;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.client.ServiceInvoker;
+
+/**
+ * Standalone class with to send ESB messages to a 'known' [category,name].
+ * <p/> arg0 - service category
+ * <br/>arg1 - service name
+ * <br/>arg2 - Text of message to send
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @since Version 4.0
+ *
+ */
+public class SendEsbMessage
+{
+ public static void main(String args[]) throws Exception
+ {
+// Setting the ConnectionFactory such that it will use scout
+ System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
+
+ if (args.length < 3)
+ {
+ System.out.println("Usage SendEsbMessage <category> <name> <text to send>");
+ }
+
+ Message esbMessage = MessageFactory.getInstance().getMessage();
+
+ Map paras = new java.util.HashMap();
+
+ paras.put("sayHi.arg0", args[2]);
+
+ esbMessage.getBody().add(paras);
+
+ ServiceInvoker invoker = new ServiceInvoker(args[0], args[1]);
+
+ Message response = invoker.deliverSync(esbMessage, (long)3000);
+
+ Map resParas = (Map)response.getBody().get();
+
+ System.out.println("#######Response from ESB Service#########");
+
+ System.out.println(resParas.get("sayHiResponse.arg0"));
+
+ }
+
+}
Modified: labs/jbossesb/workspace/jimma/product/samples/quickstarts/readme.txt
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/readme.txt 2008-07-10 06:54:27 UTC (rev 20988)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/readme.txt 2008-07-10 07:17:11 UTC (rev 20989)
@@ -83,4 +83,7 @@
JBoss ESB. It uses the Transformation engine as well as the static-routing
feature. It also demonstrations the use of multiple JVMs running different
services.
- This is a fairly advanced demonstration.
+ This is a fairly advanced demonstration.
+
+* publish_as_webservice - demonstrations how to use SOAPIn and SOAPOut action to publish
+ a esb service as a web service
Added: labs/jbossesb/workspace/jimma/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPBase.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPBase.java (rev 0)
+++ labs/jbossesb/workspace/jimma/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPBase.java 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,236 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.actions.soap;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.soap.OGNLUtils;
+import org.jboss.internal.soa.esb.webservice.ESBServiceContractPublisher;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.http.HttpClientFactory;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.ServicePublisher;
+import org.jboss.soa.esb.message.Message;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+public class SOAPBase extends AbstractActionPipelineProcessor {
+
+ protected Logger logger;
+ protected String wsdl;
+ protected String operation;
+ protected String smooksTransform;
+ protected SoapUIInvoker soapUIInvoker;
+ protected String soapNs;
+ protected static DocumentBuilderFactory docBuilderFactory = createDocumentBuilderFactory();
+ protected Properties httpClientProps = new Properties();
+ protected HttpClient httpclient;
+
+ public SOAPBase(ConfigTree config) throws ConfigurationException {
+ wsdl = config.getAttribute("wsdl");
+ if (wsdl == null) {
+ ConfigTree parentConfig = config.getParent();
+ String serviceCat = parentConfig.getAttribute("service-category");
+ String serviceName = parentConfig.getAttribute("service-name");
+ wsdl = queryPublishedWsdlAddress(serviceCat, serviceName);
+ if (wsdl == null) {
+ throw new ConfigurationException(
+ "Failed to get the wsdl url from published web service");
+ }
+ operation = serviceName + "Op";
+ }
+ extractHttpClientProps(config);
+ httpclient = HttpClientFactory.createHttpClient(httpClientProps);
+ }
+
+ private String queryPublishedWsdlAddress(String serviceCat,
+ String serviceName) {
+ for (ServicePublisher publisher : ServicePublisher
+ .getServicePublishers()) {
+ if (publisher.getContractPublisher() instanceof ESBServiceContractPublisher) {
+ ESBServiceContractPublisher contractPublisher = (ESBServiceContractPublisher) publisher
+ .getContractPublisher();
+ String jaxwsEndpoint = contractPublisher.getEndpointName();
+ if (jaxwsEndpoint.equals(serviceCat + "_" + serviceName)) {
+ return contractPublisher.getEndpointAddress() + "?wsdl";
+ }
+ }
+ }
+ return null;
+
+ }
+
+ public Message process(final Message message)
+ throws ActionProcessingException {
+ return null;
+ }
+
+ public void initialise() throws ActionLifecycleException {
+ super.initialise();
+ // Create the SoapUIInvoker instance for this SOAPClient...
+ soapUIInvoker = new SoapUIInvoker();
+ }
+
+ @Override
+ public void destroy() throws ActionLifecycleException {
+ if (httpclient != null) {
+ HttpClientFactory.shutdown(httpclient);
+ }
+ super.destroy();
+ }
+
+ private void extractHttpClientProps(ConfigTree config) {
+ ConfigTree[] httpClientConfigTrees = config
+ .getChildren("http-client-property");
+
+ httpClientProps.setProperty(HttpClientFactory.TARGET_HOST_URL, wsdl);
+ final ConfigTree parent = config.getParent();
+ if (parent != null) {
+ final String maxThreads = config.getParent().getAttribute(
+ ListenerTagNames.MAX_THREADS_TAG);
+ if (maxThreads != null) {
+ httpClientProps.setProperty(
+ HttpClientFactory.MAX_TOTAL_CONNECTIONS, maxThreads);
+ }
+ }
+
+ // The HttpClient properties are attached under the factory class/impl
+ // property as <http-client-property name="x" value="y" /> nodes
+ for (ConfigTree httpClientProp : httpClientConfigTrees) {
+ String propName = httpClientProp.getAttribute("name");
+ String propValue = httpClientProp.getAttribute("value");
+
+ if (propName != null && propValue != null) {
+ httpClientProps.setProperty(propName, propValue);
+ }
+ }
+ }
+
+ public String getSoapNS() {
+ return soapNs;
+ }
+
+ protected Map<String, String> populateResponseOgnlMap(String soapMessage)
+ throws ActionProcessingException {
+ Map<String, String> map = new LinkedHashMap<String, String>();
+
+ try {
+ DocumentBuilder docBuilder = getDocBuilder();
+ Document doc = docBuilder.parse(new InputSource(new StringReader(
+ soapMessage)));
+ Element graphRootElement = getGraphRootElement(doc
+ .getDocumentElement());
+
+ populateResponseOgnlMap(map, graphRootElement);
+ } catch (ParserConfigurationException e) {
+ throw new ActionProcessingException(
+ "Unexpected DOM Parser configuration error.", e);
+ } catch (SAXException e) {
+ throw new ActionProcessingException("Error parsing SOAP response.",
+ e);
+ } catch (IOException e) {
+ throw new ActionProcessingException(
+ "Unexpected error reading SOAP response.", e);
+ }
+
+ return map;
+ }
+
+ protected void populateResponseOgnlMap(Map<String, String> map,
+ Element element) {
+ NodeList children = element.getChildNodes();
+ int childCount = children.getLength();
+
+ // If the element has a solitary TEXT child, add the text value
+ // against a map key of the elements OGNL expression value.
+ if (childCount == 1) {
+ Node childNode = children.item(0);
+ if (childNode.getNodeType() == Node.TEXT_NODE) {
+ String ognl = OGNLUtils.getOGNLExpression(element);
+ map.put(ognl, childNode.getTextContent());
+ return;
+ }
+ }
+
+ // So the element doesn't contain a solitary TEXT node. Drill down...
+ for (int i = 0; i < childCount; i++) {
+ Node childNode = children.item(i);
+ if (childNode.getNodeType() == Node.ELEMENT_NODE) {
+ populateResponseOgnlMap(map, (Element) childNode);
+ }
+ }
+ }
+
+ private Element getGraphRootElement(Element element) {
+ String ognl = OGNLUtils.getOGNLExpression(element);
+
+ if (ognl != null && !ognl.equals("")) {
+ return element;
+ }
+
+ NodeList children = element.getChildNodes();
+ int childCount = children.getLength();
+ for (int i = 0; i < childCount; i++) {
+ Node node = children.item(i);
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ Element graphRootElement = getGraphRootElement((Element) node);
+ if (graphRootElement != null) {
+ return graphRootElement;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private static DocumentBuilderFactory createDocumentBuilderFactory() {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+
+ factory.setNamespaceAware(true);
+ factory.setExpandEntityReferences(true);
+
+ return factory;
+ }
+
+ private static synchronized DocumentBuilder getDocBuilder()
+ throws ParserConfigurationException {
+ return docBuilderFactory.newDocumentBuilder();
+ }
+}
\ No newline at end of file
Added: labs/jbossesb/workspace/jimma/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPIn.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPIn.java (rev 0)
+++ labs/jbossesb/workspace/jimma/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPIn.java 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.actions.soap;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.webservice.Constants;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class SOAPIn extends SOAPBase {
+ public SOAPIn(ConfigTree config) throws ConfigurationException {
+ super(config);
+ logger = Logger.getLogger(SOAPIn.class);
+ }
+
+ public Message process(final Message message)
+ throws ActionProcessingException {
+ if (message.getBody().get(Constants.SOAP_IN_LOC) == null) {
+ return message;
+ }
+ String soapRequest = (String) message.getBody().get(Constants.SOAP_IN_LOC);
+ Object requestObj = populateResponseOgnlMap(soapRequest);
+ message.getBody().add(requestObj);
+ return message;
+ }
+
+}
Added: labs/jbossesb/workspace/jimma/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPOut.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPOut.java (rev 0)
+++ labs/jbossesb/workspace/jimma/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPOut.java 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.actions.soap;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.jboss.internal.soa.esb.webservice.Constants;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.xml.sax.SAXException;
+
+public class SOAPOut extends SOAPBase {
+ public SOAPOut(ConfigTree config) throws ConfigurationException {
+ super(config);
+ }
+
+ public Message process(final Message message)
+ throws ActionProcessingException {
+ if (message.getBody().get(Constants.SOAP_IN_LOC) == null) {
+ //if there is no soapIn
+ return message;
+ }
+ Map params = (Map)message.getBody().get();
+ String response;
+ try {
+ response = soapUIInvoker.buildResponse(wsdl, operation, params, httpClientProps, smooksTransform, soapNs);
+ } catch (IOException e) {
+ throw new ActionProcessingException("soapUI Client Service invocation failed.", e);
+ } catch (SAXException e) {
+ throw new ActionProcessingException("soapUI Client Service invocation failed.", e);
+ }
+ message.getBody().add(Constants.SOAP_OUT_LOC, response);
+ return message;
+ }
+}
Modified: labs/jbossesb/workspace/jimma/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SoapUIInvoker.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SoapUIInvoker.java 2008-07-10 06:54:27 UTC (rev 20988)
+++ labs/jbossesb/workspace/jimma/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SoapUIInvoker.java 2008-07-10 07:17:11 UTC (rev 20989)
@@ -80,7 +80,41 @@
throw new RuntimeException("Unexpected code exit point reached!");
}
+
+ /**
+ * Build a SOAP response for the specified operation on the specified WSDL.
+ *
+ * @param wsdl WSDL URL.
+ * @param operation Operation name.
+ * @param params Message parameter map.
+ * @param httpClientProps {@link org.apache.commons.httpclient.HttpClient} creation properties.
+ * @param smooksResource {@link org.milyn.Smooks} transformation configuration resource file.
+ * Null if no transformations are to be performed on the SOAP message before serializing it
+ * for return.
+ * @param soapNs the SOAP namespace. If null one of the defaults will be used:
+ * http://schemas.xmlsoap.org/soap/envelope/
+ * http://www.w3.org/2003/05/soap-envelope
+ * @return The SOAP Message.
+ * @throws java.io.IOException Failed to load WSDL.
+ * @throws UnsupportedOperationException Operation not supported on specified WSDL.
+ * @throws org.xml.sax.SAXException Failed to parse the SOAP UI generated request message.
+ */
+ public String buildResponse(String wsdl, String operation, Map params, Properties httpClientProps, String smooksResource, String soapNs) throws IOException, UnsupportedOperationException, SAXException {
+ try {
+ return (String) mbeanServer.invoke(serviceName, "buildResponse", new Object[] {wsdl, operation, params, httpClientProps, smooksResource, soapNs}, buildRequestSig);
+ } catch (InstanceNotFoundException e) {
+ throw new UnsupportedOperationException("SOAP UI Client Service not found under name '" + serviceName.getCanonicalName() + "'. This service must be deployed before this action can be used.", e);
+ } catch (MBeanException e) {
+ rethrowException(e);
+ } catch (ReflectionException e) {
+ rethrowException(e);
+ }
+ throw new RuntimeException("Unexpected code exit point reached!");
+ }
+
+
+
/**
* Get the 1st endpoint from the specified WSDL.
*
Modified: labs/jbossesb/workspace/jimma/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java 2008-07-10 06:54:27 UTC (rev 20988)
+++ labs/jbossesb/workspace/jimma/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java 2008-07-10 07:17:11 UTC (rev 20989)
@@ -48,10 +48,16 @@
import org.xml.sax.InputSource;
import com.eviware.soapui.impl.wsdl.WsdlInterface;
+import com.eviware.soapui.impl.wsdl.WsdlOperation;
import com.eviware.soapui.impl.wsdl.WsdlProject;
+import com.eviware.soapui.impl.wsdl.mock.WsdlMockOperation;
+import com.eviware.soapui.impl.wsdl.mock.WsdlMockResponse;
+import com.eviware.soapui.impl.wsdl.mock.WsdlMockService;
import com.eviware.soapui.impl.wsdl.support.wsdl.WsdlLoader;
import com.eviware.soapui.model.iface.Operation;
+import com.eviware.soapui.model.mock.MockService;
+
/**
* Soap UI Soap Client Service MBean.
*
@@ -78,7 +84,7 @@
docBuilderFactory = DocumentBuilderFactory.newInstance();
docBuilderFactory.setNamespaceAware(true);
int smooksLRUCacheSize = properties.getIntProperty("smooks.lru.cache.size", 30);
- smooksCache = new LRUCache<String, Smooks>(smooksLRUCacheSize);
+ smooksCache = new LRUCache<String, Smooks>(smooksLRUCacheSize);
}
/**
@@ -98,11 +104,35 @@
*/
public String buildRequest(String wsdl, String operation, Map params, Properties httpClientProps, String smooksResource, String soapNs) throws IOException, UnsupportedOperationException, SAXException {
Operation operationInst = getOperation(wsdl, operation, httpClientProps);
- String requestTemplate = operationInst.getRequestAt(0).getRequestContent();
-
- return buildRequest(requestTemplate, params, smooksResource, soapNs);
+ String requestTemplate = operationInst.getRequestAt(0).getRequestContent();
+
+ return buildSOAPMessage(requestTemplate, params, smooksResource, soapNs);
}
+
+ /**
+ * Use soapUI to build a SOAP response for the specified operation on the specified WSDL.
+ *
+ * @param wsdl WSDL URL
+ * @param operation Operation name.
+ * @param params Message parameter map.
+ * @param httpClientProps {@link org.apache.commons.httpclient.HttpClient} creation properties.
+ * @param smooksResource {@link org.milyn.Smooks} transformation configuration resource file.
+ * Null if no transformations are to be performed on the SOAP message before serializing it
+ * for return.
+ * @param soapNs optional SOAP namespace
+ * @return The SOAP Message.
+ * @throws IOException Failed to load WSDL.
+ * @throws UnsupportedOperationException Operation not supported on specified WSDL.
+ * @throws SAXException Failed to parse the SOAP UI generated request message.
+ */
+ public String buildResponse(String wsdl, String operation, Map params, Properties httpClientProps, String smooksResource, String soapNs) throws IOException, UnsupportedOperationException, SAXException {
+ Operation operationInst = getOperation(wsdl, operation, httpClientProps);
+ WsdlOperation wsdlOperation = (WsdlOperation)operationInst;
+ String responseTemplate = wsdlOperation.createResponse(true);
+ return buildSOAPMessage(responseTemplate, params, smooksResource, soapNs);
+ }
+
/**
* Get the 1st endpoint from the specified WSDL.
*
@@ -124,7 +154,7 @@
WsdlProject wsdlProject = new WsdlProject();
wsdlInterfaces = wsdlProject.importWsdl(wsdl, true, createWsdlLoader(wsdl, httpClientProps));
wsdls.put(wsdl, wsdlInterfaces);
- }
+ }
return wsdlInterfaces;
} catch (Exception e) {
IOException ioe = new IOException("Failed to import WSDL '" + wsdl + "'.");
@@ -165,7 +195,7 @@
return new EsbWsdlLoader(wsdl, httpClient);
}
- private String buildRequest(String soapMessageTemplate, Map params, String smooksResource, String soapNs) throws IOException, SAXException {
+ private String buildSOAPMessage(String soapMessageTemplate, Map params, String smooksResource, String soapNs) throws IOException, SAXException {
Document messageDoc = getDocBuilder().parse(new InputSource(new StringReader(soapMessageTemplate)));
Element docRoot = messageDoc.getDocumentElement();
Modified: labs/jbossesb/workspace/jimma/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientServiceMBean.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientServiceMBean.java 2008-07-10 06:54:27 UTC (rev 20988)
+++ labs/jbossesb/workspace/jimma/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientServiceMBean.java 2008-07-10 07:17:11 UTC (rev 20989)
@@ -55,6 +55,23 @@
public abstract String buildRequest(String wsdl, String operation, Map params, Properties httpClientProps, String smooksResource, String soapNs) throws IOException, UnsupportedOperationException, SAXException;
/**
+ * Use soapUI mockService to Build a SOAP response for the specified operation on the specified WSDL.
+ *
+ * @param wsdl WSDL URL.
+ * @param operation Operation name.
+ * @param params Message parameter map..
+ * @param smooksResource {@link org.milyn.Smooks} transformation configuration resource file.
+ * Null if no transformations are to be performed on the SOAP message before serializing it
+ * for return.
+ * @param soapNs optional SOAP namespace
+ * @return The SOAP Message.
+ * @throws IOException Failed to load WSDL.
+ * @throws UnsupportedOperationException Operation not supported on specified WSDL.
+ * @throws SAXException Failed to parse the SOAP UI generated request message.
+ */
+ public abstract String buildResponse(String wsdl, String operation, Map params, Properties httpClientProps, String smooksResource, String soapNs) throws IOException, UnsupportedOperationException, SAXException;
+
+ /**
* Get the 1st endpoint from the specified WSDL.
*
* @param wsdl WSDL URL.
Modified: labs/jbossesb/workspace/jimma/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/SoapUIClientServiceMBeanUnitTest.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/SoapUIClientServiceMBeanUnitTest.java 2008-07-10 06:54:27 UTC (rev 20988)
+++ labs/jbossesb/workspace/jimma/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/SoapUIClientServiceMBeanUnitTest.java 2008-07-10 07:17:11 UTC (rev 20989)
@@ -312,6 +312,17 @@
assertEquals("http://localhost:18080/active-bpel/services/RetailerCallback", mbean.getEndpoint(wsdlFile.toURI().toString(), properties));
}
+ public void test_BuildResponse() throws Exception {
+ File wsdlFile = new File(WSDL_LOCATAION + "/helloworld.wsdl");
+ properties.setProperty(HttpClientFactory.TARGET_HOST_URL, wsdlFile.toURI().toString());
+ SoapUIClientService mbean = new SoapUIClientService();
+ Map<Object, Object> paras = new HashMap<Object, Object>();
+ paras.put("sayHiReponse.arg0", "response");
+ String str = mbean.buildReponse(wsdlFile.toURL().toString(), "HelloWorldPubServiceOp", paras, properties, null, null);
+ assertTrue("Failed to generate correct soap response", str.indexOf("<say:arg0>response</say:arg0>") > -1);
+ }
+
+
private void addOrderItems(List<OrderItem> items) {
items.add(new OrderItem(1, "item1", 1, new BigDecimal(1.00), 1));
items.add(new OrderItem(2, "item2", 2, new BigDecimal(2.00), 2));
@@ -390,4 +401,8 @@
System.out.println("compare returns: " + compareCharStreams(expectedIS, outputIS));
}
+
+
+
+
}
Added: labs/jbossesb/workspace/jimma/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/helloworld.wsdl
===================================================================
--- labs/jbossesb/workspace/jimma/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/helloworld.wsdl (rev 0)
+++ labs/jbossesb/workspace/jimma/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/helloworld.wsdl 2008-07-10 07:17:11 UTC (rev 20989)
@@ -0,0 +1,71 @@
+<wsdl:definitions targetNamespace='http://soa.jboss.org/ESBServiceSample' xmlns:ns1='http://www.jboss.org/sayHi' xmlns:ns2='http://www.jboss.org/sayHi' xmlns:ns3='http://www.jboss.org/sayHi' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://soa.jboss.org/ESBServiceSample' xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'>
+ <wsdl:types>
+ <xs:schema elementFormDefault='qualified' targetNamespace='http://www.jboss.org/sayHi' version='1.0' xmlns:x1='http://www.jboss.org/sayHi' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
+ <xs:element name='sayHi' type='x1:sayHi'/>
+ <xs:complexType name='sayHi'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='arg0' type='xs:string'/>
+ </xs:sequence>
+ </xs:complexType>
+
+ </xs:schema>
+ <xs:schema elementFormDefault='qualified' targetNamespace='http://www.jboss.org/sayHi' version='1.0' xmlns:x1='http://www.jboss.org/sayHi' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
+ <xs:element name='sayHiReponse' type='x1:sayHiReponse'/>
+ <xs:complexType name='sayHiReponse'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='arg0' type='xs:string'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+
+ <xs:schema elementFormDefault='qualified' targetNamespace='http://www.jboss.org/sayHi' version='1.0' xmlns:x1='http://www.jboss.org/sayHi' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
+ <xs:element name='sayFault' type='x1:fault'/>
+ <xs:complexType name='fault'>
+ <xs:sequence>
+ <xs:element name='code' type='xs:string'/>
+ <xs:element name='faultString' type='xs:string'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+
+ </wsdl:types>
+ <wsdl:message name='HelloWorldPubServiceReq'>
+ <wsdl:part element='ns1:sayHi' name='in'></wsdl:part>
+ </wsdl:message>
+ <wsdl:message name='HelloWorldPubServiceRes'>
+ <wsdl:part element='ns1:sayHiReponse' name='out'></wsdl:part>
+ </wsdl:message>
+ <wsdl:message name='HelloWorldPubServiceFault1'>
+ <wsdl:part element='ns1:sayFault' name='fault1'></wsdl:part>
+
+ </wsdl:message>
+ <wsdl:portType name='HelloWorldPubServicePortType'>
+ <wsdl:operation name='HelloWorldPubServiceOp'>
+ <wsdl:input message='tns:HelloWorldPubServiceReq' name='HelloWorldPubServiceReq'></wsdl:input>
+ <wsdl:output message='tns:HelloWorldPubServiceRes' name='HelloWorldPubServiceRes'></wsdl:output>
+ <wsdl:fault message='tns:HelloWorldPubServiceFault1' name='HelloWorldPubServiceFault1'></wsdl:fault>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name='HelloWorldPubServiceBinding' type='tns:HelloWorldPubServicePortType'>
+
+ <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <wsdl:operation name='HelloWorldPubServiceOp'>
+ <wsdl:input>
+ <soap:body use='literal'/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use='literal'/>
+ </wsdl:output>
+ <wsdl:fault name='HelloWorldPubServiceFault1'>
+
+ <soap:fault name='HelloWorldPubServiceFault1' use='literal'/>
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name='HelloWorldPubServiceService'>
+ <wsdl:port binding='tns:HelloWorldPubServiceBinding' name='HelloWorldPubServicePortType'>
+ <soap:address location='http://127.0.0.1:8080/Quickstart_helloworld_pub_service/ESBServiceSample/HelloWorldPubService'/>
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
\ No newline at end of file
More information about the jboss-svn-commits
mailing list