[jboss-svn-commits] JBL Code SVN: r35163 - in labs/jbossesb/branches/JBESB_4_9_CP/product: docs/Programmers_Guide/en-US/extras/OOB-Actions and 6 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Sep 16 06:01:52 EDT 2010


Author: mageshbk at jboss.com
Date: 2010-09-16 06:01:51 -0400 (Thu, 16 Sep 2010)
New Revision: 35163

Added:
   labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/src/org/jboss/soa/esb/samples/quickstart/webserviceproducer/webservice/HelloWorldWS.java
   labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/war/resources-alternate/
   labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/war/resources-alternate/WEB-INF/
   labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/war/resources-alternate/WEB-INF/jboss-web.xml
   labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/war/resources-alternate/WEB-INF/web.xml
Modified:
   labs/jbossesb/branches/JBESB_4_9_CP/product/docs/Programmers_Guide/en-US/OOB-Actions/OOB_Actions_webservices_SOAP.xml
   labs/jbossesb/branches/JBESB_4_9_CP/product/docs/Programmers_Guide/en-US/extras/OOB-Actions/webservices_SOAP-jbossws-endpoint.xmlt
   labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/build.xml
   labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/jboss-esb.xml
   labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/readme.txt
   labs/jbossesb/branches/JBESB_4_9_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/JBossWSWebserviceContractPublisher.java
   labs/jbossesb/branches/JBESB_4_9_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPProcessor.java
   labs/jbossesb/branches/JBESB_4_9_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WebServiceUtils.java
Log:
[JBESB-3420] - Added jbossws-context property to SOAPProcessor action

Modified: labs/jbossesb/branches/JBESB_4_9_CP/product/docs/Programmers_Guide/en-US/OOB-Actions/OOB_Actions_webservices_SOAP.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_9_CP/product/docs/Programmers_Guide/en-US/OOB-Actions/OOB_Actions_webservices_SOAP.xml	2010-09-16 09:50:55 UTC (rev 35162)
+++ labs/jbossesb/branches/JBESB_4_9_CP/product/docs/Programmers_Guide/en-US/OOB-Actions/OOB_Actions_webservices_SOAP.xml	2010-09-16 10:01:51 UTC (rev 35163)
@@ -51,6 +51,15 @@
                     </listitem>
                 </varlistentry>
                 <varlistentry>
+                    <term><property>jbossws-context</property></term>
+                    <listitem>
+                        <para>
+                        This optional property is the context name of the Webservice's deployment and
+                        can be used to uniquely identify the JBossWS endpoint.
+                        </para>
+                    </listitem>
+                </varlistentry>
+                <varlistentry>
                     <term><property>rewrite-endpoint-url</property></term>
                     <listitem>
                         <para>

Modified: labs/jbossesb/branches/JBESB_4_9_CP/product/docs/Programmers_Guide/en-US/extras/OOB-Actions/webservices_SOAP-jbossws-endpoint.xmlt
===================================================================
--- labs/jbossesb/branches/JBESB_4_9_CP/product/docs/Programmers_Guide/en-US/extras/OOB-Actions/webservices_SOAP-jbossws-endpoint.xmlt	2010-09-16 09:50:55 UTC (rev 35162)
+++ labs/jbossesb/branches/JBESB_4_9_CP/product/docs/Programmers_Guide/en-US/extras/OOB-Actions/webservices_SOAP-jbossws-endpoint.xmlt	2010-09-16 10:01:51 UTC (rev 35163)
@@ -1,4 +1,5 @@
 <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.SOAPProcessor">
     <property name="jbossws-endpoint" value="ABI_OrderManager" />
+    <property name="jbossws-context" value="ABIV1OrderManager_war" />
     <property name="rewrite-endpoint-url" value="true" />
 </action>
\ No newline at end of file

