Author: objectiser
Date: 2010-11-25 05:53:34 -0500 (Thu, 25 Nov 2010)
New Revision: 1156
Added:
dsp/trunk/samples/
dsp/trunk/samples/deployer/
dsp/trunk/samples/deployer/.classpath
dsp/trunk/samples/deployer/.project
dsp/trunk/samples/deployer/.settings/
dsp/trunk/samples/deployer/.settings/.jsdtscope
dsp/trunk/samples/deployer/.settings/org.eclipse.jdt.core.prefs
dsp/trunk/samples/deployer/.settings/org.eclipse.wst.common.component
dsp/trunk/samples/deployer/.settings/org.eclipse.wst.common.project.facet.core.xml
dsp/trunk/samples/deployer/.settings/org.eclipse.wst.jsdt.ui.superType.container
dsp/trunk/samples/deployer/.settings/org.eclipse.wst.jsdt.ui.superType.name
dsp/trunk/samples/deployer/src/
dsp/trunk/samples/deployer/src/main/
dsp/trunk/samples/deployer/src/main/java/
dsp/trunk/samples/deployer/src/main/java/org/
dsp/trunk/samples/deployer/src/main/java/org/jboss/
dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/
dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/dsp/
dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/dsp/example/
dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/dsp/example/DeployServlet.java
dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/dsp/example/ExampleServiceProvider.java
dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/dsp/example/ExampleWebServiceFactory.java
dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/dsp/example/WSDeployer.java
dsp/trunk/samples/deployer/src/main/resources/
dsp/trunk/samples/deployer/src/main/resources/META-INF/
dsp/trunk/samples/deployer/src/main/resources/META-INF/MANIFEST.MF
dsp/trunk/samples/deployer/src/main/resources/WEB-INF/
dsp/trunk/samples/deployer/src/main/resources/WEB-INF/lib/
dsp/trunk/samples/deployer/src/main/resources/WEB-INF/lib/commons-fileupload-1.2.2.jar
dsp/trunk/samples/deployer/src/main/resources/WEB-INF/lib/commons-io-1.3.2.jar
dsp/trunk/samples/deployer/src/main/resources/WEB-INF/lib/dsp-1.0.0-SNAPSHOT.jar
dsp/trunk/samples/deployer/src/main/resources/WEB-INF/web.xml
dsp/trunk/samples/deployer/src/main/resources/files/
dsp/trunk/samples/deployer/src/main/resources/tmp/
dsp/trunk/samples/deployer/src/main/resources/upload.html
Log:
Example deployment using dsp from a servlet.
Added: dsp/trunk/samples/deployer/.classpath
===================================================================
--- dsp/trunk/samples/deployer/.classpath (rev 0)
+++ dsp/trunk/samples/deployer/.classpath 2010-11-25 10:53:34 UTC (rev 1156)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/java-1.6.0-openjdk-1.6.0.0">
+ <attributes>
+ <attribute name="owner.project.facets" value="java"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con"
path="org.eclipse.jst.server.core.container/org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget/JBoss
5.1 Runtime">
+ <attributes>
+ <attribute name="owner.project.facets" value="jst.web"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con"
path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con"
path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="output" path="build/classes"/>
+</classpath>
Added: dsp/trunk/samples/deployer/.project
===================================================================
--- dsp/trunk/samples/deployer/.project (rev 0)
+++ dsp/trunk/samples/deployer/.project 2010-11-25 10:53:34 UTC (rev 1156)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>dsp-deployer-example</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <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>
+ </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>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+ </natures>
+</projectDescription>
Added: dsp/trunk/samples/deployer/.settings/.jsdtscope
===================================================================
--- dsp/trunk/samples/deployer/.settings/.jsdtscope (rev 0)
+++ dsp/trunk/samples/deployer/.settings/.jsdtscope 2010-11-25 10:53:34 UTC (rev 1156)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="WebContent"/>
+ <classpathentry kind="con"
path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con"
path="org.eclipse.wst.jsdt.launching.WebProject">
+ <attributes>
+ <attribute name="hide" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con"
path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
Added: dsp/trunk/samples/deployer/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- dsp/trunk/samples/deployer/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++ dsp/trunk/samples/deployer/.settings/org.eclipse.jdt.core.prefs 2010-11-25 10:53:34
UTC (rev 1156)
@@ -0,0 +1,8 @@
+#Tue Nov 23 14:56:18 GMT 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: dsp/trunk/samples/deployer/.settings/org.eclipse.wst.common.component
===================================================================
--- dsp/trunk/samples/deployer/.settings/org.eclipse.wst.common.component
(rev 0)
+++ dsp/trunk/samples/deployer/.settings/org.eclipse.wst.common.component 2010-11-25
10:53:34 UTC (rev 1156)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="DSPExample">
+ <wb-resource deploy-path="/WEB-INF/classes"
source-path="/src/main/java"/>
+ <wb-resource deploy-path="/"
source-path="/src/main/resources"/>
+ <property name="context-root" value="DSPExample"/>
+ <property name="java-output-path"
value="/DSPExample/build/classes"/>
+ </wb-module>
+</project-modules>
Added: dsp/trunk/samples/deployer/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- dsp/trunk/samples/deployer/.settings/org.eclipse.wst.common.project.facet.core.xml
(rev 0)
+++
dsp/trunk/samples/deployer/.settings/org.eclipse.wst.common.project.facet.core.xml 2010-11-25
10:53:34 UTC (rev 1156)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <runtime name="JBoss 5.1 Runtime"/>
+ <fixed facet="wst.jsdt.web"/>
+ <fixed facet="java"/>
+ <fixed facet="jst.web"/>
+ <installed facet="java" version="1.5"/>
+ <installed facet="jst.web" version="2.5"/>
+ <installed facet="wst.jsdt.web" version="1.0"/>
+</faceted-project>
Added: dsp/trunk/samples/deployer/.settings/org.eclipse.wst.jsdt.ui.superType.container
===================================================================
--- dsp/trunk/samples/deployer/.settings/org.eclipse.wst.jsdt.ui.superType.container
(rev 0)
+++
dsp/trunk/samples/deployer/.settings/org.eclipse.wst.jsdt.ui.superType.container 2010-11-25
10:53:34 UTC (rev 1156)
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
Added: dsp/trunk/samples/deployer/.settings/org.eclipse.wst.jsdt.ui.superType.name
===================================================================
--- dsp/trunk/samples/deployer/.settings/org.eclipse.wst.jsdt.ui.superType.name
(rev 0)
+++ dsp/trunk/samples/deployer/.settings/org.eclipse.wst.jsdt.ui.superType.name 2010-11-25
10:53:34 UTC (rev 1156)
@@ -0,0 +1 @@
+Window
\ No newline at end of file
Added:
dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/dsp/example/DeployServlet.java
===================================================================
--- dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/dsp/example/DeployServlet.java
(rev 0)
+++
dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/dsp/example/DeployServlet.java 2010-11-25
10:53:34 UTC (rev 1156)
@@ -0,0 +1,166 @@
+/*
+ * Copyright 2010 Red Hat, Inc
+ *
+ * Licensed 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.dsp.example;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Iterator;
+import java.util.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.FileUploadException;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.apache.commons.fileupload.servlet.ServletFileUpload;
+
+
+public class DeployServlet extends HttpServlet {
+ private static final long serialVersionUID = 1L;
+
+ private static final String TMP_DIR_PATH = "/tmp";
+ private File tmpDir;
+ private static final String DESTINATION_DIR_PATH ="/files";
+ private File destinationDir;
+
+ public void init(ServletConfig config) throws ServletException {
+ super.init(config);
+ tmpDir = new File(TMP_DIR_PATH);
+ if(!tmpDir.isDirectory()) {
+ throw new ServletException(TMP_DIR_PATH + " is not a directory");
+ }
+ String realPath = getServletContext().getRealPath(DESTINATION_DIR_PATH);
+ destinationDir = new File(realPath);
+ if(!destinationDir.isDirectory()) {
+ throw new ServletException(DESTINATION_DIR_PATH+" is not a directory");
+ }
+
+ }
+
+ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
+ PrintWriter out = response.getWriter();
+ response.setContentType("text/html");
+ out.println("<h1>Dynamic Service Provider Example -
Deployer</h1>");
+ out.println();
+
+ DiskFileItemFactory fileItemFactory = new DiskFileItemFactory ();
+ /*
+ *Set the size threshold, above which content will be stored on disk.
+ */
+ fileItemFactory.setSizeThreshold(1*1024*1024); //1 MB
+ /*
+ * Set the temporary directory to store the uploaded files of size above threshold.
+ */
+ fileItemFactory.setRepository(tmpDir);
+
+ ServletFileUpload uploadHandler = new ServletFileUpload(fileItemFactory);
+ try {
+ /*
+ * Parse the request
+ */
+ List items = uploadHandler.parseRequest(request);
+ Iterator itr = items.iterator();
+ while(itr.hasNext()) {
+ FileItem item = (FileItem) itr.next();
+ /*
+ * Handle Form Fields.
+ */
+ if(item.isFormField()) {
+ out.println("File Name = "+item.getFieldName()+", Value =
"+item.getString());
+ } else if (item.getName().endsWith(".zip") == false) {
+ out.println("File must be a '.zip' archive!");
+ } else {
+ //Handle Uploaded files.
+ out.println("Uploading File: "+item.getName()+"<br>");
+
+ /*
+ * Write file to the ultimate location.
+ */
+ File file = new File(destinationDir,item.getName().substring(0,
item.getName().length()-4));
+
+ file.mkdir();
+
+ File wsdlFile=unzip(out, new java.util.zip.ZipInputStream(item.getInputStream()),
file.getAbsolutePath());
+
+ if (wsdlFile == null) {
+ out.println("ERROR: No WSDL definition found!!!<br>");
+ } else {
+ // Invoke dynamic service deployment mechanism
+ WSDeployer deployer=new WSDeployer();
+
+ deployer.deploy(file, wsdlFile);
+
+ }
+ }
+ out.close();
+ }
+ }catch(FileUploadException ex) {
+ log("Error encountered while parsing the request",ex);
+ } catch(Exception ex) {
+ log("Error encountered while uploading file",ex);
+ }
+
+ }
+
+ protected java.io.File unzip(PrintWriter out, ZipInputStream zis, String path) throws
IOException {
+ ZipEntry ze=null;
+ java.io.File wsdlFile=null;
+
+ out.println("Unzipping file ....<br>");
+
+ while ((ze=zis.getNextEntry()) != null) {
+
+ if (ze.isDirectory()) {
+ java.io.File f=new java.io.File(path+java.io.File.separatorChar+ze.getName());
+ f.mkdirs();
+ } else {
+ out.println("Unzip: "+ze.getName()+"<br>");
+ unzipEntry(zis, ze.getName(), path);
+
+ if (ze.getName().endsWith(".wsdl")) {
+ wsdlFile = new java.io.File(path+java.io.File.separatorChar+ze.getName());
+ }
+ }
+ }
+
+ out.println("Closing zip.<br>");
+ zis.close();
+
+ return(wsdlFile);
+ }
+
+ protected void unzipEntry(ZipInputStream zis, String name, String path) throws
IOException {
+ System.out.println("\t\tunzipping "+name+"<br>");
+ FileOutputStream fos = new FileOutputStream(path+java.io.File.separatorChar+name);
+ byte[] b=new byte[1024];
+ int len=0;
+
+ while ((len=zis.read(b)) != -1) {
+ fos.write(b,0,len);
+ }
+
+ fos.close();
+ }
+}
\ No newline at end of file
Added:
dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/dsp/example/ExampleServiceProvider.java
===================================================================
---
dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/dsp/example/ExampleServiceProvider.java
(rev 0)
+++
dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/dsp/example/ExampleServiceProvider.java 2010-11-25
10:53:34 UTC (rev 1156)
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2010 Red Hat, Inc
+ *
+ * Licensed 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.dsp.example;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.soa.dsp.InvocationAdapter;
+import org.jboss.soa.dsp.MessageAdapter;
+import org.jboss.soa.dsp.ServiceProvider;
+import org.jboss.soa.dsp.ws.WSInvocationAdapter;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class ExampleServiceProvider implements ServiceProvider {
+
+ public void invoke(InvocationAdapter<?> arg0) throws Exception {
+ System.out.println("EXAMPLE SERVICE PROVIDER: invoke "+arg0);
+
+ arg0.createFault(null, new QName("http://www.example.org",
"ExampleFault"),
+ new MessageAdapter() {
+
+ public Map<String, Node> getHeaderParts() {
+ return new HashMap<String,Node>();
+ }
+
+ public Element getMessage() {
+ Element ret=null;
+
+ try {
+ ret = javax.xml.parsers.DocumentBuilderFactory.newInstance().
+ newDocumentBuilder().newDocument().createElement("ExampleFaultDetails");
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+
+ return(ret);
+ }
+
+ public Element getPart(String arg0) {
+ return null;
+ }
+
+ public void setHeaderPart(String arg0, Element arg1) {
+ }
+
+ public void setPart(String arg0, Element arg1) {
+ }
+
+ });
+ }
+
+}
Added:
dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/dsp/example/ExampleWebServiceFactory.java
===================================================================
---
dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/dsp/example/ExampleWebServiceFactory.java
(rev 0)
+++
dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/dsp/example/ExampleWebServiceFactory.java 2010-11-25
10:53:34 UTC (rev 1156)
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2010 Red Hat, Inc
+ *
+ * Licensed 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.dsp.example;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.soa.dsp.ServiceProvider;
+import org.jboss.soa.dsp.ws.SOAPMessageAdapter;
+import org.jboss.soa.dsp.ws.WSInvocationAdapter;
+import org.jboss.soa.dsp.ws.WebServiceProviderFactory;
+
+public class ExampleWebServiceFactory implements WebServiceProviderFactory {
+
+ public ServiceProvider getServiceProvider() {
+ return(new ExampleServiceProvider());
+ }
+
+ public WSInvocationAdapter getInvocationAdapter(String operationName,
+ QName serviceName, String portName, SOAPMessageAdapter soapAdapter) {
+ return(new WSInvocationAdapter(operationName,
+ serviceName, portName, soapAdapter));
+ }
+}
Added: dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/dsp/example/WSDeployer.java
===================================================================
--- dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/dsp/example/WSDeployer.java
(rev 0)
+++
dsp/trunk/samples/deployer/src/main/java/org/jboss/soa/dsp/example/WSDeployer.java 2010-11-25
10:53:34 UTC (rev 1156)
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2010 Red Hat, Inc
+ *
+ * Licensed 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.dsp.example;
+
+import java.io.File;
+import java.net.URL;
+import java.util.UUID;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.soa.dsp.EndpointMetaData;
+import org.jboss.soa.dsp.ServiceEndpointReference;
+import org.jboss.soa.dsp.deployer.jboss.JBossServiceDeployer;
+import org.jboss.soa.dsp.server.ServerConfig;
+import org.jboss.soa.dsp.server.jboss.ServerConfigFactory;
+import org.jboss.soa.dsp.ws.BaseWebServiceEndpoint;
+import org.jboss.soa.dsp.ws.DeploymentBuilder;
+import org.jboss.soa.dsp.ws.WSDLParser;
+import org.jboss.soa.dsp.ws.WSDLReference;
+import org.jboss.soa.dsp.ws.WebServiceProviderGenerator;
+
+public class WSDeployer {
+
+ public WSDeployer() {
+ }
+
+ public ServiceEndpointReference deploy(java.io.File root, java.io.File wsdlFile) throws
Exception {
+ ClassLoader cl=WSDeployer.class.getClassLoader();
+
+ javax.wsdl.factory.WSDLFactory factory=javax.wsdl.factory.WSDLFactory.newInstance();
+ javax.wsdl.Definition wsdl=factory.newWSDLReader().readWSDL(null,
wsdlFile.getAbsolutePath());
+
+ WSDLReference wsdlRef=new WSDLReference(wsdl, wsdlFile.toURI());
+
+ WebServiceProviderGenerator providerFactory = new WebServiceProviderGenerator();
+
+ javax.wsdl.Service
service=(javax.wsdl.Service)wsdl.getServices().values().iterator().next();
+
+ System.out.println("SERVICE="+service);
+
+ javax.wsdl.Port port=(javax.wsdl.Port)service.getPorts().values().iterator().next();
+
+ System.out.println("PORT="+port);
+
+ EndpointMetaData metaData=new EndpointMetaData(service.getQName(),
+ port.getName(), new QName("http://www.example.org",
"ProcessId"),
+ UUID.randomUUID().toString());
+
+ BaseWebServiceEndpoint providerImpl =
+ providerFactory.createProvider(metaData, wsdlRef, cl,
+ null, ExampleWebServiceFactory.class);
+
+ System.out.println("PROVIDER="+providerImpl);
+
+ ServerConfig serverConfig=ServerConfigFactory.getServerConfig();
+
+ File warArchive = new DeploymentBuilder(serverConfig)
+ .setEndpoint(metaData.getEndpointId())
+ .setWSDL(wsdlFile, root)
+ .setProvider(providerImpl)
+ .build();
+
+ System.out.println("War Archive="+warArchive);
+
+ URL serviceUrl = new
WSDLParser(wsdlRef.getDefinition()).getServiceLocationURL(metaData.getServiceName(),
+ metaData.getPortName());
+
+ System.out.println("Service URL="+serviceUrl);
+
+ JBossServiceDeployer deployer=new JBossServiceDeployer();
+
+ ServiceEndpointReference ref=deployer.deploy(metaData, providerImpl.getClass(),
+ serviceUrl, cl, warArchive);
+
+ System.out.println("DEPLOYED endpoint ref="+ref);
+
+ return(ref);
+ }
+
+ public void undeploy(ServiceEndpointReference ref) throws Exception {
+ JBossServiceDeployer deployer=new JBossServiceDeployer();
+
+ deployer.undeploy(ref);
+ }
+}
Added: dsp/trunk/samples/deployer/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- dsp/trunk/samples/deployer/src/main/resources/META-INF/MANIFEST.MF
(rev 0)
+++ dsp/trunk/samples/deployer/src/main/resources/META-INF/MANIFEST.MF 2010-11-25 10:53:34
UTC (rev 1156)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added:
dsp/trunk/samples/deployer/src/main/resources/WEB-INF/lib/commons-fileupload-1.2.2.jar
===================================================================
(Binary files differ)
Property changes on:
dsp/trunk/samples/deployer/src/main/resources/WEB-INF/lib/commons-fileupload-1.2.2.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: dsp/trunk/samples/deployer/src/main/resources/WEB-INF/lib/commons-io-1.3.2.jar
===================================================================
(Binary files differ)
Property changes on:
dsp/trunk/samples/deployer/src/main/resources/WEB-INF/lib/commons-io-1.3.2.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: dsp/trunk/samples/deployer/src/main/resources/WEB-INF/lib/dsp-1.0.0-SNAPSHOT.jar
===================================================================
(Binary files differ)
Property changes on:
dsp/trunk/samples/deployer/src/main/resources/WEB-INF/lib/dsp-1.0.0-SNAPSHOT.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: dsp/trunk/samples/deployer/src/main/resources/WEB-INF/web.xml
===================================================================
--- dsp/trunk/samples/deployer/src/main/resources/WEB-INF/web.xml
(rev 0)
+++ dsp/trunk/samples/deployer/src/main/resources/WEB-INF/web.xml 2010-11-25 10:53:34 UTC
(rev 1156)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID"
version="2.5">
+ <display-name>DSPExample</display-name>
+ <welcome-file-list>
+ <welcome-file>/upload.html</welcome-file>
+ </welcome-file-list>
+ <servlet>
+ <description></description>
+ <display-name>DeployServlet</display-name>
+ <servlet-name>DeployServlet</servlet-name>
+ <servlet-class>org.jboss.soa.dsp.example.DeployServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>DeployServlet</servlet-name>
+ <url-pattern>/DeployServlet</url-pattern>
+ </servlet-mapping>
+</web-app>
\ No newline at end of file
Added: dsp/trunk/samples/deployer/src/main/resources/upload.html
===================================================================
--- dsp/trunk/samples/deployer/src/main/resources/upload.html (rev
0)
+++ dsp/trunk/samples/deployer/src/main/resources/upload.html 2010-11-25 10:53:34 UTC (rev
1156)
@@ -0,0 +1,10 @@
+<html>
+ <head></head>
+ <body>
+ <p>Commons File Upload Example</p>
+ <form action="DeployServlet" enctype="multipart/form-data"
method="POST">
+ <input type="file" name="file1"><br>
+ <input type="Submit" value="Upload File"><br>
+ </form>
+ </body>
+</html>
\ No newline at end of file