You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@tomee.apache.org by bu...@apache.org on 2012/07/25 10:41:00 UTC

svn commit: r826924 - in /websites/staging/openejb/trunk: cgi-bin/ content/ content/examples-trunk/webapps/ content/examples-trunk/webapps/change-jaxws-url/ content/examples-trunk/webapps/change-jaxws-url/src/ content/examples-trunk/webapps/change-jaxw...

Author: buildbot
Date: Wed Jul 25 08:40:59 2012
New Revision: 826924

Log:
Staging update by buildbot for openejb

Added:
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/README.html
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/pom.xml   (with props)
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/main/
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/main/java/
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/main/java/org/
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/main/java/org/superbiz/
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/main/java/org/superbiz/jaxws/
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/main/java/org/superbiz/jaxws/Rot13.java
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/main/resources/
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/main/resources/META-INF/
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/main/resources/META-INF/openejb-jar.xml   (with props)
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/test/
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/test/java/
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/test/java/org/
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/test/java/org/superbiz/
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/test/java/org/superbiz/jaxws/
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/test/java/org/superbiz/jaxws/Rot13Test.java
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/test/resources/
    websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/test/resources/arquillian.xml   (with props)
Modified:
    websites/staging/openejb/trunk/cgi-bin/   (props changed)
    websites/staging/openejb/trunk/content/   (props changed)
    websites/staging/openejb/trunk/content/examples-trunk/webapps/pom.xml

Propchange: websites/staging/openejb/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Jul 25 08:40:59 2012
@@ -1 +1 @@
-1364854
+1365490

Propchange: websites/staging/openejb/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Jul 25 08:40:59 2012
@@ -1 +1 @@
-1364854
+1365490