Modified: labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/build.xml	2010-09-16 09:50:55 UTC (rev 35162)
+++ labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/build.xml	2010-09-16 10:01:51 UTC (rev 35163)
@@ -8,6 +8,8 @@
 	<!-- Import the base Ant build script... -->
 	<import file="../conf/base-build.xml"/>
 
+    <property name="quickstart.classes.excludes" value="**/webserviceproducer/webservice/*"/>
+
     <target name="quickstart-specific-checks" depends="assert-ws-available"/>
 
     <target name="quickstart-specific-dependencies">
@@ -15,23 +17,50 @@
             <fileset dir="${org.jboss.esb.server.home}/client" includes="jbossws-client.jar,jboss-remoting.jar" />
         </path>
     </target>
-	
-    <target name="quickstart-specific-assemblies">
-        <!-- Overriden from the target of the same name in base-build.xml. -->
-        <!-- Called by the "deploy" target.  Don't call directly!! -->
 
+    <target name="makewar" depends="prepare-deployment">
+
         <!-- Build the webservice... -->
         <war warfile="build/${ant.project.name}.war"
              webxml="${basedir}/war/resources/WEB-INF/web.xml">
 			<webinf dir="${basedir}/war/resources/WEB-INF">
                 <include name="jboss-web.xml"/>
             </webinf>
-            <fileset dir="${basedir}/war/view">
-                <include name="**/*"/>
-            </fileset>
+            <classes dir="${build.dir}/classes">
+                <include name="**/webserviceproducer/webservice/GoodbyeWorldWS.class"/>
+            </classes>
         </war>
+
+        <!-- Build the webservice... -->
+        <war warfile="build/${ant.project.name}_alternate.war"
+             webxml="${basedir}/war/resources-alternate/WEB-INF/web.xml">
+			<webinf dir="${basedir}/war/resources-alternate/WEB-INF">
+                <include name="jboss-web.xml"/>
+            </webinf>
+            <classes dir="${build.dir}/classes">
+                <include name="**/webserviceproducer/webservice/HelloWorldWS.class"/>
+            </classes>
+        </war>
     </target>
 
+	<target name="deploy" depends="makewar">
+		<copy todir="${org.jboss.esb.server.deploy.dir}"
+			file="${build.dir}/${ant.project.name}.war"/>
+		<copy todir="${org.jboss.esb.server.deploy.dir}"
+			file="${build.dir}/${ant.project.name}_alternate.war"/>
+		<copy todir="${org.jboss.esb.server.deploy.dir}"
+			file="${build.dir}/${ant.project.name}.esb"/>
+	</target>
+
+	<target name="undeploy" depends="dependencies">
+		<delete verbose="true" quiet="true"
+			file="${org.jboss.esb.server.deploy.dir}/${ant.project.name}.esb"/>
+		<delete verbose="true" quiet="true"
+			file="${org.jboss.esb.server.deploy.dir}/${ant.project.name}.war"/>
+		<delete verbose="true" quiet="true"
+			file="${org.jboss.esb.server.deploy.dir}/${ant.project.name}_alternate.war"/>
+	</target>
+
     <target name="runtest" depends="compile" description="run tests over jms, http, and socket">
         <antcall target="saygoodbye_over_jms" />
         <antcall target="saygoodbye_over_http" />

Modified: labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/jboss-esb.xml	2010-09-16 09:50:55 UTC (rev 35162)
+++ labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/jboss-esb.xml	2010-09-16 10:01:51 UTC (rev 35163)
@@ -40,6 +40,7 @@
                               value="[Quickstart_webservice_producer] BEFORE invoking jbossws endpoint"/>
                 </action>
                 <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.SOAPProcessor">
+                    <property name="jbossws-context" value="Quickstart_webservice_producer_esb"/>
                     <property name="jbossws-endpoint" value="GoodbyeWorldWS"/>
                 </action>
                 <action name="print-after" class="org.jboss.soa.esb.actions.SystemPrintln">

