<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
How to enable SSL with JBossWS without "server.xml" ?
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/mauro.brasil">mauro.brasil</a> in <i>JBoss Web Services</i> - <a href="http://community.jboss.org/message/606760#606760">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hello there!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>We have a fully operational client/server application that uses JBossWS at server side and Axis2C at client side to provide Web Service communication.</p><p>We are just using "username autentication" and "timestamp validation" WS-Security features as shown below on "jboss-wsse-server.xml" file:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag"><?xml version="1.0" encoding="UTF-8"?></span>
<span class="jive-xml-tag"><span><jboss-ws-security xmlns="</span><a class="jive-link-external-small" href="http://www.jboss.com/ws-security/config" target="_blank">http://www.jboss.com/ws-security/config</a><span>" xmlns:xsi="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a><span>"
    xsi:schemaLocation="</span><a class="jive-link-external-small" href="http://www.jboss.com/ws-security/config" target="_blank">http://www.jboss.com/ws-security/config</a><span>
                   </span><a class="jive-link-external-small" href="http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd" target="_blank">http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd</a><span>"></span></span>
   
    <span class="jive-xml-tag"><config></span>
       
        <span class="jive-xml-tag"><requires/></span>
       
        <span class="jive-xml-tag"><timestamp ttl="60" /></span>
       
        <span class="jive-xml-tag"><authenticate></span>
            <span class="jive-xml-tag"><usernameAuth /></span>
        <span class="jive-xml-tag"></authenticate></span>
       
        <span class="jive-xml-tag"><authorize></span>
            <span class="jive-xml-tag"><role></span>AllowedRole01<span class="jive-xml-tag"></role></span>
            <span class="jive-xml-tag"><role></span>AllowedRole02<span class="jive-xml-tag"></role></span>
        <span class="jive-xml-tag"></authorize></span>
       
    <span class="jive-xml-tag"></config></span>
   
    <span class="jive-xml-tag"><timestamp-verification createdTolerance="30" warnCreated="true" expiresTolerance="10" warnExpires="true" /></span>
   
<span class="jive-xml-tag"></jboss-ws-security></span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Now we need to use SSL for all Web Services provided by our application.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Following Alessio Soldano's article at <a class="" href="http://community.jboss.org/docs/DOC-13534#Client_side">http://community.jboss.org/wiki/JBossWS-SecureTransport#Client_side</a>, we were able to make SSL work changing file "web.xml" accordingly to alternative 2.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The problem is that we want to use the first approach with "@WebContext" annotation.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I've reverted "web.xml" configurations and changed current annotation from just:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-java">@WebService( name = <font color="red">"user"</font> )
@EndpointConfig( configName = <font color="red">"Standard WSSecurity Endpoint"</font> )
@SecurityDomain( <font color="red">"CrossServerWS"</font> )
<font color="navy"><b>public</b></font> <font color="navy"><b>class</b></font> UserWSImpl <font color="navy"><b>extends</b></font> AbstractBaseWS <font color="navy"><b>implements</b></font> IUserWS <font color="navy">{</font>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>To:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-java">@WebService( name = <font color="red">"user"</font> )
@EndpointConfig( configName = <font color="red">"Standard WSSecurity Endpoint"</font> )
@SecurityDomain( <font color="red">"SECURITY_DOMAIN"</font> )
@WebContext
(
    contextRoot = <font color="red">"/CONTEXT_ROOT"</font>,
    urlPattern = <font color="red">"/user"</font>,
    transportGuarantee = <font color="red">"CONFIDENTIAL"</font>,
    secureWSDLAccess = <font color="navy"><b>false</b></font>
)
<font color="navy"><b>public</b></font> <font color="navy"><b>class</b></font> UserWSImpl <font color="navy"><b>extends</b></font> AbstractBaseWS <font color="navy"><b>implements</b></font> IUserWS <font color="navy">{</font>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>But it didn't work.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Am I missing something ?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Please let me know if you guys need any more information to figure out the problem.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thank's a lot and best regards,</p><p>Mauro.</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/606760#606760">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>