Added: websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/README.html
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/README.html (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/README.html Wed Jul 25 08:40:59 2012
@@ -0,0 +1,307 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+
+    <meta charset="utf-8">
+      <title>Change JAXWS URL</title>
+    <meta name="description" content="">
+    <meta name="author" content="">
+
+    <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+    <!--[if lt IE 9]>
+      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+
+    <!-- Le styles -->
+    <link href="./../../../bootstrap.css" rel="stylesheet">
+    <link href="./../../../prettify.css" rel="stylesheet">
+    <link href="./../../../bootstrap-mods.css" rel="stylesheet">
+
+    <style type="text/css">
+        body {
+          padding-top: 60px;
+        }
+        .sprite {
+            display: inline-block;
+            height: 20px;
+            margin: 0 auto 4px;
+            outline: medium none;
+            text-indent: -999em;
+            width: 24px;
+            background-image: url('./../../../images/sprites.png');
+            background-repeat: no-repeat;
+            overflow: hidden;
+            cursor: pointer;
+        }
+        .edit-page {
+            display: inline-block;
+            height: 20px;
+            margin: 0 auto 4px;
+            outline: medium none;
+            text-indent: -999em;
+            width: 24px;
+            background-image: url('./../../../images/edit.png');
+            background-repeat: no-repeat;
+            overflow: hidden;
+            cursor: pointer;
+        }
+        .fb-share {
+            background-position: 0px -40px;
+        }
+        .gp-share {
+            background-position: 0px 0px;
+        }
+        .tw-share {
+            background-position: 0px -80px;
+        }
+    </style>
+    <script type="text/javascript">
+      function fbshare () {
+          window.open(
+                  "http://www.facebook.com/sharer/sharer.php?u="+document.URL,
+                  'Share on Facebook',
+                  'width=640,height=426');
+      };
+      function gpshare () {
+          window.open(
+                  "https://plus.google.com/share?url="+document.URL,
+                  'Share on Google+',
+                  'width=584,height=385');
+      };
+      function twshare () {
+          window.open(
+                  "https://twitter.com/intent/tweet?url="+document.URL+"&text=Change JAXWS URL",
+                  'Share on Twitter',
+                  'width=800,height=526');
+      };
+    </script>
+
+    <!-- Le fav and touch icons -->
+    <link rel="shortcut icon" href="./../../../images/favicon.ico">
+    <link rel="apple-touch-icon" href="./../../../images/apple-touch-icon.png">
+    <link rel="apple-touch-icon" sizes="72x72" href="./../../../images/apple-touch-icon-72x72.png">
+    <link rel="apple-touch-icon" sizes="114x114" href="./../../../images/apple-touch-icon-114x114.png">
+
+    <script src="./../../../javascript/prettify.js" type="text/javascript"></script>
+    <script src="./../../../javascript/jquery-latest.js"></script>
+    <script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
+    <script src="./../../../javascript/common.js"></script>
+    <script src="./../../../javascript/prettyprint.js"></script>
+
+    <script type="text/javascript">
+
+      var _gaq = _gaq || [];
+      _gaq.push(['_setAccount', 'UA-2717626-1']);
+      _gaq.push(['_setDomainName', 'apache.org']);
+      _gaq.push(['_trackPageview']);
+
+      (function() {
+        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+      })();
+
+    </script>
+
+
+  </head>
+
+  <body>
+
+    <div class="topbar">
+      <div class="fill">
+        <div class="container">
+          <a class="brand" href="./../../../index.html">Apache TomEE</a>
+          <ul class="nav">
+            <li><a href="./../../../index.html">Home</a></li>
+            <li><a href="./../../../downloads.html">Downloads</a></li>
+            <li><a href="./../../../documentation.html">Documentation</a></li>
+            <li><a href="./../../../support.html">Support</a></li>
+          </ul>
+
+            <!-- Google CSE Search Box Begins  -->
+            <FORM class="pull-right" id="searchbox_010475492895890475512:_t4iqjrgx90" action="http://www.google.com/cse">
+                <INPUT type="hidden" name="cx" value="010475492895890475512:_t4iqjrgx90">
+                <INPUT type="hidden" name="cof" value="FORID:0">
+                <INPUT name="q" type="text" placeholder="Search">
+            </FORM>
+            <!--<SCRIPT type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_010475492895890475512:_t4iqjrgx90"></SCRIPT>-->
+            <!-- Google CSE Search Box Ends -->
+        </div>
+      </div>
+    </div>
+
+    <div class="container">
+    
+
+<div class="row">
+    <div class="span8">
+        <small><a href="./../../../index.html">Home</a>&nbsp;&raquo&nbsp;<a href="./../../../examples-trunk/">Examples Trunk</a>&nbsp;&raquo&nbsp;<a href="./../../../examples-trunk/webapps/">Webapps</a>&nbsp;&raquo&nbsp;<a href="./../../../examples-trunk/webapps/change-jaxws-url/">Change Jaxws Url</a></small><br>
+    </div>
+    <div class="span8">
+    </div>
+</div>
+&nbsp;
+<div class="page-header">
+<h1>Change JAXWS URL
+
+    <div style="float: right; position: relative; bottom: -10px; ">
+        <a onclick="javascript:gpshare()" class="gp-share sprite" title="share on Google+">share [gp]</a>
+        <a onclick="javascript:fbshare()" class="fb-share sprite" title="share on Facebook">share [fb]</a>
+        <a onclick="javascript:twshare()" class="tw-share sprite" title="share on Twitter">share [tw]</a>
+        <a data-toggle="modal" href="#edit" class="edit-page" title="Contribute to this Page">contribute</a>
+    </div>
+</h1>
+</div>
+
+<p><em>Help us document this example! Click the blue pencil icon in the upper right to edit this page.</em></p>
+
+<p>To change a webservice deployment URI one solution is to use openejb-jar.xml.</p>
+
+<p>In this sample we have a webservice though the class Rot13:</p>
+
+<pre><code>package org.superbiz.jaxws;
+
+import javax.ejb.Lock;
+import javax.ejb.LockType;
+import javax.ejb.Singleton;
+import javax.jws.WebService;
+
+@Lock(LockType.READ)
+@Singleton
+@WebService
+public class Rot13 {
+    public String rot13(final String in) {
+        final StringBuilder builder = new StringBuilder(in.length());
+        for (int b : in.toCharArray()) {
+            int cap = b &amp; 32;
+            b &amp;= ~cap;
+            if (Character.isUpperCase(b)) {
+                b = (b - 'A' + 13) % 26 + 'A';
+            } else {
+                b = cap;
+            }
+            b |= cap;
+            builder.append((char) b);
+        }
+        return builder.toString();
+    }
+}
+</code></pre>
+
+<p>We decide to deploy to /tool/rot13 url.</p>
+
+<p>To do so we first define it in openejb-jar.xml:</p>
+
+<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"&gt;
+  &lt;enterprise-beans&gt;
+    &lt;session&gt;
+      &lt;ejb-name&gt;Rot13&lt;/ejb-name&gt;
+      &lt;web-service-address&gt;/tool/rot13&lt;/web-service-address&gt;
+    &lt;/session&gt;
+  &lt;/enterprise-beans&gt;
+&lt;/openejb-jar&gt;
+</code></pre>
+
+<p>It is not enough since by default TomEE deploys the webservices in a subcontext called webservices. To skip it
+simply set the system property tomee.jaxws.subcontext to / (done in arquillian.xml for our test).</p>
+
+<p>Then now our Rot13 webservice is deployed as expected to /tool/rot13 and we check it with arquillian and tomee embedded:</p>
+
+<pre><code> package org.superbiz.jaxws;
+
+ import org.apache.ziplock.IO;
+ import org.jboss.arquillian.container.test.api.Deployment;
+ import org.jboss.arquillian.junit.Arquillian;
+ import org.jboss.arquillian.test.api.ArquillianResource;
+ import org.jboss.shrinkwrap.api.ArchivePaths;
+ import org.jboss.shrinkwrap.api.ShrinkWrap;
+ import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
+ import org.jboss.shrinkwrap.api.spec.WebArchive;
+ import org.junit.AfterClass;
+ import org.junit.BeforeClass;
+ import org.junit.Test;
+ import org.junit.runner.RunWith;
+
+ import java.net.URL;
+
+ import static org.junit.Assert.assertThat;
+ import static org.junit.internal.matchers.StringContains.containsString;
+
+ @RunWith(Arquillian.class)
+ public class Rot13Test {
+     @ArquillianResource
+     private URL url;
+
+     @Deployment(testable = false)
+     public static WebArchive war() {
+         return ShrinkWrap.create(WebArchive.class)
+                     .addClass(Rot13.class)
+                     .addAsWebInfResource(new ClassLoaderAsset("META-INF/openejb-jar.xml"), ArchivePaths.create("openejb-jar.xml"));
+     }
+
+     @Test
+     public void checkWSDLIsDeployedWhereItIsConfigured() throws Exception {
+         final String wsdl = IO.slurp(new URL(url.toExternalForm() + "tool/rot13?wsdl"));
+         assertThat(wsdl, containsString("Rot13"));
+     }
+ }
+</code></pre>
+
+
+<div class="page-header">&nbsp;</div>
+<h4>APIs Used</h4>
+<ul><li><a href="http://docs.oracle.com/javaee/6/api/javax/ejb/Lock.html">javax.ejb.Lock</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/ejb/LockType.html">javax.ejb.LockType</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/ejb/Singleton.html">javax.ejb.Singleton</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/jws/WebService.html">javax.jws.WebService</a></li>
+</ul>
+
+<h3>Source</h3>
+  <ul>
+      <li>Apache <a href="http://svn.apache.org/repos/asf/openejb/trunk/openejb/examples/webapps/change-jaxws-url">change-jaxws-url</a></li>
+      <li>Github <a href="https://github.com/apache/openejb/tree/trunk/openejb/examples/webapps/change-jaxws-url">change-jaxws-url</a></li>
+  </ul>
+<pre>
+svn co http://svn.apache.org/repos/asf/openejb/trunk/openejb/examples/webapps/change-jaxws-url
+cd change-jaxws-url
+mvn clean install
+</pre>
+
+
+        <div id="edit" class="modal hide fade in" style="display: none; ">
+            <div class="modal-header">
+                <a class="close" data-dismiss="modal">x</a>
+
+                <h3>Thank you for contributing to the documention!</h3>
+            </div>
+            <div class="modal-body">
+                <h4>Any help with the documentation is greatly appreciated.</h4>
+                <p>All edits are reviewed before going live, so feel free to do much more than fix typos or links.  If you see a page that could benefit from an entire rewrite, we'd be thrilled to review it.  Don't be surprised if we like it so much we ask you for help with other pages :)</p>
+                <small>NOTICE: unless indicated otherwise on the pages in question, all editable content available from apache.org is presumed to be licensed under the Apache License (AL) version 2.0 and hence all submissions to apache.org treated as formal Contributions under the license terms.</small>
+                <!--[if gt IE 6]>
+                <h4>Internet Explorer Users</h4>
+                <p>If you are not an Apache committer, click the Yes link and enter a <i>anonymous</i> for the username and leave the password empty</p>
+                <![endif]-->
+
+            </div>
+            <div class="modal-footer">
+                Do you have an Apache ID?
+                <a href="javascript:void(location.href='https://cms.apache.org/redirect?uri='+escape(location.href))" class="btn">Yes</a>
+                <a href="javascript:void(location.href='https://anonymous:@cms.apache.org/redirect?uri='+escape(location.href))" class="btn">No</a>
+            </div>
+        </div>
+        <script src="./../../../javascript/bootstrap-modal.js"></script>
+
+      <footer>
+        <p>
+        Copyright &copy; 2011 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.
+        Apache and the Apache feather logo are trademarks of The Apache Software Foundation.
+        </p>
+      </footer>
+
+    </div> <!-- /container -->
+
+  </body>
+</html>