Modified: labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/readme.txt
===================================================================
--- labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/readme.txt	2010-09-16 09:50:55 UTC (rev 35162)
+++ labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/readme.txt	2010-09-16 10:01:51 UTC (rev 35163)
@@ -1,7 +1,10 @@
 Overview:
 =========
   This sample demonstrates how to deploy a JSR181 Webservice endpoint on
-  JBossESB using the SOAPProcessor action.  
+  JBossESB using the SOAPProcessor action. The sample also demonstrates 
+  the usage of optional property jbossws-context to uniquely identify the
+  correct endpoint. In the absence of this property the action will use the
+  alternate endpoint and will fail.
 
 Running this quickstart:
 ========================

Added: labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/src/org/jboss/soa/esb/samples/quickstart/webserviceproducer/webservice/HelloWorldWS.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/src/org/jboss/soa/esb/samples/quickstart/webserviceproducer/webservice/HelloWorldWS.java	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/src/org/jboss/soa/esb/samples/quickstart/webserviceproducer/webservice/HelloWorldWS.java	2010-09-16 10:01:51 UTC (rev 35163)
@@ -0,0 +1,38 @@
+/*
+ * 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, 2007,
+ */
+package org.jboss.soa.esb.samples.quickstart.webserviceproducer.webservice;
+
+import javax.jws.WebService;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * @author
+ */
+ at WebService(name = "GoodbyeWorldWS", targetNamespace="http://webservice_producer/goodbyeworld")
+public class HelloWorldWS {
+
+    @WebMethod
+    public String sayHello(@WebParam(name="message") String message) {
+        System.out.println("Web Service Parameter - message=" + message);
+        return "... Ah Hello then!!!! - " + message;
+    }
+}

Added: labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/war/resources-alternate/WEB-INF/jboss-web.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/war/resources-alternate/WEB-INF/jboss-web.xml	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/war/resources-alternate/WEB-INF/jboss-web.xml	2010-09-16 10:01:51 UTC (rev 35163)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-web>
+	<context-root>/Quickstart_webservice_producer_alternate_esb</context-root>
+</jboss-web>
+

Added: labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/war/resources-alternate/WEB-INF/web.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/war/resources-alternate/WEB-INF/web.xml	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_9_CP/product/samples/quickstarts/webservice_producer/war/resources-alternate/WEB-INF/web.xml	2010-09-16 10:01:51 UTC (rev 35163)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+         version="2.4">
+
+    <servlet>
+        <servlet-name>GoodbyeWorldWS</servlet-name>
+        <servlet-class>org.jboss.soa.esb.samples.quickstart.webserviceproducer.webservice.HelloWorldWS</servlet-class>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>GoodbyeWorldWS</servlet-name>
+        <url-pattern>/GoodbyeWorldWS</url-pattern>
+    </servlet-mapping>
+
+</web-app>

Modified: labs/jbossesb/branches/JBESB_4_9_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/JBossWSWebserviceContractPublisher.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_9_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/JBossWSWebserviceContractPublisher.java	2010-09-16 09:50:55 UTC (rev 35162)
+++ labs/jbossesb/branches/JBESB_4_9_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/JBossWSWebserviceContractPublisher.java	2010-09-16 10:01:51 UTC (rev 35163)
@@ -35,6 +35,7 @@
 
     private static Logger logger = Logger.getLogger(JBossWSWebserviceContractPublisher.class);
     private String endpointName;
