<!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;">
Re: Problem with securing web service with ws security ( username token )
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/erickjd">Erick Jeronimo Diaz</a> in <i>JBoss Web Services</i> - <a href="http://community.jboss.org/message/570351#570351">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>hi Lukasz, i've tested ws-security with jboss-4.2.3 and <strong>jbossws-native-3.1.1.GA; and it worked!!!</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p class="MsoNormal"><strong>this is my </strong>jboss-wsse-server.xml:</p><p class="MsoNormal"><em><br/></em></p><pre><em><jboss-ws-security xmlns="<a class="jive-link-external-small" href="http://www.jboss.com/ws-security/config" target="_blank">http://www.jboss.com/ws-security/config</a>"</em></pre><pre><em>                   xmlns:xsi="<a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"</em></pre><pre><em>                   xsi:schemaLocation="<a class="jive-link-external-small" href="http://www.jboss.com/ws-security/config" target="_blank">http://www.jboss.com/ws-security/config</a></em></pre><pre><em>                   <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>"></em></pre><pre><em>     <key-store-file>META-INF/master-sign_enc.jks</key-store-file></em></pre><pre><em>        <key-store-password>password</key-store-password></em></pre><pre><em>        <key-store-type>jks</key-store-type></em></pre><pre><em>        <trust-store-file>META-INF/wsse10.truststore</trust-store-file></em></pre><pre><em>        <trust-store-password>password</trust-store-password></em></pre><pre><em>     <config></em></pre><pre><em>          <timestamp ttl="300"/></em></pre><pre><em>          <sign alias="master" includeTimestamp="true"/></em></pre><pre><em>          <encrypt alias="facturacion"/></em></pre><pre><em>           <requires></em></pre><pre><em>             <signature/></em></pre><pre><em>             <encryption/>      </em></pre><pre><em>           </requires></em></pre><pre><em>        </config></em></pre><p class="MsoNormal"><em></jboss-ws-security></em></p><p class="MsoNormal" style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p class="MsoNormal">of course, you must to create the keystores(<em><em>master-sign_enc.jks</em></em>) y truststores(<em><em>wsse10.truststore</em></em>) and their certificates,see <strong>keytool </strong><em><em>command.</em></em></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p class="MsoNormal">Then for client, i use a java client class:</p><p class="MsoNormal" style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p class="MsoNormal"><em><strong>public</strong> <strong>class</strong> SecureAgency <strong>extends</strong> Agency</em></p><p class="MsoNormal"><em>{</em></p><p class="MsoNormal"><em>   <strong>public</strong> SecureAgency(URL url)</em></p><p class="MsoNormal"><em>   {</em></p><p class="MsoNormal"><em>      <strong>super</strong>(url);</em></p><p class="MsoNormal"><em>      <span style="text-decoration: underline;"><strong>((StubExt)</strong><strong>endpoint</strong><strong>).setConfigName(</strong><strong>"Standard WSSecurity Client"</strong><strong>);</strong></span></em></p><p class="MsoNormal"><em>   }</em></p><p class="MsoNormal"><em><br/></em></p><p class="MsoNormal"><em>   <strong>public</strong> <strong>static</strong> <strong>void</strong> main(String[] args)</em></p><p class="MsoNormal"><em>   {</em></p><p class="MsoNormal"><em>      <strong>try</strong></em></p><p class="MsoNormal"><em>      {</em></p><p class="MsoNormal"><em>       <strong>if</strong> (args.length == 3)</em></p><p class="MsoNormal"><em>         {</em></p><p class="MsoNormal"><em>            Agency agency = <strong>new</strong> SecureAgency(<strong>new</strong> URL(args[0]));</em></p><p class="MsoNormal"><em>            agency.run(args[1], args[2]);</em></p><p class="MsoNormal"><em>            System.</em><em>out.println("Press release sent.");</em></p><p class="MsoNormal"><em>         }</em></p><p class="MsoNormal"><em>         <strong>else</strong></em></p><p class="MsoNormal"><em>         {</em></p><p class="MsoNormal"><em>            System.</em><em>out.println("SecureAgency client usage:");</em></p><p class="MsoNormal"><em>            System.</em><em>out.println("./wsrunclient.sh -classpath agency.jar org.jboss.test.ws.jaxws.samples.news.SecureAgency " +</em></p><p class="MsoNormal"><em><span>                        "</span><a class="jive-link-external-small" href="http://localhost:8080/bills/" target="_blank">http://localhost:8080/bills/</a><span> billRelease?wsdl title body");</span></em></p><p class="MsoNormal"><em>         }</em></p><p class="MsoNormal"><em>      }</em></p><p class="MsoNormal"><em>      <strong>catch</strong> (Exception e)</em></p><p class="MsoNormal"><em>      {</em></p><p class="MsoNormal"><em>         e.printStackTrace();</em></p><p class="MsoNormal"><em>      }</em></p><p class="MsoNormal"><em>   }</em></p><p class="MsoNormal"><em>}</em></p><p class="MsoNormal" style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p class="MsoNormal">where we add: ((<strong>StubExt)</strong><strong>endpoint</strong><strong>).setConfigName(</strong><strong>"Standard WSSecurity Client"</strong><strong>);</strong>   forget about hierarchy......</p><p class="MsoNormal" style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p class="MsoNormal"><strong>YOU MUST ADD:</strong>   <em>jbossws-native-saaj.jar, jbossws-native-jaxws.jar, jaxb-api.jar</em>  FILES TO <em>%JBOSS_HOME%/lib/endorsed</em>   AND</p><p class="MsoNormal">-Djava.endorsed.dirs=<em>%JBOSS_HOME%/lib/endorsed  AS ARGUMENTS OF VM TO RUN THE EXAMPLE</em></p><p class="MsoNormal" style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p class="MsoNormal"><em>REMEMBER THE CLIENT HAVE TO GET </em>standard-jaxws-client-config.xml FILE</p><p class="MsoNormal" style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p class="MsoNormal">i hope it help 'u</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/570351#570351">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>