Author: objectiser
Date: 2010-05-28 07:08:19 -0400 (Fri, 28 May 2010)
New Revision: 679
Added:
trunk/distribution/src/main/release/db/wsstack/
trunk/distribution/src/main/release/db/wsstack/cxf.properties
trunk/distribution/src/main/release/db/wsstack/native.properties
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/CXFJAXWSInitializer.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/JAXWSInitializer.java
trunk/samples/quickstart/secure_invoke/
trunk/samples/quickstart/secure_invoke/.settings/
trunk/samples/quickstart/secure_invoke/.settings/org.eclipse.wst.common.component
trunk/samples/quickstart/secure_invoke/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/samples/quickstart/secure_invoke/bpelContent/
trunk/samples/quickstart/secure_invoke/bpelContent/SecureHelloWorldWS.wsdl
trunk/samples/quickstart/secure_invoke/bpelContent/SecureInvoke.bpel
trunk/samples/quickstart/secure_invoke/bpelContent/SecureInvoke.wsdl
trunk/samples/quickstart/secure_invoke/bpelContent/bpel-deploy.xml
trunk/samples/quickstart/secure_invoke/bpelContent/etc/
trunk/samples/quickstart/secure_invoke/bpelContent/etc/Client_Encrypt.properties
trunk/samples/quickstart/secure_invoke/bpelContent/etc/Client_Sign.properties
trunk/samples/quickstart/secure_invoke/bpelContent/jbossws-cxf-SecureHelloWorldPort.xml
trunk/samples/quickstart/secure_invoke/bpelContent/keystore/
trunk/samples/quickstart/secure_invoke/bpelContent/keystore/client-keystore.jks
trunk/samples/quickstart/secure_invoke/bpelContent/keystore/client-truststore.jks
trunk/samples/quickstart/secure_invoke/build.xml
trunk/samples/quickstart/secure_invoke/messages/
trunk/samples/quickstart/secure_invoke/messages/hello_request1.xml
trunk/samples/quickstart/secure_invoke/readme.txt
trunk/samples/quickstart/secure_invoke/war/
trunk/samples/quickstart/secure_invoke/war/resources/
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/classes/
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/etc/
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/etc/Server_Decrypt.properties
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/etc/Server_SignVerf.properties
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/jbossws-cxf.xml
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/keystore/
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/keystore/server-keystore.jks
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/keystore/server-truststore.jks
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/lib/
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/web.xml
trunk/samples/quickstart/secure_invoke/war/src/
trunk/samples/quickstart/secure_invoke/war/src/jws_handlers.xml
trunk/samples/quickstart/secure_invoke/war/src/org/
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/soa/
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/soa/bpel/
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/soa/bpel/examples/
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/soa/bpel/examples/jaxws/
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/soa/bpel/examples/jaxws/JAXWSHandler.java
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/soa/bpel/samples/
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/soa/bpel/samples/quickstart/
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/soa/bpel/samples/quickstart/secure_invoke/
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/soa/bpel/samples/quickstart/secure_invoke/SecureHelloWorldWS.java
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/test/
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/test/ws/
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/test/ws/jaxws/
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/test/ws/jaxws/samples/
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/test/ws/jaxws/samples/wsse/
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/test/ws/jaxws/samples/wsse/ClientUsernamePasswordCallback.java
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java
trunk/samples/quickstart/secure_invoke/war/view/
trunk/samples/quickstart/secure_invoke/war/view/index.jsp
trunk/samples/quickstart/secure_service/
trunk/samples/quickstart/secure_service/.project
trunk/samples/quickstart/secure_service/.settings/
trunk/samples/quickstart/secure_service/.settings/org.eclipse.wst.common.component
trunk/samples/quickstart/secure_service/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/samples/quickstart/secure_service/bpelContent/
trunk/samples/quickstart/secure_service/bpelContent/HelloWorld.bpel
trunk/samples/quickstart/secure_service/bpelContent/HelloWorld.bpelex
trunk/samples/quickstart/secure_service/bpelContent/HelloWorld.wsdl
trunk/samples/quickstart/secure_service/bpelContent/bpel-deploy.xml
trunk/samples/quickstart/secure_service/bpelContent/etc/
trunk/samples/quickstart/secure_service/bpelContent/etc/Server_Decrypt.properties
trunk/samples/quickstart/secure_service/bpelContent/etc/Server_SignVerf.properties
trunk/samples/quickstart/secure_service/bpelContent/jbossws-cxf.xml
trunk/samples/quickstart/secure_service/bpelContent/jws_handlers.xml
trunk/samples/quickstart/secure_service/bpelContent/keystore/
trunk/samples/quickstart/secure_service/bpelContent/keystore/server-keystore.jks
trunk/samples/quickstart/secure_service/bpelContent/keystore/server-truststore.jks
trunk/samples/quickstart/secure_service/build.xml
trunk/samples/quickstart/secure_service/client/
trunk/samples/quickstart/secure_service/client/resources/
trunk/samples/quickstart/secure_service/client/resources/etc/
trunk/samples/quickstart/secure_service/client/resources/etc/Client_Encrypt.properties
trunk/samples/quickstart/secure_service/client/resources/etc/Client_Sign.properties
trunk/samples/quickstart/secure_service/client/resources/keystore/
trunk/samples/quickstart/secure_service/client/resources/keystore/client-keystore.jks
trunk/samples/quickstart/secure_service/client/resources/keystore/client-truststore.jks
trunk/samples/quickstart/secure_service/client/resources/wssec.xml
trunk/samples/quickstart/secure_service/client/src/
trunk/samples/quickstart/secure_service/client/src/org/
trunk/samples/quickstart/secure_service/client/src/org/jboss/
trunk/samples/quickstart/secure_service/client/src/org/jboss/soa/
trunk/samples/quickstart/secure_service/client/src/org/jboss/soa/bpel/
trunk/samples/quickstart/secure_service/client/src/org/jboss/soa/bpel/examples/
trunk/samples/quickstart/secure_service/client/src/org/jboss/soa/bpel/examples/jaxws/
trunk/samples/quickstart/secure_service/client/src/org/jboss/soa/bpel/examples/jaxws/JAXWSDispatcherClient.java
trunk/samples/quickstart/secure_service/client/src/org/jboss/test/
trunk/samples/quickstart/secure_service/client/src/org/jboss/test/ws/
trunk/samples/quickstart/secure_service/client/src/org/jboss/test/ws/jaxws/
trunk/samples/quickstart/secure_service/client/src/org/jboss/test/ws/jaxws/samples/
trunk/samples/quickstart/secure_service/client/src/org/jboss/test/ws/jaxws/samples/wsse/
trunk/samples/quickstart/secure_service/client/src/org/jboss/test/ws/jaxws/samples/wsse/ClientUsernamePasswordCallback.java
trunk/samples/quickstart/secure_service/client/src/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java
trunk/samples/quickstart/secure_service/messages/
trunk/samples/quickstart/secure_service/messages/hello_request1.xml
trunk/samples/quickstart/secure_service/readme.txt
trunk/samples/quickstart/secure_service/server/
trunk/samples/quickstart/secure_service/server/src/
trunk/samples/quickstart/secure_service/server/src/org/
trunk/samples/quickstart/secure_service/server/src/org/jboss/
trunk/samples/quickstart/secure_service/server/src/org/jboss/soa/
trunk/samples/quickstart/secure_service/server/src/org/jboss/soa/bpel/
trunk/samples/quickstart/secure_service/server/src/org/jboss/soa/bpel/examples/
trunk/samples/quickstart/secure_service/server/src/org/jboss/soa/bpel/examples/jaxws/
trunk/samples/quickstart/secure_service/server/src/org/jboss/soa/bpel/examples/jaxws/JAXWSHandler.java
trunk/samples/quickstart/secure_service/server/src/org/jboss/test/
trunk/samples/quickstart/secure_service/server/src/org/jboss/test/ws/
trunk/samples/quickstart/secure_service/server/src/org/jboss/test/ws/jaxws/
trunk/samples/quickstart/secure_service/server/src/org/jboss/test/ws/jaxws/samples/
trunk/samples/quickstart/secure_service/server/src/org/jboss/test/ws/jaxws/samples/wsse/
trunk/samples/quickstart/secure_service/server/src/org/jboss/test/ws/jaxws/samples/wsse/ClientUsernamePasswordCallback.java
trunk/samples/quickstart/secure_service/server/src/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java
trunk/samples/quickstart/secure_service/wssec.xml
trunk/samples/quickstart/service_handler/
trunk/samples/quickstart/service_handler/.settings/
trunk/samples/quickstart/service_handler/.settings/org.eclipse.wst.common.component
trunk/samples/quickstart/service_handler/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/samples/quickstart/service_handler/bpelContent/
trunk/samples/quickstart/service_handler/bpelContent/HelloWorld.bpel
trunk/samples/quickstart/service_handler/bpelContent/HelloWorld.wsdl
trunk/samples/quickstart/service_handler/bpelContent/bpel-deploy.xml
trunk/samples/quickstart/service_handler/bpelContent/jws_handlers.xml
trunk/samples/quickstart/service_handler/build.xml
trunk/samples/quickstart/service_handler/code/
trunk/samples/quickstart/service_handler/code/src/
trunk/samples/quickstart/service_handler/code/src/org/
trunk/samples/quickstart/service_handler/code/src/org/jboss/
trunk/samples/quickstart/service_handler/code/src/org/jboss/soa/
trunk/samples/quickstart/service_handler/code/src/org/jboss/soa/bpel/
trunk/samples/quickstart/service_handler/code/src/org/jboss/soa/bpel/examples/
trunk/samples/quickstart/service_handler/code/src/org/jboss/soa/bpel/examples/jaxws/
trunk/samples/quickstart/service_handler/code/src/org/jboss/soa/bpel/examples/jaxws/JAXWSHandler.java
trunk/samples/quickstart/service_handler/messages/
trunk/samples/quickstart/service_handler/messages/hello_request1.xml
trunk/samples/quickstart/service_handler/readme.txt
Modified:
trunk/distribution/src/main/assembly/bin.xml
trunk/distribution/src/main/release/db/bpel.properties
trunk/distribution/src/main/release/install/build.xml
trunk/pom.xml
trunk/runtime/engine/pom.xml
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/DeploymentBuilder.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceProviderFactory.java
Log:
RIFTSAW-75 - support ws-security.
Only supported on the jbossws-cxf stack. Includes examples that demonstrate username token
and signature authentication.
Modified: trunk/distribution/src/main/assembly/bin.xml
===================================================================
--- trunk/distribution/src/main/assembly/bin.xml 2010-05-28 05:11:17 UTC (rev 678)
+++ trunk/distribution/src/main/assembly/bin.xml 2010-05-28 11:08:19 UTC (rev 679)
@@ -68,14 +68,17 @@
<include>esb/bpel_helloworld/**</include>
<include>esb/bpel_loan_fault/**</include>
<include>esb/webservice_esb_bpel/**</include>
+ <include>quickstart/bpel_event_listener/**</include>
<include>quickstart/hello_world/**</include>
<include>quickstart/hello_world_header_ode/**</include>
<include>quickstart/hello_world_header_wsdl/**</include>
<include>quickstart/loan_approval/**</include>
+ <include>quickstart/secure_invoke/**</include>
+ <include>quickstart/secure_service/**</include>
+ <include>quickstart/service_handler/**</include>
<include>quickstart/simple_correlation/**</include>
<include>quickstart/simple_invoke/**</include>
<include>quickstart/simple_pick/**</include>
- <include>quickstart/bpel_event_listener/**</include>
<include>tutorial/BPEL-BluePrint1/**</include>
<include>tutorial/BPEL-BluePrint2/**</include>
<include>tutorial/BPEL-BluePrint3/**</include>
Modified: trunk/distribution/src/main/release/db/bpel.properties
===================================================================
--- trunk/distribution/src/main/release/db/bpel.properties 2010-05-28 05:11:17 UTC (rev
678)
+++ trunk/distribution/src/main/release/db/bpel.properties 2010-05-28 11:08:19 UTC (rev
679)
@@ -105,6 +105,8 @@
# name of the clerk
bpel.uddi.clerk=BPELClerk
+bpel.jaxws.client.initializer.impl=(a)jaxws.client.initializer.impl@
+
hibernate.dialect=@dialect@
hibernate.hbm2ddl.auto=update
hibernate.current_session_context_class=jta
Added: trunk/distribution/src/main/release/db/wsstack/cxf.properties
===================================================================
--- trunk/distribution/src/main/release/db/wsstack/cxf.properties
(rev 0)
+++ trunk/distribution/src/main/release/db/wsstack/cxf.properties 2010-05-28 11:08:19 UTC
(rev 679)
@@ -0,0 +1 @@
+jaxws.client.initializer.impl=org.jboss.soa.bpel.runtime.ws.CXFJAXWSInitializer
Added: trunk/distribution/src/main/release/db/wsstack/native.properties
===================================================================
--- trunk/distribution/src/main/release/db/wsstack/native.properties
(rev 0)
+++ trunk/distribution/src/main/release/db/wsstack/native.properties 2010-05-28 11:08:19
UTC (rev 679)
@@ -0,0 +1 @@
+jaxws.client.initializer.impl=
Modified: trunk/distribution/src/main/release/install/build.xml
===================================================================
--- trunk/distribution/src/main/release/install/build.xml 2010-05-28 05:11:17 UTC (rev
678)
+++ trunk/distribution/src/main/release/install/build.xml 2010-05-28 11:08:19 UTC (rev
679)
@@ -81,6 +81,7 @@
toFile="${deploy.dir}/${bpel-runtime}/bpel.properties"
overwrite="true">
<filterset filtersfile="../db/jdbc/${database}.properties" />
+ <filterset filtersfile="../db/wsstack/${ws.stack}.properties" />
</copy>
<copy file="../db/datasource/bpel-${database}-ds.xml"
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-05-28 05:11:17 UTC (rev 678)
+++ trunk/pom.xml 2010-05-28 11:08:19 UTC (rev 679)
@@ -88,6 +88,7 @@
<commons.codec.version>1.3</commons.codec.version>
<xerces.version>2.9.0</xerces.version>
<commons.httpclient.version>3.1</commons.httpclient.version>
+ <cxf.version>2.2.8</cxf.version>
</properties>
<dependencyManagement>
Modified: trunk/runtime/engine/pom.xml
===================================================================
--- trunk/runtime/engine/pom.xml 2010-05-28 05:11:17 UTC (rev 678)
+++ trunk/runtime/engine/pom.xml 2010-05-28 11:08:19 UTC (rev 679)
@@ -118,6 +118,18 @@
<artifactId>riftsaw-bpel-compiler</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-core</artifactId>
+ <version>${cxf.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-ws-security</artifactId>
+ <version>${cxf.version}</version>
+ <scope>provided</scope>
+ </dependency>
<!-- for H2Database -->
<dependency>
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java 2010-05-28
05:11:17 UTC (rev 678)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java 2010-05-28
11:08:19 UTC (rev 679)
@@ -226,10 +226,12 @@
initialPartnerEndpoint.serviceName, initialPartnerEndpoint.portName,
processId, endpointId
);
+
+ ProcessConf pconf=engine._store.getProcessConfiguration(processId);
try
{
- PartnerChannel channel = endpointManager.createClient(endpointMD, wsdlDefinition,
wsdlUrl);
+ PartnerChannel channel = endpointManager.createClient(endpointMD, wsdlDefinition,
wsdlUrl, pconf);
return new PartnerRoleChannelImpl(channel);
}
Added:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/CXFJAXWSInitializer.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/CXFJAXWSInitializer.java
(rev 0)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/CXFJAXWSInitializer.java 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.bpel.runtime.ws;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import javax.xml.namespace.QName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+
+/**
+ * This class implements the JAXWSInitializer interface to
+ * provide Apache CXF specific initialization.
+ *
+ * @author gbrown
+ *
+ */
+public class CXFJAXWSInitializer implements JAXWSInitializer {
+
+ protected final Log log = LogFactory.getLog(getClass());
+
+ /**
+ * This method initializes the web service stack in preparation for
+ * calling the service and port supplied as parameters.
+ *
+ * @param serviceName The service name
+ * @param portName The port name
+ * @param baseURI The base URI of the deployment
+ */
+ public void initializeStack(QName serviceName, QName portName, java.net.URI baseURI) {
+ try {
+ SpringBusFactory bf = new SpringBusFactory();
+
+ URLClassLoader urlcl=new URLClassLoader(new URL[]{baseURI.toURL()});
+
+ String filename="jbossws-cxf-"+portName.getLocalPart()+".xml";
+
+ URL busFile = urlcl.getResource(filename);
+
+ log.debug("Web Stack initialization file: name="+filename+"
file="+busFile);
+
+ if (busFile != null) {
+ Bus bus = bf.createBus(busFile.toString());
+ bf.setThreadDefaultBus(bus);
+
+ log.debug("Set thread default bus="+bus);
+ }
+
+ } catch(Exception e) {
+ log.error("Failed to initialize WS-Security in stack", e);
+ }
+ }
+}
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/DeploymentBuilder.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/DeploymentBuilder.java 2010-05-28
05:11:17 UTC (rev 678)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/DeploymentBuilder.java 2010-05-28
11:08:19 UTC (rev 679)
@@ -72,10 +72,18 @@
{
public boolean accept(File f)
{
- return (
+ return (true
+ /* Commented out, to ensure all appropriate artifacts are deployed
f.getName().endsWith(".wsdl")
|| f.getName().endsWith(".xsd")
+ || f.getName().endsWith(".xml")
+ || f.getName().endsWith(".properties")
+ || f.getName().endsWith(".jks")
+ || f.getName().endsWith(".keystore")
+ || f.getName().endsWith(".pem")
+ || f.getName().endsWith(".chain")
|| f.isDirectory()
+ */
);
}
};
@@ -84,9 +92,76 @@
{
if(f.equals(wsdl)) continue;
copy(f, new File(this.wsdlDir, f.getName()));
+ copy(f, new File(this.webInf, f.getName()));
+
+
+/* Causes problems with testcase RIFTSAW-70 on jbossws-native. Ok
+ on jbossws-cxf. So just copying all artifacts to both locations
+ for now.
+
+ if (f.getName().endsWith(".wsdl") ||
+ f.getName().endsWith(".xsd")) {
+ copy(f, new File(this.wsdlDir, f.getName()));
+ } else {
+ copy(f, new File(this.webInf, f.getName()));
+ }
+*/
}
return this;
}
+
+ public DeploymentBuilder setProvider(javax.xml.ws.Provider<?> provider) {
+
+ // Check if jbossws-cxf.xml is present, and if so, updated the provider implementation
class attribute
+ File f=new File(this.webInf, "jbossws-cxf.xml");
+
+ if (f.exists()) {
+ FileInputStream fis=null;
+ FileOutputStream fos=null;
+
+ try {
+ fis=new FileInputStream(f);
+
+ byte[] b=new byte[fis.available()];
+ fis.read(b);
+
+ String str=new String(b);
+
+ fis.close();
+ fis = null;
+
+ if (str.indexOf("@provider@") != -1) {
+ fos=new FileOutputStream(f);
+
+ str = str.replaceAll("@provider@", provider.getClass().getName());
+
+ fos.write(str.getBytes());
+
+ fos.flush();
+ fos.close();
+
+ fos = null;
+ } else {
+ // Report error
+ System.err.println("jbossws-cxf.xml file does not contain @provider@
field");
+ }
+
+ } catch (IOException e) {
+ throw new RuntimeException("Failed to copy files", e);
+ } finally {
+ try {
+ if (fis != null) fis.close();
+ } catch (IOException e) {
+ }
+ try {
+ if (fos != null) fos.close();
+ } catch (IOException e) {
+ }
+ }
+ }
+
+ return this;
+ }
public File build()
{
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java 2010-05-28
05:11:17 UTC (rev 678)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java 2010-05-28
11:08:19 UTC (rev 679)
@@ -24,6 +24,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.iapi.EndpointReference;
+import org.apache.ode.bpel.iapi.ProcessConf;
import org.jboss.dependency.spi.ControllerContext;
import org.jboss.deployers.client.spi.DeployerClient;
import org.jboss.deployers.client.spi.Deployment;
@@ -93,16 +94,16 @@
{
try
{
+
+ // Check if a handler file has been specified
+ File wsdlFile=new File(wsdlRef.getWsdlURL().toURI());
+
+ File handlerFile=new File(wsdlFile.getParentFile(), "jws_handlers.xml");
+
+ if (handlerFile.exists() == false) {
+ handlerFile = null;
+ }
- // create deployment structure (maybe replaced by shrinkwrap)
- File warArchive = new DeploymentBuilder(serverConfig)
- .setEndpoint(metaData.getEndpointId())
- .setWSDL(new File(wsdlRef.getWsdlURL().toURI()))
- .build();
-
- //Deployment deployment = createInMemoryDeployment(endpointId);
- Deployment deployment = createVFSDeployment(warArchive);
-
// generate provider impl
WebServiceProviderFactory providerFactory = new WebServiceProviderFactory();
@@ -112,11 +113,22 @@
metaData.getPortName(),
metaData.getEndpointId(),
wsdlRef,
- classLoader
+ classLoader,
+ handlerFile
);
log.debug("Created dynamic endpoint class " +
providerImpl.getClass().getName());
+ // create deployment structure (maybe replaced by shrinkwrap)
+ File warArchive = new DeploymentBuilder(serverConfig)
+ .setEndpoint(metaData.getEndpointId())
+ .setWSDL(wsdlFile)
+ .setProvider(providerImpl)
+ .build();
+
+ //Deployment deployment = createInMemoryDeployment(endpointId);
+ Deployment deployment = createVFSDeployment(warArchive);
+
// Classloading
ClassLoaderFactory clf = new DelegatingClassLoaderFactory(classLoader);
@@ -290,13 +302,13 @@
}
public WebServiceClient createClient(
- EndpointMetaData metaData,Definition wsdlDefinition, URL wsdlUrl)
+ EndpointMetaData metaData,Definition wsdlDefinition, URL wsdlUrl, ProcessConf
pconf)
throws EndpointManagementException
{
try
{
WebServiceClient client =
- new WebServiceClient(metaData, wsdlDefinition, wsdlUrl, executionEnvironment);
+ new WebServiceClient(metaData, wsdlDefinition, wsdlUrl, executionEnvironment,
pconf);
return client;
Added:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/JAXWSInitializer.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/JAXWSInitializer.java
(rev 0)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/JAXWSInitializer.java 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.bpel.runtime.ws;
+
+import javax.xml.namespace.QName;
+
+/**
+ * This interface defines the component responsible for initializing the
+ * JAX-WS compliant web service stack. Although JAX-WS provides a standard
+ * API for communicating with external web services, it does not provide
+ * standardisation for the initialization of high layers of the web
+ * stack, e.g. related to WS-Security. Therefore, specific initialization
+ * is required on a per stack basis.
+ *
+ * @author gbrown
+ *
+ */
+public interface JAXWSInitializer {
+
+ /**
+ * This method initializes the web service stack in preparation for
+ * calling the service and port supplied as parameters.
+ *
+ * @param serviceName The service name
+ * @param portName The port name
+ * @param baseURI The base URI of the deployment
+ */
+ public void initializeStack(QName serviceName, QName portName, java.net.URI baseURI);
+
+}
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java 2010-05-28
05:11:17 UTC (rev 678)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java 2010-05-28
11:08:19 UTC (rev 679)
@@ -42,6 +42,7 @@
import org.apache.ode.bpel.iapi.Message;
import org.apache.ode.bpel.iapi.MessageExchange;
import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange;
+import org.apache.ode.bpel.iapi.ProcessConf;
import org.apache.ode.bpel.iapi.Scheduler;
import org.apache.ode.utils.DOMUtils;
import org.jboss.soa.bpel.runtime.engine.EndpointReference;
@@ -58,6 +59,8 @@
*/
public class WebServiceClient implements PartnerChannel
{
+ private static final String JAXWS_CLIENT_INITIALIZER =
"jaxws.client.initializer.impl";
+
protected final Log log = LogFactory.getLog(getClass());
private URL wsdlUrl;
@@ -74,8 +77,10 @@
private SOAPMessageAdapter messageAdapter;
private ExecutionEnvironment executionEnvironment;
-
- public WebServiceClient(EndpointMetaData metaData, Definition wsdlDefintion, URL
wsdlUrl , ExecutionEnvironment env)
+ private java.net.URI baseURI;
+
+ public WebServiceClient(EndpointMetaData metaData, Definition wsdlDefintion, URL
wsdlUrl , ExecutionEnvironment env,
+ ProcessConf pconf)
{
this.executionEnvironment = env;
this.metaData = metaData;
@@ -87,7 +92,11 @@
this.port = new QName(serviceName.getNamespaceURI(), metaData.getPortName());
this.messageAdapter = new SOAPMessageAdapter(this.wsdlDefintion, serviceName,
port.getLocalPart());
- }
+
+ this.baseURI = pconf.getBaseURI();
+
+ log.debug("Web Service Client: Base URI="+pconf.getBaseURI());
+ }
public EndpointReference getEndpointReference()
{
@@ -292,6 +301,8 @@
if(null==dispatcher)
{
log.debug("Creating Dispatcher ("+this.id+") on " + wsdlUrl +
": "+serviceName);
+
+ initializeStack(portName);
Service service = Service.create(this.wsdlUrl, serviceName);
dispatcher = service.createDispatch(
@@ -303,7 +314,30 @@
return dispatcher;
}
+
+ private synchronized void initializeStack(QName portName) {
+ String
impl=this.executionEnvironment.getOdeConfig().getProperty(JAXWS_CLIENT_INITIALIZER);
+ if (impl != null && impl.trim().length() > 0) {
+ JAXWSInitializer initializer=null;
+
+ try {
+ Class<?> cls=Class.forName(impl);
+
+ initializer = (JAXWSInitializer)cls.newInstance();
+
+ } catch(Exception e) {
+ log.error("Unable to obtain JAXWS Initializer class
'"+impl+"'", e);
+ }
+
+ if (initializer != null) {
+ initializer.initializeStack(this.serviceName, portName, this.baseURI);
+ }
+ } else {
+ log.debug("JAXWS Client Initializer not defined");
+ }
+ }
+
public String toString()
{
return "WebServiceClient
{service="+serviceName+",port="+port+"}";
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceProviderFactory.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceProviderFactory.java 2010-05-28
05:11:17 UTC (rev 678)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceProviderFactory.java 2010-05-28
11:08:19 UTC (rev 679)
@@ -47,7 +47,8 @@
QName service, String port,
String endpointId,
WSDLReference wsdlRef,
- ClassLoader loader
+ ClassLoader loader,
+ java.io.File handlerFile
)
throws Exception
{
@@ -57,6 +58,7 @@
// Imports
pool.importPackage("java.lang");
pool.importPackage("javax.xml.ws");
+ pool.importPackage("javax.jws");
CtClass stringType = pool.get("java.lang.String");
@@ -141,6 +143,18 @@
attr.addAnnotation(annotation2);
classFile.addAttribute(attr);
+
+
+ // Check if handler chain should be established
+ if (handlerFile != null) {
+ Annotation handlerChain = new Annotation("javax.jws.HandlerChain",
constantPool);
+
+ handlerChain.addMemberValue("file",
+ new StringMemberValue("/"+handlerFile.getName(), constantPool));
+
+ attr.addAnnotation(handlerChain);
+ }
+
createStringGetter(impl, stringType, "endpointId",
"getEndpointId");
createStringGetter(impl, stringType, "serviceName",
"getServiceName");
Added: trunk/samples/quickstart/secure_invoke/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/samples/quickstart/secure_invoke/.settings/org.eclipse.wst.common.component
(rev 0)
+++
trunk/samples/quickstart/secure_invoke/.settings/org.eclipse.wst.common.component 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="Quickstart_bpel_simple_invoke">
+ <wb-resource deploy-path="/"
source-path="/bpelContent"/>
+ <dependent-module deploy-path="/"
handle="module:/org.jboss.ide.eclipse.as.wtp.core.vcf.outputFolders/">
+ <dependency-type>consumes</dependency-type>
+ </dependent-module>
+ </wb-module>
+</project-modules>
Added:
trunk/samples/quickstart/secure_invoke/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
---
trunk/samples/quickstart/secure_invoke/.settings/org.eclipse.wst.common.project.facet.core.xml
(rev 0)
+++
trunk/samples/quickstart/secure_invoke/.settings/org.eclipse.wst.common.project.facet.core.xml 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <fixed facet="jbt.bpel.facet.core"/>
+ <installed facet="jbt.bpel.facet.core" version="2.0"/>
+</faceted-project>
Added: trunk/samples/quickstart/secure_invoke/bpelContent/SecureHelloWorldWS.wsdl
===================================================================
--- trunk/samples/quickstart/secure_invoke/bpelContent/SecureHelloWorldWS.wsdl
(rev 0)
+++ trunk/samples/quickstart/secure_invoke/bpelContent/SecureHelloWorldWS.wsdl 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<definitions name='SecureHelloWorldWSService'
+targetNamespace='http://secure_invoke/helloworld'
+xmlns='http://schemas.xmlsoap.org/wsdl/'
+xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
+xmlns:tns='http://secure_invoke/helloworld'
+xmlns:xsd='http://www.w3.org/2001/XMLSchema'
+xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
+>
+ <types>
+ <xs:schema targetNamespace='http://secure_invoke/helloworld'
version='1.0' xmlns:tns='http://secure_invoke/helloworld'
xmlns:xs='http://www.w3.org/2001/XMLSchema'>
+ <xs:element name='sayGoodbye' type='tns:sayGoodbye'/>
+ <xs:element name='sayGoodbyeResponse'
type='tns:sayGoodbyeResponse'/>
+ <xs:element name='sayHello' type='tns:sayHello'/>
+ <xs:element name='sayHelloResponse'
type='tns:sayHelloResponse'/>
+ <xs:complexType name='sayGoodbye'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='toWhom'
type='xs:string'/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name='sayGoodbyeResponse'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='return'
type='xs:string'/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name='sayHello'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='toWhom'
type='xs:string'/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name='sayHelloResponse'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='return'
type='xs:string'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+ </types>
+ <message name='HelloWorld_sayGoodbye'>
+ <part element='tns:sayGoodbye' name='sayGoodbye'></part>
+ </message>
+ <message name='HelloWorld_sayHello'>
+ <part element='tns:sayHello' name='sayHello'></part>
+ </message>
+ <message name='HelloWorld_sayHelloResponse'>
+ <part element='tns:sayHelloResponse'
name='sayHelloResponse'></part>
+ </message>
+ <message name='HelloWorld_sayGoodbyeResponse'>
+ <part element='tns:sayGoodbyeResponse'
name='sayGoodbyeResponse'></part>
+ </message>
+ <portType name='SecureHelloWorld'>
+ <operation name='sayGoodbye' parameterOrder='sayGoodbye'>
+ <input message='tns:HelloWorld_sayGoodbye'></input>
+ <output message='tns:HelloWorld_sayGoodbyeResponse'></output>
+ </operation>
+ <operation name='sayHello' parameterOrder='sayHello'>
+ <input message='tns:HelloWorld_sayHello'></input>
+ <output message='tns:HelloWorld_sayHelloResponse'></output>
+ </operation>
+ </portType>
+ <binding name='SecureHelloWorldBinding'
type='tns:SecureHelloWorld'>
+ <soap:binding style='document'
transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='sayGoodbye'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ <operation name='sayHello'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='SecureHelloWorldWSService'>
+ <port binding='tns:SecureHelloWorldBinding'
name='SecureHelloWorldPort'>
+ <soap:address
location='http://127.0.0.1:8080/Quickstart_bpel_secure_invoke/SecureHelloWorldWS'/>
+ </port>
+ </service>
+ <plnk:partnerLinkType name="theExternalService_PartnerLinkType">
+ <plnk:role name="callingTheExternalService"
portType="tns:SecureHelloWorld"/>
+ </plnk:partnerLinkType>
+</definitions>
Added: trunk/samples/quickstart/secure_invoke/bpelContent/SecureInvoke.bpel
===================================================================
--- trunk/samples/quickstart/secure_invoke/bpelContent/SecureInvoke.bpel
(rev 0)
+++ trunk/samples/quickstart/secure_invoke/bpelContent/SecureInvoke.bpel 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,96 @@
+<!--
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, 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.
+ -->
+<process name="SecureInvoke"
+
targetNamespace="http://www.jboss.org/bpel/examples"
+
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+
xmlns:tns="http://www.jboss.org/bpel/examples"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:intf="http://www.jboss.org/bpel/examples/wsdl"
+ xmlns:intf2="http://secure_invoke/helloworld"
+ queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+
expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
+
+ <import location="SecureInvoke.wsdl"
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+
importType="http://schemas.xmlsoap.org/wsdl/" />
+
+ <import location="SecureHelloWorldWS.wsdl"
+ namespace="http://secure_invoke/helloworld"
+
importType="http://schemas.xmlsoap.org/wsdl/" />
+
+ <partnerLinks>
+ <partnerLink name="theClient_PartnerLink"
+ partnerLinkType="intf:myClientCalling_PartnerLinkType"
+ myRole="me" />
+ <partnerLink name="theExternalService_PartnerLink"
+ partnerLinkType="intf2:theExternalService_PartnerLinkType"
+ partnerRole="callingTheExternalService"
+ initializePartnerRole="yes"/>
+ </partnerLinks>
+
+ <variables>
+ <variable name="myVar"
messageType="intf:GreetingTarget_Message"/>
+ <variable name="inVar"
messageType="intf2:HelloWorld_sayHello"/>
+ <variable name="outVar"
messageType="intf2:HelloWorld_sayHelloResponse"/>
+ <variable name="tempVar" type="xsd:string"/>
+ </variables>
+
+ <sequence>
+ <receive
+ name="request"
+ partnerLink="theClient_PartnerLink"
+ portType="intf:SecureInvoke_PortType"
+ operation="sayHelloTo"
+ variable="myVar"
+ createInstance="yes"/>
+
+ <assign name="assignRequestToHelloWorldWS">
+ <!-- Ode requires variable initialization -->
+ <copy>
+ <from><literal><intf2:sayHello><toWhom
xmlns=""/></intf2:sayHello></literal></from>
+ <to variable="inVar" part="sayHello"/>
+ </copy>
+ <!-- now the real copy -->
+ <copy>
+ <from variable="myVar" part="ToWhom"/>
+ <to>$inVar.sayHello/toWhom</to>
+ </copy>
+ </assign>
+
+ <invoke name="ICallTheExternalService"
+ partnerLink="theExternalService_PartnerLink"
+ portType="intf2:SecureHelloWorld"
+ operation="sayHello"
+ inputVariable="inVar"
+ outputVariable="outVar"
+ />
+
+ <assign name="assignResponseOfHelloWorldWS">
+ <copy>
+ <from>concat($outVar.sayHelloResponse/return,' and
BPEL')</from>
+ <to variable="myVar" part="ToWhom"/>
+ </copy>
+ </assign>
+
+ <reply name="response"
+ partnerLink="theClient_PartnerLink"
+ portType="intf:SecureInvoke_PortType"
+ operation="sayHelloTo"
+ variable="myVar"/>
+ </sequence>
+</process>
Added: trunk/samples/quickstart/secure_invoke/bpelContent/SecureInvoke.wsdl
===================================================================
--- trunk/samples/quickstart/secure_invoke/bpelContent/SecureInvoke.wsdl
(rev 0)
+++ trunk/samples/quickstart/secure_invoke/bpelContent/SecureInvoke.wsdl 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, 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.
+ -->
+<wsdl:definitions
+
targetNamespace="http://www.jboss.org/bpel/examples/wsdl"
+
xmlns="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:tns="http://www.jboss.org/bpel/examples/wsdl"
+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
+
+ <wsdl:message name="GreetingTarget_Message">
+ <wsdl:part name="ToWhom" type="xsd:string"/>
+ </wsdl:message>
+
+ <wsdl:portType name="SecureInvoke_PortType">
+ <wsdl:operation name="sayHelloTo">
+ <wsdl:input message="tns:GreetingTarget_Message"
name="TestIn"/>
+ <wsdl:output message="tns:GreetingTarget_Message"
name="TestOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="SecureInvoke_SoapBinding"
type="tns:SecureInvoke_PortType">
+ <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="sayHelloTo">
+ <soap:operation soapAction="" style="rpc"/>
+ <wsdl:input>
+ <soap:body
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="SecureInvoke_Service">
+ <wsdl:port name="SecureInvoke_Port"
binding="tns:SecureInvoke_SoapBinding">
+ <soap:address
location="http://localhost:8080/Quickstart_bpel_secure_invokeWS"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="myClientCalling_PartnerLinkType">
+ <plnk:role name="me"
portType="tns:SecureInvoke_PortType"/>
+ <plnk:role name="you"
portType="tns:SecureInvoke_PortType"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
+
Added: trunk/samples/quickstart/secure_invoke/bpelContent/bpel-deploy.xml
===================================================================
--- trunk/samples/quickstart/secure_invoke/bpelContent/bpel-deploy.xml
(rev 0)
+++ trunk/samples/quickstart/secure_invoke/bpelContent/bpel-deploy.xml 2010-05-28 11:08:19
UTC (rev 679)
@@ -0,0 +1,32 @@
+<!--
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, 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.
+ -->
+<deploy
xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+
xmlns:bpl="http://www.jboss.org/bpel/examples"
+
xmlns:intf="http://www.jboss.org/bpel/examples/wsdl"
+ xmlns:intf2="http://secure_invoke/helloworld">
+
+ <process name="bpl:SecureInvoke">
+ <active>true</active>
+ <provide partnerLink="theClient_PartnerLink">
+ <service name="intf:SecureInvoke_Service"
port="SecureInvoke_Port"/>
+ </provide>
+ <invoke partnerLink="theExternalService_PartnerLink">
+ <service name="intf2:SecureHelloWorldWSService"
port="SecureHelloWorldPort"/>
+ </invoke>
+ </process>
+</deploy>
Added: trunk/samples/quickstart/secure_invoke/bpelContent/etc/Client_Encrypt.properties
===================================================================
--- trunk/samples/quickstart/secure_invoke/bpelContent/etc/Client_Encrypt.properties
(rev 0)
+++
trunk/samples/quickstart/secure_invoke/bpelContent/etc/Client_Encrypt.properties 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,5 @@
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=storepassword
+org.apache.ws.security.crypto.merlin.keystore.alias=serverx509v1
+org.apache.ws.security.crypto.merlin.file=keystore/client-truststore.jks
\ No newline at end of file
Added: trunk/samples/quickstart/secure_invoke/bpelContent/etc/Client_Sign.properties
===================================================================
--- trunk/samples/quickstart/secure_invoke/bpelContent/etc/Client_Sign.properties
(rev 0)
+++
trunk/samples/quickstart/secure_invoke/bpelContent/etc/Client_Sign.properties 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,6 @@
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=storepassword
+org.apache.ws.security.crypto.merlin.keystore.alias=clientx509v1
+org.apache.ws.security.crypto.merlin.file=keystore/client-keystore.jks
+
Added:
trunk/samples/quickstart/secure_invoke/bpelContent/jbossws-cxf-SecureHelloWorldPort.xml
===================================================================
---
trunk/samples/quickstart/secure_invoke/bpelContent/jbossws-cxf-SecureHelloWorldPort.xml
(rev 0)
+++
trunk/samples/quickstart/secure_invoke/bpelContent/jbossws-cxf-SecureHelloWorldPort.xml 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans
xmlns="http://www.springframework.org/schema/beans"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns:cxf="http://cxf.apache.org/core"
+
xmlns:wsa="http://cxf.apache.org/ws/addressing"
+
xmlns:http="http://cxf.apache.org/transports/http/configuration"
+
xmlns:wsrm-policy="http://schemas.xmlsoap.org/ws/2005/02/rm/policy&q...
+
xmlns:wsrm-mgr="http://cxf.apache.org/ws/rm/manager"
+
xmlns:beans='http://www.springframework.org/schema/beans'
+
xmlns:jaxws='http://cxf.apache.org/jaxws'
+ xmlns:ns1='http://secure_invoke/helloworld'
+ xsi:schemaLocation="
+
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+
http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd
+
http://schemas.xmlsoap.org/ws/2005/02/rm/policy
http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd
+
http://cxf.apache.org/ws/rm/manager
http://cxf.apache.org/schemas/configuration/wsrm-manager.xsd
+
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
+
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
+
+ <bean id="UsernameTokenSign_Request"
class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor"
+ name="{http://secure_invoke/helloworld}SecureHelloWorldPort.Request"
>
+ <constructor-arg>
+ <map>
+ <entry key="action" value="UsernameToken Timestamp
Signature"/>
+ <entry key="passwordType" value="PasswordDigest"/>
+ <entry key="user" value="clientx509v1"/>
+ <entry key="passwordCallbackClass"
value="org.jboss.test.ws.jaxws.samples.wsse.ClientUsernamePasswordCallback"/>
+ <entry key="signaturePropFile"
value="etc/Client_Sign.properties"/>
+ <entry key="signatureKeyIdentifier"
value="DirectReference"/>
+ <entry key="signatureParts"
value="{Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401...
+ </map>
+ </constructor-arg>
+ </bean>
+
+ <bean id="UsernameTokenSign_Response"
class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor"
+ name="{http://secure_invoke/helloworld}SecureHelloWorldPort.Response"
>
+ <constructor-arg>
+ <map>
+ <entry key="action" value="UsernameToken Timestamp
Signature"/>
+ <entry key="passwordType" value="PasswordText"/>
+ <entry key="user" value="serverx509v1"/>
+ <entry key="passwordCallbackClass"
value="org.jboss.test.ws.jaxws.samples.wsse.ClientUsernamePasswordCallback"/>
+ <entry key="signaturePropFile"
value="etc/Client_Encrypt.properties"/>
+ <entry key="signatureKeyIdentifier"
value="DirectReference"/>
+ </map>
+ </constructor-arg>
+ </bean>
+
+
+ <cxf:bus>
+ <cxf:outInterceptors>
+ <ref bean="UsernameTokenSign_Request"/>
+ <bean
class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor"/>
+ </cxf:outInterceptors>
+ <cxf:inInterceptors>
+ <ref bean="UsernameTokenSign_Response"/>
+ <bean
class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
+ </cxf:inInterceptors>
+ </cxf:bus>
+
+</beans>
Added: trunk/samples/quickstart/secure_invoke/bpelContent/keystore/client-keystore.jks
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/quickstart/secure_invoke/bpelContent/keystore/client-keystore.jks
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/quickstart/secure_invoke/bpelContent/keystore/client-truststore.jks
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/quickstart/secure_invoke/bpelContent/keystore/client-truststore.jks
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/quickstart/secure_invoke/build.xml
===================================================================
--- trunk/samples/quickstart/secure_invoke/build.xml (rev 0)
+++ trunk/samples/quickstart/secure_invoke/build.xml 2010-05-28 11:08:19 UTC (rev 679)
@@ -0,0 +1,104 @@
+<project name="Quickstart_bpel_secure_invoke" default="deploy"
basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <!-- Import the base Ant build script... -->
+ <property file="../../../install/deployment.properties" />
+
+ <property name="version" value="1" />
+
+ <property name="server.dir"
value="${org.jboss.as.home}/server/${org.jboss.as.config}"/>
+ <property name="conf.dir" value="${server.dir}/conf"/>
+ <property name="deploy.dir" value="${server.dir}/deploy"/>
+ <property name="deployers.dir"
value="${server.dir}/deployers"/>
+ <property name="server.lib.dir" value="${server.dir}/lib"/>
+
+ <property name="sample.jar.name"
value="${ant.project.name}-${version}.jar" />
+
+ <property name="war.build.dir"
location="build/war/classes"/>
+
+ <path id="compile-classpath">
+ <fileset dir="${org.jboss.as.home}/client" includes="*.jar"
/> <!-- Required for JMS Client Code. -->
+ <fileset dir="${deployers.dir}/jbossws.deployer"
includes="*.jar" />
+ </path>
+ <property name="compile-classpath"
refid="compile-classpath"/>
+
+ <copy file="war/src/jws_handlers.xml" todir="${war.build.dir}"
/>
+
+ <target name="makewar" description="make war">
+ <!-- Compile... -->
+ <mkdir dir="${war.build.dir}" />
+ <javac srcdir="war/src" destdir="${war.build.dir}"
debug="true">
+ <classpath>
+ <path refid="compile-classpath" />
+ <fileset dir="war/resources/WEB-INF/lib"
includes="*.jar" />
+ </classpath>
+ </javac>
+
+ <!-- War... -->
+ <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"/>
+ <include name="jbossws-cxf.xml"/>
+ </webinf>
+<!--
+ <classes dir="${war.build.dir}"
includes="**/*.class"/>
+-->
+ <classes dir="${war.build.dir}">
+ <include name="**/*.class" />
+ <include name="**/*.xml" />
+ </classes>
+ <classes dir="${basedir}/war/resources/WEB-INF">
+ <include name="etc/*"/>
+ <include name="keystore/*"/>
+ </classes>
+ <fileset dir="${basedir}/war/view">
+ <include name="**/*"/>
+ </fileset>
+ <classes dir="${basedir}">
+ <include name="juddi.properties"/>
+ </classes>
+ </war>
+ </target>
+
+ <target name="deploywar" depends="makewar" >
+ <copy todir="${deploy.dir}"
+ file="build/${ant.project.name}.war"/>
+ </target>
+
+ <target name="undeploywar">
+ <delete file="${deploy.dir}/${ant.project.name}.war"/>
+ </target>
+
+ <target name="deploy" depends="deploywar" >
+ <echo>Deploy ${ant.project.name}</echo>
+ <jar destfile="${deploy.dir}/${sample.jar.name}" >
+ <fileset dir="bpelContent"/>
+ <fileset dir="${war.build.dir}"/>
+ </jar>
+ </target>
+
+ <target name="undeploy" depends="undeploywar" >
+ <echo>Undeploy ${ant.project.name}</echo>
+ <delete file="${deploy.dir}/${sample.jar.name}" />
+ </target>
+
+ <target name="sendhello">
+ <echo>Send test message to: ${ant.project.name}</echo>
+ <java
classname="org.apache.ode.tools.sendsoap.cline.HttpSoapSender">
+ <arg
value="http://localhost:8080/Quickstart_bpel_secure_invokeWS"/>
+ <arg value="messages/hello_request1.xml"/>
+ <classpath>
+ <fileset dir="../../common/lib">
+ <include name="**/*.jar"/>
+ </fileset>
+ <pathelement path="${java.class.path}"/>
+ </classpath>
+ </java>
+ </target>
+
+</project>
Added: trunk/samples/quickstart/secure_invoke/messages/hello_request1.xml
===================================================================
--- trunk/samples/quickstart/secure_invoke/messages/hello_request1.xml
(rev 0)
+++ trunk/samples/quickstart/secure_invoke/messages/hello_request1.xml 2010-05-28 11:08:19
UTC (rev 679)
@@ -0,0 +1,8 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsdl="http://www.jboss.org/bpel/examples/wsdl">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <wsdl:sayHelloTo>
+ <ToWhom>ME</ToWhom>
+ </wsdl:sayHelloTo>
+ </soapenv:Body>
+</soapenv:Envelope>
Added: trunk/samples/quickstart/secure_invoke/readme.txt
===================================================================
--- trunk/samples/quickstart/secure_invoke/readme.txt (rev 0)
+++ trunk/samples/quickstart/secure_invoke/readme.txt 2010-05-28 11:08:19 UTC (rev 679)
@@ -0,0 +1,31 @@
+Quickstart Examples - Simple Invoke
+===================================
+
+This is a simple echo example, used to respond to a sent message with a
+modified version of the request message being returned in a response. The
+difference with this example, compared to the Hello World sample, is
+that the invoked service calls another JAX-WS based service to construct
+the response message. The BPEL process in this example, is primarily
+acting as a relay between the client and the invoked JAX-WS service, although
+the BPEL process also appends some text to the response message aswell.
+
+To deploy the example, open a command line window in the example's folder,
+and simply type 'ant deploy'. To undeploy, use the command 'ant
undeploy'.
+
+To test the example, for example using the SOAPUI client, an example message
+can be found in the messages sub-folder, with the relevant WSDL being
+located in the bpel sub-folder.
+
+Alternatively, use the 'ant sendhello' command (from a command line window)
+to send the example message directly to the deployed process.
+
+NOTE: The "ant deploy" command will by default deploy version 1 of the
+example to the server. If you wish to change the example, and redeploy,
+then you will need to update the version number in the build.xml, or
+override the version property, e.g. "ant -Dversion=2 deploy" (and similarly
+when undeploying "ant -Dversion=2 undeploy").
+
+Some handy URLs:
+http://localhost:8080/bpel-console is the BPEL console
+http://localhost:8080/Quickstart_bpel_simple_invokeWS?wsdl is the URL to the BPEL
process' WSDL
+http://localhost:8080/Quickstart_bpel_simple_invoke/HelloWorldWS?wsdl is the JBossWS
endpoint's WSDL
Added:
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/etc/Server_Decrypt.properties
===================================================================
---
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/etc/Server_Decrypt.properties
(rev 0)
+++
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/etc/Server_Decrypt.properties 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,5 @@
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=storepassword
+org.apache.ws.security.crypto.merlin.keystore.alias=serverx509v1
+org.apache.ws.security.crypto.merlin.file=keystore/server-keystore.jks
Added:
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/etc/Server_SignVerf.properties
===================================================================
---
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/etc/Server_SignVerf.properties
(rev 0)
+++
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/etc/Server_SignVerf.properties 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,5 @@
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=storepassword
+org.apache.ws.security.crypto.merlin.keystore.alias=clientx509v1
+org.apache.ws.security.crypto.merlin.file=keystore/server-truststore.jks
Added: trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/jbossws-cxf.xml
===================================================================
--- trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/jbossws-cxf.xml
(rev 0)
+++
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/jbossws-cxf.xml 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,55 @@
+<beans
+
xmlns='http://www.springframework.org/schema/beans'
+
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+
xmlns:beans='http://www.springframework.org/schema/beans'
+
xmlns:jaxws='http://cxf.apache.org/jaxws'
+
xsi:schemaLocation='http://cxf.apache.org/core
+
http://cxf.apache.org/schemas/core.xsd
+
http://www.springframework.org/schema/beans
+
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+
http://cxf.apache.org/jaxws
+
http://cxf.apache.org/schemas/jaxws.xsd'>
+
+ <bean id="UsernameTokenSign_Request"
class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="UsernameToken Timestamp
Signature"/>
+ <entry key="passwordType" value="PasswordDigest"/>
+ <entry key="user" value="serverx509v1"/>
+ <entry key="passwordCallbackClass"
value="org.jboss.test.ws.jaxws.samples.wsse.ServerUsernamePasswordCallback"/>
+ <entry key="signaturePropFile"
value="etc/Server_SignVerf.properties"/>
+ <entry key="signatureKeyIdentifier"
value="DirectReference"/>
+ </map>
+ </constructor-arg>
+ </bean>
+
+ <bean id="UsernameTokenSign_Response"
class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="UsernameToken Timestamp
Signature"/>
+ <entry key="passwordType" value="PasswordText"/>
+ <entry key="user" value="serverx509v1"/>
+ <entry key="passwordCallbackClass"
value="org.jboss.test.ws.jaxws.samples.wsse.ServerUsernamePasswordCallback"/>
+ <entry key="signaturePropFile"
value="etc/Server_Decrypt.properties"/>
+ <entry key="signatureKeyIdentifier"
value="DirectReference"/>
+ <entry key="signatureParts"
value="{Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401...
+ </map>
+ </constructor-arg>
+ </bean>
+
+ <jaxws:endpoint
+ id='SecureHelloWorldWS'
+
address='http://@jboss.bind.address@:8080/Quickstart_bpel_secure_invoke/SecureHelloWorldWS'
+
implementor='org.jboss.soa.bpel.samples.quickstart.secure_invoke.SecureHelloWorldWS'>
+ <jaxws:inInterceptors>
+ <ref bean="UsernameTokenSign_Request"/>
+ <bean
class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
+ </jaxws:inInterceptors>
+ <jaxws:outInterceptors>
+ <ref bean="UsernameTokenSign_Response"/>
+ <bean
class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor"/>
+ </jaxws:outInterceptors>
+ </jaxws:endpoint>
+
+
+</beans>
Added:
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/keystore/server-keystore.jks
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/keystore/server-keystore.jks
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/keystore/server-truststore.jks
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/keystore/server-truststore.jks
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/web.xml
===================================================================
--- trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/web.xml
(rev 0)
+++ trunk/samples/quickstart/secure_invoke/war/resources/WEB-INF/web.xml 2010-05-28
11:08:19 UTC (rev 679)
@@ -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>SecureHelloWorldWS</servlet-name>
+
<servlet-class>org.jboss.soa.bpel.samples.quickstart.secure_invoke.SecureHelloWorldWS</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>SecureHelloWorldWS</servlet-name>
+ <url-pattern>/SecureHelloWorldWS</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Added: trunk/samples/quickstart/secure_invoke/war/src/jws_handlers.xml
===================================================================
--- trunk/samples/quickstart/secure_invoke/war/src/jws_handlers.xml
(rev 0)
+++ trunk/samples/quickstart/secure_invoke/war/src/jws_handlers.xml 2010-05-28 11:08:19
UTC (rev 679)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<handler-chains
xmlns="http://java.sun.com/xml/ns/javaee"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://java.sun.com/xml/ns/javaee">
+ <handler-chain>
+ <handler>
+ <handler-name>JAXWSHandler</handler-name>
+ <handler-class>org.jboss.soa.bpel.examples.jaxws.JAXWSHandler</handler-class>
+ <init-param>
+ <param-name>TestParam</param-name>
+ <param-value>TestValue</param-value>
+ </init-param>
+ </handler>
+ </handler-chain>
+</handler-chains>
Added:
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/soa/bpel/examples/jaxws/JAXWSHandler.java
===================================================================
---
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/soa/bpel/examples/jaxws/JAXWSHandler.java
(rev 0)
+++
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/soa/bpel/examples/jaxws/JAXWSHandler.java 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.soa.bpel.examples.jaxws;
+
+import java.io.PrintStream;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+/**
+ * This class provides an example jaxws handler that can be deployed with
+ * a BPEL process, to provide visibility of messages inbound and outbound
+ * from the web service interface.
+ *
+ * @author gbrown
+ *
+ */
+public class JAXWSHandler implements SOAPHandler<SOAPMessageContext> {
+
+ private PrintStream out;
+
+ public JAXWSHandler() {
+ setLogStream(System.out);
+ }
+
+ protected final void setLogStream(PrintStream ps) {
+ out = ps;
+ }
+
+ public void init(Map c) {
+ System.out.println("JAXWSHandler : init() Called....:"+c);
+ }
+
+ public Set<QName> getHeaders() {
+ return null;
+ }
+
+ public boolean handleMessage(SOAPMessageContext smc) {
+ System.out.println("JAXWSHandler : handleMessage Called....");
+ logToSystemOut(smc);
+ return true;
+ }
+
+ public boolean handleFault(SOAPMessageContext smc) {
+ System.out.println("JAXWSHandler : handleFault Called....");
+ logToSystemOut(smc);
+ return true;
+ }
+
+ public void close(MessageContext messageContext) {
+ System.out.println("JAXWSHandler : close() Called....");
+ }
+
+ public void destroy() {
+ System.out.println("JAXWSHandler : destroy() Called....");
+ }
+
+ protected void logToSystemOut(SOAPMessageContext smc) {
+ Boolean outboundProperty = (Boolean)
+ smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+
+ if (outboundProperty.booleanValue()) {
+ out.println("\nOutbound message:");
+ } else {
+ out.println("\nInbound message:");
+ }
+
+ SOAPMessage message = smc.getMessage();
+ try {
+ message.writeTo(out);
+ out.println();
+ } catch (Exception e) {
+ out.println("Exception in handler: " + e);
+ }
+
+ out.println("WSDL_SERVICE = "+smc.get(MessageContext.WSDL_SERVICE));
+ out.println("WSDL_INTERFACE = "+smc.get(MessageContext.WSDL_INTERFACE));
+ out.println("WSDL_PORT = "+smc.get(MessageContext.WSDL_PORT));
+ out.println("WSDL_OPERATION = "+smc.get(MessageContext.WSDL_OPERATION));
+ }
+}
Added:
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/soa/bpel/samples/quickstart/secure_invoke/SecureHelloWorldWS.java
===================================================================
---
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/soa/bpel/samples/quickstart/secure_invoke/SecureHelloWorldWS.java
(rev 0)
+++
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/soa/bpel/samples/quickstart/secure_invoke/SecureHelloWorldWS.java 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,58 @@
+/*
+ * 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.bpel.samples.quickstart.secure_invoke;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.WebParam;
+import javax.jws.*;
+
+@WebService(name = "SecureHelloWorld", targetNamespace =
"http://secure_invoke/helloworld")
+(a)HandlerChain(file="/jws_handlers.xml")
+public class SecureHelloWorldWS
+{
+ @WebMethod
+ public String sayHello(@WebParam(name = "toWhom")
+ String toWhom)
+ {
+ System.out.println("\n");
+ System.out.println("*************************************************");
+ System.out.println("toWhom Parameter: " + toWhom );
+ System.out.println("*************************************************");
+ System.out.println("\n");
+ String greeting = "Secure Hello " + toWhom + ". Sincerely,
JBossWS";
+ return greeting;
+
+ }
+
+ @WebMethod
+ public String sayGoodbye(@WebParam(name = "toWhom")
+ String toWhom)
+ {
+
+ String greeting = "Secure Goodbye Cruel World, sincerely '" + toWhom
+ "' at " + new java.util.Date();
+
+ return greeting;
+
+ }
+}
Added:
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/test/ws/jaxws/samples/wsse/ClientUsernamePasswordCallback.java
===================================================================
---
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/test/ws/jaxws/samples/wsse/ClientUsernamePasswordCallback.java
(rev 0)
+++
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/test/ws/jaxws/samples/wsse/ClientUsernamePasswordCallback.java 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,75 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ */
+
+public class ClientUsernamePasswordCallback implements CallbackHandler {
+
+ private Map<String, String> passwords =
+ new HashMap<String, String>();
+
+ public ClientUsernamePasswordCallback() {
+ passwords.put("Alice", "ecilA");
+ passwords.put("abcd", "dcba");
+ passwords.put("clientx509v1", "storepassword");
+ passwords.put("serverx509v1", "storepassword");
+ }
+
+ /**
+ * Here, we attempt to get the password from the private
+ * alias/passwords map.
+ */
+ public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
+
+ System.out.println("**************** Client checking id:
"+pc.getIdentifer());
+
+ String pass = passwords.get(pc.getIdentifier());
+ if (pass != null) {
+ pc.setPassword(pass);
+ return;
+ }
+ }
+
+ //
+ // Password not found
+ //
+ throw new IOException();
+ }
+
+ /**
+ * Add an alias/password pair to the callback mechanism.
+ */
+ public void setAliasPassword(String alias, String password) {
+ passwords.put(alias, password);
+ }
+}
Added:
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java
===================================================================
---
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java
(rev 0)
+++
trunk/samples/quickstart/secure_invoke/war/src/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse;
+
+import java.io.IOException;
+import java.util.*;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import org.apache.ws.security.WSPasswordCallback;
+
+public class ServerUsernamePasswordCallback implements CallbackHandler
+{
+ private Map<String, String> passwords =
+ new HashMap<String, String>();
+
+ public ServerUsernamePasswordCallback() {
+ passwords.put("Alice", "ecilA");
+ passwords.put("abcd", "dcba");
+ passwords.put("clientx509v1", "storepassword");
+ passwords.put("serverx509v1", "storepassword");
+ }
+
+ /**
+ * Here, we attempt to get the password from the private
+ * alias/passwords map.
+ */
+ public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
+
+ System.out.println("**************** Server checking id:
"+pc.getIdentifer());
+
+ String pass = passwords.get(pc.getIdentifier());
+ if (pass != null) {
+ pc.setPassword(pass);
+ return;
+ }
+ }
+
+ //
+ // Password not found
+ //
+ throw new IOException();
+ }
+
+ /**
+ * Add an alias/password pair to the callback mechanism.
+ */
+ public void setAliasPassword(String alias, String password) {
+ passwords.put(alias, password);
+ }
+}
Added: trunk/samples/quickstart/secure_invoke/war/view/index.jsp
===================================================================
--- trunk/samples/quickstart/secure_invoke/war/view/index.jsp (rev
0)
+++ trunk/samples/quickstart/secure_invoke/war/view/index.jsp 2010-05-28 11:08:19 UTC (rev
679)
@@ -0,0 +1,9 @@
+<html>
+ <body>
+ This is just a place holder.<br>
+ Verify the that the WS has been deployed by hitting
+ <a href="http://localhost:8080/jbossws">
+
http://localhost:8080/jbossws
+ </a>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/samples/quickstart/secure_service/.project
===================================================================
--- trunk/samples/quickstart/secure_service/.project (rev 0)
+++ trunk/samples/quickstart/secure_service/.project 2010-05-28 11:08:19 UTC (rev 679)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>Quickstart_bpel_hello_world</name>
+ <comment></comment>
+ <projects>
+ <project>Quickstart_bpel_hello_world</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.bpel.validator.builder</name>
+ <arguments>
+ <dictionary>
+ <key>debug</key>
+ <value>false</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ </natures>
+</projectDescription>
Added: trunk/samples/quickstart/secure_service/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/samples/quickstart/secure_service/.settings/org.eclipse.wst.common.component
(rev 0)
+++
trunk/samples/quickstart/secure_service/.settings/org.eclipse.wst.common.component 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="Quickstart_bpel_hello_world">
+ <wb-resource deploy-path="/"
source-path="/bpelContent"/>
+ <dependent-module deploy-path="/"
handle="module:/org.jboss.ide.eclipse.as.wtp.core.vcf.outputFolders/">
+ <dependency-type>consumes</dependency-type>
+ </dependent-module>
+ </wb-module>
+</project-modules>
Added:
trunk/samples/quickstart/secure_service/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
---
trunk/samples/quickstart/secure_service/.settings/org.eclipse.wst.common.project.facet.core.xml
(rev 0)
+++
trunk/samples/quickstart/secure_service/.settings/org.eclipse.wst.common.project.facet.core.xml 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <fixed facet="jbt.bpel.facet.core"/>
+ <installed facet="jbt.bpel.facet.core" version="2.0"/>
+</faceted-project>
Added: trunk/samples/quickstart/secure_service/bpelContent/HelloWorld.bpel
===================================================================
--- trunk/samples/quickstart/secure_service/bpelContent/HelloWorld.bpel
(rev 0)
+++ trunk/samples/quickstart/secure_service/bpelContent/HelloWorld.bpel 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,69 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~
http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<process name="SecureHelloWorld"
+
targetNamespace="http://www.jboss.org/bpel/examples"
+
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+
xmlns:tns="http://www.jboss.org/bpel/examples"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:intf="http://www.jboss.org/bpel/examples/wsdl"
+ queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+ expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable...
+
+ <import location="HelloWorld.wsdl"
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+
importType="http://schemas.xmlsoap.org/wsdl/" />
+
+ <partnerLinks>
+ <partnerLink name="helloPartnerLink"
+ partnerLinkType="intf:SecureHelloPartnerLinkType"
+ myRole="me" />
+ </partnerLinks>
+
+ <variables>
+ <variable name="reqVar" messageType="intf:HelloMessage"/>
+ <variable name="respVar"
messageType="intf:HelloMessage"/>
+ <variable name="mesgVar" type="xsd:string"/>
+ </variables>
+
+ <sequence>
+ <receive
+ name="start"
+ partnerLink="helloPartnerLink"
+ portType="intf:SecureHelloPortType"
+ operation="hello"
+ variable="reqVar"
+ createInstance="yes"/>
+
+ <assign name="assignHelloMesg">
+ <copy>
+ <from variable="reqVar" part="TestPart"/>
+ <to variable="mesgVar"/>
+ </copy>
+ <copy>
+ <from>concat($mesgVar,' World')</from>
+ <to variable="respVar" part="TestPart"/>
+ </copy>
+ </assign>
+ <reply name="end"
+ partnerLink="helloPartnerLink"
+ portType="intf:SecureHelloPortType"
+ operation="hello"
+ variable="respVar"/>
+ </sequence>
+</process>
Added: trunk/samples/quickstart/secure_service/bpelContent/HelloWorld.bpelex
===================================================================
--- trunk/samples/quickstart/secure_service/bpelContent/HelloWorld.bpelex
(rev 0)
+++ trunk/samples/quickstart/secure_service/bpelContent/HelloWorld.bpelex 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="ASCII"?>
+<extensionmodel:ExtensionMap xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:extensionmodel="http:///extensionmodel.ecore"
xmlns:org.eclipse.bpel.ui.uiextensionmodel="http:///org/eclipse/bpel/ui/uiextensionmodel.ecore"
namespace="http://org.eclipse.bpel.ui/">
+ <extensions>
+ <extendedObject href="HelloWorld.bpel#//@variables/(a)children.0"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:VariableExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject href="HelloWorld.bpel#//@variables/(a)children.2"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:VariableExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject href="HelloWorld.bpel#//@activity"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:ActivityExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject href="HelloWorld.bpel#//@activity/(a)activities.0"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:ActivityExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject href="HelloWorld.bpel#//@activity/(a)activities.1"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:ActivityExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject
href="HelloWorld.bpel#//@activity/@activities.1/(a)copy.0"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:CopyExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject
href="HelloWorld.bpel#//@activity/@activities.1/(a)copy.1"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:CopyExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject href="HelloWorld.bpel#//@activity/(a)activities.2"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:ActivityExtension"/>
+ </extensions>
+ <extensions>
+ <extendedObject href="HelloWorld.bpel#/"/>
+ <extensionObject
xsi:type="org.eclipse.bpel.ui.uiextensionmodel:ProcessExtension"
modificationStamp="1274978025000"/>
+ </extensions>
+</extensionmodel:ExtensionMap>
Added: trunk/samples/quickstart/secure_service/bpelContent/HelloWorld.wsdl
===================================================================
--- trunk/samples/quickstart/secure_service/bpelContent/HelloWorld.wsdl
(rev 0)
+++ trunk/samples/quickstart/secure_service/bpelContent/HelloWorld.wsdl 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~
http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<wsdl:definitions
+
targetNamespace="http://www.jboss.org/bpel/examples/wsdl"
+
xmlns="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:tns="http://www.jboss.org/bpel/examples/wsdl"
+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
+
+ <wsdl:message name="HelloMessage">
+ <wsdl:part name="TestPart" type="xsd:string"/>
+ </wsdl:message>
+
+ <wsdl:portType name="SecureHelloPortType">
+ <wsdl:operation name="hello">
+ <wsdl:input message="tns:HelloMessage"
name="TestIn"/>
+ <wsdl:output message="tns:HelloMessage"
name="TestOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="SecureHelloSoapBinding"
type="tns:SecureHelloPortType">
+ <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="hello">
+ <soap:operation soapAction="" style="rpc"/>
+ <wsdl:input>
+ <soap:body
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="SecureHelloService">
+ <wsdl:port name="SecureHelloPort"
binding="tns:SecureHelloSoapBinding">
+ <soap:address
location="http://localhost:8080/Quickstart_bpel_secure_serviceWS"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="SecureHelloPartnerLinkType">
+ <plnk:role name="me"
portType="tns:SecureHelloPortType"/>
+ <plnk:role name="you"
portType="tns:SecureHelloPortType"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
+
Added: trunk/samples/quickstart/secure_service/bpelContent/bpel-deploy.xml
===================================================================
--- trunk/samples/quickstart/secure_service/bpelContent/bpel-deploy.xml
(rev 0)
+++ trunk/samples/quickstart/secure_service/bpelContent/bpel-deploy.xml 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,30 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~
http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<deploy
xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+
xmlns:bpl="http://www.jboss.org/bpel/examples"
+
xmlns:intf="http://www.jboss.org/bpel/examples/wsdl">
+
+
+ <process name="bpl:SecureHelloWorld">
+ <active>true</active>
+ <provide partnerLink="helloPartnerLink">
+ <service name="intf:SecureHelloService"
port="SecureHelloPort"/>
+ </provide>
+ </process>
+</deploy>
Added: trunk/samples/quickstart/secure_service/bpelContent/etc/Server_Decrypt.properties
===================================================================
--- trunk/samples/quickstart/secure_service/bpelContent/etc/Server_Decrypt.properties
(rev 0)
+++
trunk/samples/quickstart/secure_service/bpelContent/etc/Server_Decrypt.properties 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,5 @@
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=storepassword
+org.apache.ws.security.crypto.merlin.keystore.alias=serverx509v1
+org.apache.ws.security.crypto.merlin.file=keystore/server-keystore.jks
\ No newline at end of file
Added: trunk/samples/quickstart/secure_service/bpelContent/etc/Server_SignVerf.properties
===================================================================
--- trunk/samples/quickstart/secure_service/bpelContent/etc/Server_SignVerf.properties
(rev 0)
+++
trunk/samples/quickstart/secure_service/bpelContent/etc/Server_SignVerf.properties 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,5 @@
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=storepassword
+org.apache.ws.security.crypto.merlin.keystore.alias=clientx509v1
+org.apache.ws.security.crypto.merlin.file=keystore/server-truststore.jks
Added: trunk/samples/quickstart/secure_service/bpelContent/jbossws-cxf.xml
===================================================================
--- trunk/samples/quickstart/secure_service/bpelContent/jbossws-cxf.xml
(rev 0)
+++ trunk/samples/quickstart/secure_service/bpelContent/jbossws-cxf.xml 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,55 @@
+<beans
+
xmlns='http://www.springframework.org/schema/beans'
+
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+
xmlns:beans='http://www.springframework.org/schema/beans'
+
xmlns:jaxws='http://cxf.apache.org/jaxws'
+
xsi:schemaLocation='http://cxf.apache.org/core
+
http://cxf.apache.org/schemas/core.xsd
+
http://www.springframework.org/schema/beans
+
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+
http://cxf.apache.org/jaxws
+
http://cxf.apache.org/schemas/jaxws.xsd'>
+
+ <bean id="UsernameTokenSign_Request"
class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="UsernameToken Timestamp
Signature"/>
+ <entry key="passwordType" value="PasswordDigest"/>
+ <entry key="user" value="serverx509v1"/>
+ <entry key="passwordCallbackClass"
value="org.jboss.test.ws.jaxws.samples.wsse.ServerUsernamePasswordCallback"/>
+ <entry key="signaturePropFile"
value="etc/Server_SignVerf.properties"/>
+ <entry key="signatureKeyIdentifier"
value="DirectReference"/>
+ </map>
+ </constructor-arg>
+ </bean>
+
+ <bean id="UsernameTokenSign_Response"
class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="UsernameToken Timestamp
Signature"/>
+ <entry key="passwordType" value="PasswordText"/>
+ <entry key="user" value="serverx509v1"/>
+ <entry key="passwordCallbackClass"
value="org.jboss.test.ws.jaxws.samples.wsse.ServerUsernamePasswordCallback"/>
+ <entry key="signaturePropFile"
value="etc/Server_Decrypt.properties"/>
+ <entry key="signatureKeyIdentifier"
value="DirectReference"/>
+ <entry key="signatureParts"
value="{Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401...
+ </map>
+ </constructor-arg>
+ </bean>
+
+ <jaxws:endpoint
+ id='SecureHelloWorldWS'
+ address='http://@jboss.bind.address@:8080/Quickstart_bpel_secure_serviceWS'
+ implementor='@provider@'>
+ <jaxws:inInterceptors>
+ <ref bean="UsernameTokenSign_Request"/>
+ <bean
class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
+ </jaxws:inInterceptors>
+ <jaxws:outInterceptors>
+ <ref bean="UsernameTokenSign_Response"/>
+ <bean
class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor"/>
+ </jaxws:outInterceptors>
+ </jaxws:endpoint>
+
+
+</beans>
Added: trunk/samples/quickstart/secure_service/bpelContent/jws_handlers.xml
===================================================================
--- trunk/samples/quickstart/secure_service/bpelContent/jws_handlers.xml
(rev 0)
+++ trunk/samples/quickstart/secure_service/bpelContent/jws_handlers.xml 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<handler-chains
xmlns="http://java.sun.com/xml/ns/javaee"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://java.sun.com/xml/ns/javaee">
+ <handler-chain>
+ <handler>
+ <handler-name>JAXWSHandler</handler-name>
+ <handler-class>org.jboss.soa.bpel.examples.jaxws.JAXWSHandler</handler-class>
+ <init-param>
+ <param-name>TestParam</param-name>
+ <param-value>TestValue</param-value>
+ </init-param>
+ </handler>
+ </handler-chain>
+</handler-chains>
Added: trunk/samples/quickstart/secure_service/bpelContent/keystore/server-keystore.jks
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/quickstart/secure_service/bpelContent/keystore/server-keystore.jks
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/quickstart/secure_service/bpelContent/keystore/server-truststore.jks
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/quickstart/secure_service/bpelContent/keystore/server-truststore.jks
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/quickstart/secure_service/build.xml
===================================================================
--- trunk/samples/quickstart/secure_service/build.xml (rev 0)
+++ trunk/samples/quickstart/secure_service/build.xml 2010-05-28 11:08:19 UTC (rev 679)
@@ -0,0 +1,77 @@
+<project name="Quickstart_bpel_secure_service" default="deploy"
basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <!-- Import the base Ant build script... -->
+ <property file="../../../install/deployment.properties" />
+
+ <property name="version" value="1" />
+
+ <property name="server.dir"
value="${org.jboss.as.home}/server/${org.jboss.as.config}"/>
+ <property name="conf.dir" value="${server.dir}/conf"/>
+ <property name="deploy.dir" value="${server.dir}/deploy"/>
+ <property name="deployers.dir"
value="${server.dir}/deployers"/>
+ <property name="server.lib.dir" value="${server.dir}/lib"/>
+
+ <property name="sample.jar.name"
value="${ant.project.name}-${version}.jar" />
+
+ <property name="server.build.dir"
location="build/server"/>
+ <property name="client.build.dir"
location="build/client"/>
+
+ <path id="compile-classpath">
+ <fileset dir="${org.jboss.as.home}/client" includes="*.jar"
/>
+ <fileset dir="${deployers.dir}/jbossws.deployer"
includes="*.jar" />
+ </path>
+ <property name="compile-classpath"
refid="compile-classpath"/>
+
+ <target name="compileserver" description="build server code">
+ <!-- Compile... -->
+ <mkdir dir="${server.build.dir}" />
+ <javac srcdir="server/src" destdir="${server.build.dir}"
debug="true">
+ <classpath>
+ <path refid="compile-classpath" />
+ </classpath>
+ </javac>
+ </target>
+
+ <target name="deploy" depends="compileserver" >
+ <echo>Deploy ${ant.project.name}</echo>
+ <jar destfile="${deploy.dir}/${sample.jar.name}" >
+ <fileset dir="bpelContent"/>
+ <fileset dir="${server.build.dir}"/>
+ </jar>
+ </target>
+
+ <target name="undeploy">
+ <echo>Undeploy ${ant.project.name}</echo>
+ <delete file="${deploy.dir}/${sample.jar.name}" />
+ </target>
+
+ <target name="makeclient" description="make client">
+ <!-- Compile... -->
+ <mkdir dir="${client.build.dir}" />
+ <javac srcdir="client/src" destdir="${client.build.dir}"
debug="true">
+ <classpath>
+ <path refid="compile-classpath" />
+ </classpath>
+ </javac>
+ </target>
+
+ <target name="sendhello" description="run jaxws static client"
depends="makeclient" >
+ <java
classname="org.jboss.soa.bpel.examples.jaxws.JAXWSDispatcherClient"
fork="yes" >
+ <arg value="${basedir}/bpelContent/HelloWorld.wsdl"/>
+ <!-- arg
value="http://localhost:8080/Quickstart_bpel_secure_serviceWS"/ -->
+ <arg value="messages/hello_request1.xml"/>
+ <classpath>
+ <pathelement location="${client.build.dir}"/>
+ <path refid="compile-classpath" />
+ <pathelement location="${basedir}/client/resources"/>
+ <fileset dir="${org.jboss.as.home}/lib/endorsed"
includes="*.jar" />
+ </classpath>
+ </java>
+ </target>
+
+</project>
Added:
trunk/samples/quickstart/secure_service/client/resources/etc/Client_Encrypt.properties
===================================================================
---
trunk/samples/quickstart/secure_service/client/resources/etc/Client_Encrypt.properties
(rev 0)
+++
trunk/samples/quickstart/secure_service/client/resources/etc/Client_Encrypt.properties 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,5 @@
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=storepassword
+org.apache.ws.security.crypto.merlin.keystore.alias=serverx509v1
+org.apache.ws.security.crypto.merlin.file=keystore/client-truststore.jks
\ No newline at end of file
Added:
trunk/samples/quickstart/secure_service/client/resources/etc/Client_Sign.properties
===================================================================
--- trunk/samples/quickstart/secure_service/client/resources/etc/Client_Sign.properties
(rev 0)
+++
trunk/samples/quickstart/secure_service/client/resources/etc/Client_Sign.properties 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,6 @@
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=storepassword
+org.apache.ws.security.crypto.merlin.keystore.alias=clientx509v1
+org.apache.ws.security.crypto.merlin.file=keystore/client-keystore.jks
+
Added:
trunk/samples/quickstart/secure_service/client/resources/keystore/client-keystore.jks
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/quickstart/secure_service/client/resources/keystore/client-keystore.jks
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/samples/quickstart/secure_service/client/resources/keystore/client-truststore.jks
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/quickstart/secure_service/client/resources/keystore/client-truststore.jks
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/quickstart/secure_service/client/resources/wssec.xml
===================================================================
--- trunk/samples/quickstart/secure_service/client/resources/wssec.xml
(rev 0)
+++ trunk/samples/quickstart/secure_service/client/resources/wssec.xml 2010-05-28 11:08:19
UTC (rev 679)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans
xmlns="http://www.springframework.org/schema/beans"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns:cxf="http://cxf.apache.org/core"
+
xmlns:wsa="http://cxf.apache.org/ws/addressing"
+
xmlns:http="http://cxf.apache.org/transports/http/configuration"
+
xmlns:wsrm-policy="http://schemas.xmlsoap.org/ws/2005/02/rm/policy&q...
+
xmlns:wsrm-mgr="http://cxf.apache.org/ws/rm/manager"
+
xmlns:beans='http://www.springframework.org/schema/beans'
+
xmlns:jaxws='http://cxf.apache.org/jaxws'
+ xmlns:ns1='http://secure_invoke/helloworld'
+ xsi:schemaLocation="
+
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+
http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd
+
http://schemas.xmlsoap.org/ws/2005/02/rm/policy
http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd
+
http://cxf.apache.org/ws/rm/manager
http://cxf.apache.org/schemas/configuration/wsrm-manager.xsd
+
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
+
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
+
+ <bean id="UsernameTokenSign_Request"
class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor"
+ name="{http://secure_invoke/helloworld}SecureHelloWorldPort.Request"
>
+ <constructor-arg>
+ <map>
+ <entry key="action" value="UsernameToken Timestamp
Signature"/>
+ <entry key="passwordType" value="PasswordDigest"/>
+ <entry key="user" value="clientx509v1"/>
+ <entry key="passwordCallbackClass"
value="org.jboss.test.ws.jaxws.samples.wsse.ClientUsernamePasswordCallback"/>
+ <entry key="signaturePropFile"
value="etc/Client_Sign.properties"/>
+ <entry key="signatureKeyIdentifier"
value="DirectReference"/>
+ <entry key="signatureParts"
value="{Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401...
+ </map>
+ </constructor-arg>
+ </bean>
+
+ <bean id="UsernameTokenSign_Response"
class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor"
+ name="{http://secure_invoke/helloworld}SecureHelloWorldPort.Response"
>
+ <constructor-arg>
+ <map>
+ <entry key="action" value="UsernameToken Timestamp
Signature"/>
+ <entry key="passwordType" value="PasswordText"/>
+ <entry key="user" value="serverx509v1"/>
+ <entry key="passwordCallbackClass"
value="org.jboss.test.ws.jaxws.samples.wsse.ClientUsernamePasswordCallback"/>
+ <entry key="signaturePropFile"
value="etc/Client_Encrypt.properties"/>
+ <entry key="signatureKeyIdentifier"
value="DirectReference"/>
+ </map>
+ </constructor-arg>
+ </bean>
+
+
+ <cxf:bus>
+ <cxf:outInterceptors>
+ <ref bean="UsernameTokenSign_Request"/>
+ <bean
class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor"/>
+ </cxf:outInterceptors>
+ <cxf:inInterceptors>
+ <ref bean="UsernameTokenSign_Response"/>
+ <bean
class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
+ </cxf:inInterceptors>
+ </cxf:bus>
+
+</beans>
Added:
trunk/samples/quickstart/secure_service/client/src/org/jboss/soa/bpel/examples/jaxws/JAXWSDispatcherClient.java
===================================================================
---
trunk/samples/quickstart/secure_service/client/src/org/jboss/soa/bpel/examples/jaxws/JAXWSDispatcherClient.java
(rev 0)
+++
trunk/samples/quickstart/secure_service/client/src/org/jboss/soa/bpel/examples/jaxws/JAXWSDispatcherClient.java 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,90 @@
+
+package org.jboss.soa.bpel.examples.jaxws;
+
+/**
+ * Please modify this class to meet your needs
+ * This class is not complete
+ */
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Service;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor;
+import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
+
+/**
+ * This class was generated by Apache CXF 2.2.6
+ * Thu May 06 14:29:08 BST 2010
+ * Generated source version: 2.2.6
+ *
+ */
+
+public final class JAXWSDispatcherClient {
+
+ private static final QName SERVICE_NAME = new
QName("http://www.jboss.org/bpel/examples/wsdl",
"SecureHelloService");
+
+ private JAXWSDispatcherClient() {
+ }
+
+ public static void main(String args[]) throws Exception {
+ URL wsdlURL = null;
+
+ if (args.length != 2) {
+ System.err.println("Usage: JAXWSDispatcherClient wsdlURL
messageFile");
+ System.exit(1);
+ }
+
+ File wsdlFile = new File(args[0]);
+ try {
+ if (wsdlFile.exists()) {
+ wsdlURL = wsdlFile.toURI().toURL();
+ } else {
+ wsdlURL = new URL(args[0]);
+ }
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ System.exit(2);
+ }
+
+ SpringBusFactory bf = new SpringBusFactory();
+ URL busFile = ClassLoader.getSystemResource("wssec.xml");
+ Bus bus = bf.createBus(busFile.toString());
+ bf.setDefaultBus(bus);
+
+ QName portName=new
QName("http://www.jboss.org/bpel/examples/wsdl",
"SecureHelloPort");
+
+
+ Service service = Service.create(wsdlURL, SERVICE_NAME);
+ Dispatch<SOAPMessage> dispatcher = service.createDispatch(
+ portName,
+ SOAPMessage.class,
+ Service.Mode.MESSAGE
+ );
+
+ MessageFactory factory = MessageFactory.newInstance();
+
+ String str="<soapenv:Envelope
xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"
xmlns:wsdl=\"http://www.jboss.org/bpel/examples/wsdl\">"+
+
"<soapenv:Header/><soapenv:Body><wsdl:hello><TestPart>Hello</TestPart></wsdl:hello></soapenv:Body></soapenv:Envelope>";
+ java.io.InputStream is=new java.io.ByteArrayInputStream(str.getBytes());
+
+ SOAPMessage soapReq1 = factory.createMessage(null, is);
+
+ System.out.println("Invoking server through Dispatch interface using
SOAPMessage");
+ SOAPMessage soapResp = dispatcher.invoke(soapReq1);
+ System.out.println("Response from server: " +
soapResp.getSOAPBody().getTextContent());
+
+ System.exit(0);
+ }
+
+}
Added:
trunk/samples/quickstart/secure_service/client/src/org/jboss/test/ws/jaxws/samples/wsse/ClientUsernamePasswordCallback.java
===================================================================
---
trunk/samples/quickstart/secure_service/client/src/org/jboss/test/ws/jaxws/samples/wsse/ClientUsernamePasswordCallback.java
(rev 0)
+++
trunk/samples/quickstart/secure_service/client/src/org/jboss/test/ws/jaxws/samples/wsse/ClientUsernamePasswordCallback.java 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,73 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ */
+
+public class ClientUsernamePasswordCallback implements CallbackHandler {
+
+ private Map<String, String> passwords =
+ new HashMap<String, String>();
+
+ public ClientUsernamePasswordCallback() {
+ passwords.put("Alice", "ecilA");
+ passwords.put("abcd", "dcba");
+ passwords.put("clientx509v1", "storepassword");
+ passwords.put("serverx509v1", "storepassword");
+ }
+
+ /**
+ * Here, we attempt to get the password from the private
+ * alias/passwords map.
+ */
+ public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
+
+ String pass = passwords.get(pc.getIdentifier());
+ if (pass != null) {
+ pc.setPassword(pass);
+ return;
+ }
+ }
+
+ //
+ // Password not found
+ //
+ throw new IOException();
+ }
+
+ /**
+ * Add an alias/password pair to the callback mechanism.
+ */
+ public void setAliasPassword(String alias, String password) {
+ passwords.put(alias, password);
+ }
+}
Added:
trunk/samples/quickstart/secure_service/client/src/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java
===================================================================
---
trunk/samples/quickstart/secure_service/client/src/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java
(rev 0)
+++
trunk/samples/quickstart/secure_service/client/src/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse;
+
+import java.io.IOException;
+import java.util.*;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import org.apache.ws.security.WSPasswordCallback;
+
+public class ServerUsernamePasswordCallback implements CallbackHandler
+{
+ private Map<String, String> passwords =
+ new HashMap<String, String>();
+
+ public ServerUsernamePasswordCallback() {
+ passwords.put("Alice", "ecilA");
+ passwords.put("abcd", "dcba");
+ passwords.put("clientx509v1", "storepassword");
+ passwords.put("serverx509v1", "storepassword");
+ }
+
+ /**
+ * Here, we attempt to get the password from the private
+ * alias/passwords map.
+ */
+ public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
+
+ System.out.println("**************** Server check id:
"+pc.getIdentifer());
+
+ String pass = passwords.get(pc.getIdentifier());
+ if (pass != null) {
+ pc.setPassword(pass);
+ return;
+ }
+ }
+
+ //
+ // Password not found
+ //
+ throw new IOException();
+ }
+
+ /**
+ * Add an alias/password pair to the callback mechanism.
+ */
+ public void setAliasPassword(String alias, String password) {
+ passwords.put(alias, password);
+ }
+}
Added: trunk/samples/quickstart/secure_service/messages/hello_request1.xml
===================================================================
--- trunk/samples/quickstart/secure_service/messages/hello_request1.xml
(rev 0)
+++ trunk/samples/quickstart/secure_service/messages/hello_request1.xml 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,8 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsdl="http://www.jboss.org/bpel/examples/wsdl">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <wsdl:hello>
+ <TestPart>Hello</TestPart>
+ </wsdl:hello>
+ </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file
Added: trunk/samples/quickstart/secure_service/readme.txt
===================================================================
--- trunk/samples/quickstart/secure_service/readme.txt (rev 0)
+++ trunk/samples/quickstart/secure_service/readme.txt 2010-05-28 11:08:19 UTC (rev 679)
@@ -0,0 +1,25 @@
+Quickstart Examples - Hello World
+=================================
+
+This is a simple echo example, used to respond to a sent message with a
+modified version of the request message being returned in a response.
+
+To deploy the example, open a command line window in the example's folder,
+and simply type 'ant deploy'. To undeploy, use the command 'ant
undeploy'.
+
+To test the example, for example using the SOAPUI client, an example message
+can be found in the messages sub-folder, with the relevant WSDL being
+located in the bpel sub-folder.
+
+Alternatively, use the 'ant sendhello' command (from a command line window)
+to send the example message directly to the deployed process.
+
+NOTE: The "ant deploy" command will by default deploy version 1 of the
+example to the server. If you wish to change the example, and redeploy,
+then you will need to update the version number in the build.xml, or
+override the version property, e.g. "ant -Dversion=2 deploy" (and similarly
+when undeploying "ant -Dversion=2 undeploy").
+
+Some handy URLs:
+http://localhost:8080/bpel-console is the BPEL console
+http://localhost:8080/Quickstart_bpel_hello_worldWS?wsdl is the URL to the BPEL
process' WSDL
Added:
trunk/samples/quickstart/secure_service/server/src/org/jboss/soa/bpel/examples/jaxws/JAXWSHandler.java
===================================================================
---
trunk/samples/quickstart/secure_service/server/src/org/jboss/soa/bpel/examples/jaxws/JAXWSHandler.java
(rev 0)
+++
trunk/samples/quickstart/secure_service/server/src/org/jboss/soa/bpel/examples/jaxws/JAXWSHandler.java 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,109 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.jboss.soa.bpel.examples.jaxws;
+
+
+import java.io.PrintStream;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+/*
+ * This simple SOAPHandler will output the contents of incoming
+ * and outgoing messages.
+ */
+public class JAXWSHandler implements SOAPHandler<SOAPMessageContext> {
+
+ private PrintStream out;
+
+ public JAXWSHandler() {
+ setLogStream(System.out);
+ }
+
+ protected final void setLogStream(PrintStream ps) {
+ out = ps;
+ }
+
+ public void init(Map c) {
+ System.out.println("JAXWSHandler : init() Called....:"+c);
+ }
+
+ public Set<QName> getHeaders() {
+ return null;
+ }
+
+ public boolean handleMessage(SOAPMessageContext smc) {
+ System.out.println("JAXWSHandler : handleMessage Called....");
+ logToSystemOut(smc);
+ return true;
+ }
+
+ public boolean handleFault(SOAPMessageContext smc) {
+ System.out.println("JAXWSHandler : handleFault Called....");
+ logToSystemOut(smc);
+ return true;
+ }
+
+ // nothing to clean up
+ public void close(MessageContext messageContext) {
+ System.out.println("JAXWSHandler : close() Called....");
+ }
+
+ // nothing to clean up
+ public void destroy() {
+ System.out.println("LoggingHandler : destroy() Called....");
+ }
+
+ /*
+ * Check the MESSAGE_OUTBOUND_PROPERTY in the context
+ * to see if this is an outgoing or incoming message.
+ * Write a brief message to the print stream and
+ * output the message. The writeTo() method can throw
+ * SOAPException or IOException
+ */
+ protected void logToSystemOut(SOAPMessageContext smc) {
+ Boolean outboundProperty = (Boolean)
+ smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+
+ if (outboundProperty.booleanValue()) {
+ out.println("\nOutbound message:");
+ } else {
+ out.println("\nInbound message:");
+ }
+
+ SOAPMessage message = smc.getMessage();
+ try {
+ message.writeTo(out);
+ out.println();
+ } catch (Exception e) {
+ out.println("Exception in handler: " + e);
+ }
+
+ out.println("WSDL_SERVICE = "+smc.get(MessageContext.WSDL_SERVICE));
+ out.println("WSDL_INTERFACE = "+smc.get(MessageContext.WSDL_INTERFACE));
+ out.println("WSDL_PORT = "+smc.get(MessageContext.WSDL_PORT));
+ out.println("WSDL_OPERATION = "+smc.get(MessageContext.WSDL_OPERATION));
+ }
+}
Added:
trunk/samples/quickstart/secure_service/server/src/org/jboss/test/ws/jaxws/samples/wsse/ClientUsernamePasswordCallback.java
===================================================================
---
trunk/samples/quickstart/secure_service/server/src/org/jboss/test/ws/jaxws/samples/wsse/ClientUsernamePasswordCallback.java
(rev 0)
+++
trunk/samples/quickstart/secure_service/server/src/org/jboss/test/ws/jaxws/samples/wsse/ClientUsernamePasswordCallback.java 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,73 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ */
+
+public class ClientUsernamePasswordCallback implements CallbackHandler {
+
+ private Map<String, String> passwords =
+ new HashMap<String, String>();
+
+ public ClientUsernamePasswordCallback() {
+ passwords.put("Alice", "ecilA");
+ passwords.put("abcd", "dcba");
+ passwords.put("clientx509v1", "storepassword");
+ passwords.put("serverx509v1", "storepassword");
+ }
+
+ /**
+ * Here, we attempt to get the password from the private
+ * alias/passwords map.
+ */
+ public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
+
+ String pass = passwords.get(pc.getIdentifier());
+ if (pass != null) {
+ pc.setPassword(pass);
+ return;
+ }
+ }
+
+ //
+ // Password not found
+ //
+ throw new IOException();
+ }
+
+ /**
+ * Add an alias/password pair to the callback mechanism.
+ */
+ public void setAliasPassword(String alias, String password) {
+ passwords.put(alias, password);
+ }
+}
Added:
trunk/samples/quickstart/secure_service/server/src/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java
===================================================================
---
trunk/samples/quickstart/secure_service/server/src/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java
(rev 0)
+++
trunk/samples/quickstart/secure_service/server/src/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse;
+
+import java.io.IOException;
+import java.util.*;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import org.apache.ws.security.WSPasswordCallback;
+
+public class ServerUsernamePasswordCallback implements CallbackHandler
+{
+ private Map<String, String> passwords =
+ new HashMap<String, String>();
+
+ public ServerUsernamePasswordCallback() {
+ passwords.put("Alice", "ecilA");
+ passwords.put("abcd", "dcba");
+ passwords.put("clientx509v1", "storepassword");
+ passwords.put("serverx509v1", "storepassword");
+ }
+
+ /**
+ * Here, we attempt to get the password from the private
+ * alias/passwords map.
+ */
+ public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
+
+ System.out.println("**************** Server check id:
"+pc.getIdentifer());
+
+ String pass = passwords.get(pc.getIdentifier());
+ if (pass != null) {
+ pc.setPassword(pass);
+ return;
+ }
+ }
+
+ //
+ // Password not found
+ //
+ throw new IOException();
+ }
+
+ /**
+ * Add an alias/password pair to the callback mechanism.
+ */
+ public void setAliasPassword(String alias, String password) {
+ passwords.put(alias, password);
+ }
+}
\ No newline at end of file
Added: trunk/samples/quickstart/secure_service/wssec.xml
===================================================================
--- trunk/samples/quickstart/secure_service/wssec.xml (rev 0)
+++ trunk/samples/quickstart/secure_service/wssec.xml 2010-05-28 11:08:19 UTC (rev 679)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans
xmlns="http://www.springframework.org/schema/beans"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns:cxf="http://cxf.apache.org/core"
+
xmlns:wsa="http://cxf.apache.org/ws/addressing"
+
xmlns:http="http://cxf.apache.org/transports/http/configuration"
+
xmlns:wsrm-policy="http://schemas.xmlsoap.org/ws/2005/02/rm/policy&q...
+
xmlns:wsrm-mgr="http://cxf.apache.org/ws/rm/manager"
+
xmlns:beans='http://www.springframework.org/schema/beans'
+
xmlns:jaxws='http://cxf.apache.org/jaxws'
+ xmlns:ns1='http://secure_invoke/helloworld'
+ xsi:schemaLocation="
+
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+
http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd
+
http://schemas.xmlsoap.org/ws/2005/02/rm/policy
http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd
+
http://cxf.apache.org/ws/rm/manager
http://cxf.apache.org/schemas/configuration/wsrm-manager.xsd
+
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
+
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
+
+ <bean id="UsernameTokenSign_Request"
class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor"
+ name="{http://secure_invoke/helloworld}SecureHelloWorldPort.Request"
>
+ <constructor-arg>
+ <map>
+ <entry key="action" value="UsernameToken Timestamp
Signature"/>
+ <entry key="passwordType" value="PasswordDigest"/>
+ <entry key="user" value="clientx509v1"/>
+ <entry key="passwordCallbackClass"
value="org.jboss.test.ws.jaxws.samples.wsse.ClientUsernamePasswordCallback"/>
+ <entry key="signaturePropFile"
value="etc/Client_Sign.properties"/>
+ <entry key="signatureKeyIdentifier"
value="DirectReference"/>
+ <entry key="signatureParts"
value="{Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401...
+ </map>
+ </constructor-arg>
+ </bean>
+
+ <bean id="UsernameTokenSign_Response"
class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor"
+ name="{http://secure_invoke/helloworld}SecureHelloWorldPort.Response"
>
+ <constructor-arg>
+ <map>
+ <entry key="action" value="UsernameToken Timestamp
Signature"/>
+ <entry key="passwordType" value="PasswordText"/>
+ <entry key="user" value="serverx509v1"/>
+ <entry key="passwordCallbackClass"
value="org.jboss.test.ws.jaxws.samples.wsse.ClientUsernamePasswordCallback"/>
+ <entry key="signaturePropFile"
value="etc/Client_Encrypt.properties"/>
+ <entry key="signatureKeyIdentifier"
value="DirectReference"/>
+ </map>
+ </constructor-arg>
+ </bean>
+
+
+ <cxf:bus>
+ <cxf:outInterceptors>
+ <ref bean="UsernameTokenSign_Request"/>
+ <bean
class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor"/>
+ </cxf:outInterceptors>
+ <cxf:inInterceptors>
+ <ref bean="UsernameTokenSign_Response"/>
+ <bean
class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
+ </cxf:inInterceptors>
+ </cxf:bus>
+
+</beans>
Added:
trunk/samples/quickstart/service_handler/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/samples/quickstart/service_handler/.settings/org.eclipse.wst.common.component
(rev 0)
+++
trunk/samples/quickstart/service_handler/.settings/org.eclipse.wst.common.component 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="Quickstart_bpel_simple_invoke">
+ <wb-resource deploy-path="/"
source-path="/bpelContent"/>
+ <dependent-module deploy-path="/"
handle="module:/org.jboss.ide.eclipse.as.wtp.core.vcf.outputFolders/">
+ <dependency-type>consumes</dependency-type>
+ </dependent-module>
+ </wb-module>
+</project-modules>
Added:
trunk/samples/quickstart/service_handler/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
---
trunk/samples/quickstart/service_handler/.settings/org.eclipse.wst.common.project.facet.core.xml
(rev 0)
+++
trunk/samples/quickstart/service_handler/.settings/org.eclipse.wst.common.project.facet.core.xml 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <fixed facet="jbt.bpel.facet.core"/>
+ <installed facet="jbt.bpel.facet.core" version="2.0"/>
+</faceted-project>
Added: trunk/samples/quickstart/service_handler/bpelContent/HelloWorld.bpel
===================================================================
--- trunk/samples/quickstart/service_handler/bpelContent/HelloWorld.bpel
(rev 0)
+++ trunk/samples/quickstart/service_handler/bpelContent/HelloWorld.bpel 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,68 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~
http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<process name="HelloWorld"
+
targetNamespace="http://www.jboss.org/bpel/examples"
+
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+
xmlns:tns="http://www.jboss.org/bpel/examples"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:intf="http://www.jboss.org/bpel/examples/wsdl"
+ queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+ expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
+
+ <import location="HelloWorld.wsdl"
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+
importType="http://schemas.xmlsoap.org/wsdl/" />
+
+ <partnerLinks>
+ <partnerLink name="helloPartnerLink"
+ partnerLinkType="intf:HelloPartnerLinkType"
+ myRole="me" />
+ </partnerLinks>
+
+ <variables>
+ <variable name="myVar" messageType="intf:HelloMessage"/>
+ <variable name="mesgVar" type="xsd:string"/>
+ </variables>
+
+ <sequence>
+ <receive
+ name="start"
+ partnerLink="helloPartnerLink"
+ portType="intf:HelloPortType"
+ operation="hello"
+ variable="myVar"
+ createInstance="yes"/>
+
+ <assign name="assignHelloMesg">
+ <copy>
+ <from variable="myVar" part="TestPart"/>
+ <to variable="mesgVar"/>
+ </copy>
+ <copy>
+ <from>concat($mesgVar,' World')</from>
+ <to variable="myVar" part="TestPart"/>
+ </copy>
+ </assign>
+ <reply name="end"
+ partnerLink="helloPartnerLink"
+ portType="intf:HelloPortType"
+ operation="hello"
+ variable="myVar"/>
+ </sequence>
+</process>
Added: trunk/samples/quickstart/service_handler/bpelContent/HelloWorld.wsdl
===================================================================
--- trunk/samples/quickstart/service_handler/bpelContent/HelloWorld.wsdl
(rev 0)
+++ trunk/samples/quickstart/service_handler/bpelContent/HelloWorld.wsdl 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~
http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<wsdl:definitions
+
targetNamespace="http://www.jboss.org/bpel/examples/wsdl"
+
xmlns="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:tns="http://www.jboss.org/bpel/examples/wsdl"
+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
+
+ <wsdl:message name="HelloMessage">
+ <wsdl:part name="TestPart" type="xsd:string"/>
+ </wsdl:message>
+
+ <wsdl:portType name="HelloPortType">
+ <wsdl:operation name="hello">
+ <wsdl:input message="tns:HelloMessage"
name="TestIn"/>
+ <wsdl:output message="tns:HelloMessage"
name="TestOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="HelloSoapBinding"
type="tns:HelloPortType">
+ <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="hello">
+ <soap:operation soapAction="" style="rpc"/>
+ <wsdl:input>
+ <soap:body
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="HelloService">
+ <wsdl:port name="HelloPort"
binding="tns:HelloSoapBinding">
+ <soap:address
location="http://localhost:8080/Quickstart_bpel_service_handlerWS"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="HelloPartnerLinkType">
+ <plnk:role name="me" portType="tns:HelloPortType"/>
+ <plnk:role name="you" portType="tns:HelloPortType"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
+
Added: trunk/samples/quickstart/service_handler/bpelContent/bpel-deploy.xml
===================================================================
--- trunk/samples/quickstart/service_handler/bpelContent/bpel-deploy.xml
(rev 0)
+++ trunk/samples/quickstart/service_handler/bpelContent/bpel-deploy.xml 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,30 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~
http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<deploy
xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+
xmlns:bpl="http://www.jboss.org/bpel/examples"
+
xmlns:intf="http://www.jboss.org/bpel/examples/wsdl">
+
+
+ <process name="bpl:HelloWorld">
+ <active>true</active>
+ <provide partnerLink="helloPartnerLink">
+ <service name="intf:HelloService" port="HelloPort"/>
+ </provide>
+ </process>
+</deploy>
Added: trunk/samples/quickstart/service_handler/bpelContent/jws_handlers.xml
===================================================================
--- trunk/samples/quickstart/service_handler/bpelContent/jws_handlers.xml
(rev 0)
+++ trunk/samples/quickstart/service_handler/bpelContent/jws_handlers.xml 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<handler-chains
xmlns="http://java.sun.com/xml/ns/javaee"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://java.sun.com/xml/ns/javaee">
+ <handler-chain>
+ <handler>
+ <handler-name>JAXWSHandler</handler-name>
+ <handler-class>org.jboss.soa.bpel.examples.jaxws.JAXWSHandler</handler-class>
+ <init-param>
+ <param-name>TestParam</param-name>
+ <param-value>TestValue</param-value>
+ </init-param>
+ </handler>
+ </handler-chain>
+</handler-chains>
Added: trunk/samples/quickstart/service_handler/build.xml
===================================================================
--- trunk/samples/quickstart/service_handler/build.xml (rev 0)
+++ trunk/samples/quickstart/service_handler/build.xml 2010-05-28 11:08:19 UTC (rev 679)
@@ -0,0 +1,65 @@
+<project name="Quickstart_bpel_service_handler" default="deploy"
basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <!-- Import the base Ant build script... -->
+ <property file="../../../install/deployment.properties" />
+
+ <property name="version" value="1" />
+
+ <property name="server.dir"
value="${org.jboss.as.home}/server/${org.jboss.as.config}"/>
+ <property name="conf.dir" value="${server.dir}/conf"/>
+ <property name="deploy.dir" value="${server.dir}/deploy"/>
+ <property name="deployers.dir"
value="${server.dir}/deployers"/>
+ <property name="server.lib.dir" value="${server.dir}/lib"/>
+
+ <property name="sample.jar.name"
value="${ant.project.name}-${version}.jar" />
+
+ <property name="code.build.dir"
location="build/classes"/>
+
+ <path id="compile-classpath">
+ <fileset dir="${deployers.dir}/jbossws.deployer"
includes="*.jar" />
+ </path>
+
+ <property name="compile-classpath"
refid="compile-classpath"/>
+
+ <target name="compilecode" description="build code">
+ <!-- Compile... -->
+ <mkdir dir="${code.build.dir}" />
+ <javac srcdir="code/src" destdir="${code.build.dir}"
debug="true">
+ <classpath>
+ <path refid="compile-classpath" />
+ </classpath>
+ </javac>
+ </target>
+
+ <target name="deploy" depends="compilecode" >
+ <echo>Deploy ${ant.project.name}</echo>
+ <jar destfile="${deploy.dir}/${sample.jar.name}" >
+ <fileset dir="bpelContent"/>
+ <fileset dir="${code.build.dir}"/>
+ </jar>
+ </target>
+
+ <target name="undeploy">
+ <echo>Undeploy ${ant.project.name}</echo>
+ <delete file="${deploy.dir}/${sample.jar.name}" />
+ </target>
+
+ <target name="sendhello">
+ <echo>Send test message to: ${ant.project.name}</echo>
+ <java
classname="org.apache.ode.tools.sendsoap.cline.HttpSoapSender">
+ <arg
value="http://localhost:8080/Quickstart_bpel_service_handlerWS"/>
+ <arg value="messages/hello_request1.xml"/>
+ <classpath>
+ <fileset dir="../../common/lib">
+ <include name="**/*.jar"/>
+ </fileset>
+ <pathelement path="${java.class.path}"/>
+ </classpath>
+ </java>
+ </target>
+</project>
Added:
trunk/samples/quickstart/service_handler/code/src/org/jboss/soa/bpel/examples/jaxws/JAXWSHandler.java
===================================================================
---
trunk/samples/quickstart/service_handler/code/src/org/jboss/soa/bpel/examples/jaxws/JAXWSHandler.java
(rev 0)
+++
trunk/samples/quickstart/service_handler/code/src/org/jboss/soa/bpel/examples/jaxws/JAXWSHandler.java 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.soa.bpel.examples.jaxws;
+
+import java.io.PrintStream;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+/**
+ * This class provides an example jaxws handler that can be deployed with
+ * a BPEL process, to provide visibility of messages inbound and outbound
+ * from the web service interface.
+ *
+ * @author gbrown
+ *
+ */
+public class JAXWSHandler implements SOAPHandler<SOAPMessageContext> {
+
+ private PrintStream out;
+
+ public JAXWSHandler() {
+ setLogStream(System.out);
+ }
+
+ protected final void setLogStream(PrintStream ps) {
+ out = ps;
+ }
+
+ public void init(Map c) {
+ System.out.println("JAXWSHandler : init() Called....:"+c);
+ }
+
+ public Set<QName> getHeaders() {
+ return null;
+ }
+
+ public boolean handleMessage(SOAPMessageContext smc) {
+ System.out.println("JAXWSHandler : handleMessage Called....");
+ logToSystemOut(smc);
+ return true;
+ }
+
+ public boolean handleFault(SOAPMessageContext smc) {
+ System.out.println("JAXWSHandler : handleFault Called....");
+ logToSystemOut(smc);
+ return true;
+ }
+
+ public void close(MessageContext messageContext) {
+ System.out.println("JAXWSHandler : close() Called....");
+ }
+
+ public void destroy() {
+ System.out.println("JAXWSHandler : destroy() Called....");
+ }
+
+ protected void logToSystemOut(SOAPMessageContext smc) {
+ Boolean outboundProperty = (Boolean)
+ smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+
+ if (outboundProperty.booleanValue()) {
+ out.println("\nOutbound message:");
+ } else {
+ out.println("\nInbound message:");
+ }
+
+ SOAPMessage message = smc.getMessage();
+ try {
+ message.writeTo(out);
+ out.println();
+ } catch (Exception e) {
+ out.println("Exception in handler: " + e);
+ }
+
+ out.println("WSDL_SERVICE = "+smc.get(MessageContext.WSDL_SERVICE));
+ out.println("WSDL_INTERFACE = "+smc.get(MessageContext.WSDL_INTERFACE));
+ out.println("WSDL_PORT = "+smc.get(MessageContext.WSDL_PORT));
+ out.println("WSDL_OPERATION = "+smc.get(MessageContext.WSDL_OPERATION));
+ }
+}
Added: trunk/samples/quickstart/service_handler/messages/hello_request1.xml
===================================================================
--- trunk/samples/quickstart/service_handler/messages/hello_request1.xml
(rev 0)
+++ trunk/samples/quickstart/service_handler/messages/hello_request1.xml 2010-05-28
11:08:19 UTC (rev 679)
@@ -0,0 +1,8 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsdl="http://www.jboss.org/bpel/examples/wsdl">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <wsdl:hello>
+ <TestPart>Hello</TestPart>
+ </wsdl:hello>
+ </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file
Added: trunk/samples/quickstart/service_handler/readme.txt
===================================================================
--- trunk/samples/quickstart/service_handler/readme.txt (rev 0)
+++ trunk/samples/quickstart/service_handler/readme.txt 2010-05-28 11:08:19 UTC (rev 679)
@@ -0,0 +1,29 @@
+Quickstart Examples - Service Handler
+=====================================
+
+This example builds on the hello_world example, which simply echos a message.
+The example is extended by adding a JAXWS handler to the Web Service that
+provides access to the BPEL process. This enables inbound and outbound
+messages (and faults) to be intercepted by a user supplied Java class. In
+this particular example, the JAXWS handler simply displays information
+on the JBoss console.
+
+To deploy the example, open a command line window in the example's folder,
+and simply type 'ant deploy'. To undeploy, use the command 'ant
undeploy'.
+
+To test the example, for example using the SOAPUI client, an example message
+can be found in the messages sub-folder, with the relevant WSDL being
+located in the bpel sub-folder.
+
+Alternatively, use the 'ant sendhello' command (from a command line window)
+to send the example message directly to the deployed process.
+
+NOTE: The "ant deploy" command will by default deploy version 1 of the
+example to the server. If you wish to change the example, and redeploy,
+then you will need to update the version number in the build.xml, or
+override the version property, e.g. "ant -Dversion=2 deploy" (and similarly
+when undeploying "ant -Dversion=2 undeploy").
+
+Some handy URLs:
+http://localhost:8080/bpel-console is the BPEL console
+http://localhost:8080/Quickstart_bpel_service_handlerWS?wsdl is the URL to the BPEL
process' WSDL