+    private String contextName;
 
     /**
      * Set the {@link SOAPProcessor} action configuration.
@@ -46,13 +47,14 @@
         super.setActionConfig(actionConfig);
 
         endpointName = actionConfig.getProperties().getProperty(WebServiceUtils.JBOSSWS_ENDPOINT);
+        contextName = actionConfig.getProperties().getProperty(WebServiceUtils.JBOSSWS_CONTEXT);
         if(endpointName == null) {
             throw new ConfigurationException("Property '" + WebServiceUtils.JBOSSWS_ENDPOINT + "' not specified.");
         }
     }
 
     public String getWsdlAddress() {
-        Endpoint endpoint = WebServiceUtils.getServiceEndpoint(endpointName);
+        Endpoint endpoint = WebServiceUtils.getServiceEndpoint(endpointName, contextName);
 
         if(endpoint != null) {
             return endpoint.getAddress() + "?wsdl";

Modified: labs/jbossesb/branches/JBESB_4_9_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPProcessor.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_9_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPProcessor.java	2010-09-16 09:50:55 UTC (rev 35162)
+++ labs/jbossesb/branches/JBESB_4_9_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPProcessor.java	2010-09-16 10:01:51 UTC (rev 35163)
@@ -114,6 +114,7 @@
 
     private static ThreadLocal<Message> messageTL = new ThreadLocal<Message>();
     private String jbossws_endpoint;
+    private String jbossws_context;
     private MessagePayloadProxy payloadProxy;
     private boolean httpResponseStatusEnabled;
 
@@ -124,6 +125,7 @@
      */
     public SOAPProcessor(ConfigTree config) throws ConfigurationException {
         jbossws_endpoint = config.getRequiredAttribute(WebServiceUtils.JBOSSWS_ENDPOINT);
+        jbossws_context = config.getAttribute(WebServiceUtils.JBOSSWS_CONTEXT);
         payloadProxy = new MessagePayloadProxy(config,
                                                new String[] {BytesBody.BYTES_LOCATION, ActionUtils.POST_ACTION_DATA},
                                                new String[] {ActionUtils.POST_ACTION_DATA});
@@ -139,7 +141,7 @@
      * @throws ActionProcessingException
      */
     public Message process(Message message) throws ActionProcessingException {
-        Endpoint endpoint = WebServiceUtils.getServiceEndpoint(jbossws_endpoint);
+        Endpoint endpoint = WebServiceUtils.getServiceEndpoint(jbossws_endpoint, jbossws_context);
         byte[] soapMessage;
 
         if(endpoint == null) {

Modified: labs/jbossesb/branches/JBESB_4_9_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WebServiceUtils.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_9_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WebServiceUtils.java	2010-09-16 09:50:55 UTC (rev 35162)
+++ labs/jbossesb/branches/JBESB_4_9_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WebServiceUtils.java	2010-09-16 10:01:51 UTC (rev 35163)
@@ -58,24 +58,32 @@
  */
 public class WebServiceUtils
 {
+    public static final String JBOSSWS_CONTEXT = "jbossws-context";
     public static final String JBOSSWS_ENDPOINT = "jbossws-endpoint";
 
     /**
      * Get the Service Endpoint based on the endpoint's short name.
+     * An optional Deployment Context name can also be specified for uniqueness.
      *
      * @param endpointName Service Endpoint name.
+     * @param contextName Service's Deployment Context name.
      * @return The service endpoint, or null if the endpoint is not found.
      */
-    public static Endpoint getServiceEndpoint(String endpointName) {
+    public static Endpoint getServiceEndpoint(String endpointName, String contextName) {
         SPIProvider spiProv = SPIProviderResolver.getInstance().getProvider();
         EndpointRegistryFactory factory =  spiProv.getSPI(EndpointRegistryFactory.class);
         EndpointRegistry registry = factory.getEndpointRegistry();
         Set<ObjectName> objectNames = registry.getEndpoints();
 
         for (ObjectName objectName : objectNames) {
+            String context = objectName.getKeyProperty(Endpoint.SEPID_PROPERTY_CONTEXT);
             String endpoint = objectName.getKeyProperty(Endpoint.SEPID_PROPERTY_ENDPOINT);
 
-            if (endpoint != null && endpoint.equals(endpointName)) {
+            if ((contextName != null
+                && context != null && context.equals(contextName)
+                && endpoint != null && endpoint.equals(endpointName))
+                || (contextName == null
+                    && endpoint != null && endpoint.equals(endpointName))) {
                 return registry.getEndpoint(objectName);
             }
         }



More information about the jboss-svn-commits mailing list