Added: websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/pom.xml
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/main/java/org/superbiz/jaxws/Rot13.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/main/java/org/superbiz/jaxws/Rot13.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/main/java/org/superbiz/jaxws/Rot13.java Wed Jul 25 08:40:59 2012
@@ -0,0 +1,27 @@
+package org.superbiz.jaxws;
+
+import javax.ejb.Lock;
+import javax.ejb.LockType;
+import javax.ejb.Singleton;
+import javax.jws.WebService;
+
+@Lock(LockType.READ)
+@Singleton
+@WebService
+public class Rot13 {
+    public String rot13(final String in) {
+        final StringBuilder builder = new StringBuilder(in.length());
+        for (int b : in.toCharArray()) {
+            int cap = b & 32;
+            b &= ~cap;
+            if (Character.isUpperCase(b)) {
+                b = (b - 'A' + 13) % 26 + 'A';
+            } else {
+                b = cap;
+            }
+            b |= cap;
+            builder.append((char) b);
+        }
+        return builder.toString();
+    }
+}

Added: websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/main/resources/META-INF/openejb-jar.xml
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/main/resources/META-INF/openejb-jar.xml
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/test/java/org/superbiz/jaxws/Rot13Test.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/test/java/org/superbiz/jaxws/Rot13Test.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/test/java/org/superbiz/jaxws/Rot13Test.java Wed Jul 25 08:40:59 2012
@@ -0,0 +1,38 @@
+package org.superbiz.jaxws;
+
+import org.apache.ziplock.IO;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.net.URL;
+
+import static org.junit.Assert.assertThat;
+import static org.junit.internal.matchers.StringContains.containsString;
+
+@RunWith(Arquillian.class)
+public class Rot13Test {
+    @ArquillianResource
+    private URL url;
+
+    @Deployment(testable = false)
+    public static WebArchive war() {
+        return ShrinkWrap.create(WebArchive.class)
+                    .addClass(Rot13.class)
+                    .addAsWebInfResource(new ClassLoaderAsset("META-INF/openejb-jar.xml"), ArchivePaths.create("openejb-jar.xml"));
+    }
+
+    @Test
+    public void checkWSDLIsDeployedWhereItIsConfigured() throws Exception {
+        final String wsdl = IO.slurp(new URL(url.toExternalForm() + "tool/rot13?wsdl"));
+        assertThat(wsdl, containsString("Rot13"));
+    }
+}

Added: websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/test/resources/arquillian.xml
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/openejb/trunk/content/examples-trunk/webapps/change-jaxws-url/src/test/resources/arquillian.xml
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Modified: websites/staging/openejb/trunk/content/examples-trunk/webapps/pom.xml
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/webapps/pom.xml (original)
+++ websites/staging/openejb/trunk/content/examples-trunk/webapps/pom.xml Wed Jul 25 08:40:59 2012
@@ -17,7 +17,7 @@
     limitations under the License.
 -->
 
-<!-- $Rev: 1355123 $ $Date: 2012-06-28 19:26:12 +0000 (Thu, 28 Jun 2012) $ -->
+<!-- $Rev: 1365490 $ $Date: 2012-07-25 08:40:26 +0000 (Wed, 25 Jul 2012) $ -->
 
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
@@ -27,6 +27,7 @@
   <packaging>pom</packaging>
   <name>OpenEJB :: Web Examples</name>
   <modules>
+    <module>change-jaxws-url</module>
     <module>ejb-examples</module>
     <!--    <module>applet</module> -->
     <module>ejb-webservice</module>