<!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;">&#160;</p><p class="MsoNormal"><strong>this is my </strong>jboss-wsse-server.xml:</p><p class="MsoNormal"><em><br/></em></p><pre><em>&lt;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>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 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>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 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>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <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>"&gt;</em></pre><pre><em>&#160;&#160;&#160;&#160; &lt;key-store-file&gt;META-INF/master-sign_enc.jks&lt;/key-store-file&gt;</em></pre><pre><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;key-store-password&gt;password&lt;/key-store-password&gt;</em></pre><pre><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;key-store-type&gt;jks&lt;/key-store-type&gt;</em></pre><pre><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;trust-store-file&gt;META-INF/wsse10.truststore&lt;/trust-store-file&gt;</em></pre><pre><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;trust-store-password&gt;password&lt;/trust-store-password&gt;</em></pre><pre><em>&#160;&#160;&#160;&#160; &lt;config&gt;</em></pre><pre><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;timestamp ttl="300"/&gt;</em></pre><pre><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;sign alias="master" includeTimestamp="true"/&gt;</em></pre><pre><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;encrypt alias="facturacion"/&gt;</em></pre><pre><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;requires&gt;</em></pre><pre><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;signature/&gt;</em></pre><pre><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;encryption/&gt;&#160;&#160;&#160;&#160;&#160; </em></pre><pre><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/requires&gt;</em></pre><pre><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/config&gt;</em></pre><p class="MsoNormal"><em>&lt;/jboss-ws-security&gt;</em></p><p class="MsoNormal" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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;">&#160;</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;">&#160;</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>&#160;&#160; <strong>public</strong> SecureAgency(URL url)</em></p><p class="MsoNormal"><em>&#160;&#160; {</em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160; <strong>super</strong>(url);</em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160; <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>&#160;&#160; }</em></p><p class="MsoNormal"><em><br/></em></p><p class="MsoNormal"><em>&#160;&#160; <strong>public</strong> <strong>static</strong> <strong>void</strong> main(String[] args)</em></p><p class="MsoNormal"><em>&#160;&#160; {</em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160; <strong>try</strong></em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160; {</em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160;&#160; <strong>if</strong> (args.length == 3)</em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Agency agency = <strong>new</strong> SecureAgency(<strong>new</strong> URL(args[0]));</em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; agency.run(args[1], args[2]);</em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.</em><em>out.println("Press release sent.");</em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <strong>else</strong></em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.</em><em>out.println("SecureAgency client usage:");</em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 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>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; "</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>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160; }</em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160; <strong>catch</strong> (Exception e)</em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160; {</em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.printStackTrace();</em></p><p class="MsoNormal"><em>&#160;&#160;&#160;&#160;&#160; }</em></p><p class="MsoNormal"><em>&#160;&#160; }</em></p><p class="MsoNormal"><em>}</em></p><p class="MsoNormal" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p class="MsoNormal">where we add: ((<strong>StubExt)</strong><strong>endpoint</strong><strong>).setConfigName(</strong><strong>"Standard WSSecurity Client"</strong><strong>);</strong>&#160;&#160; forget about hierarchy......</p><p class="MsoNormal" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p class="MsoNormal"><strong>YOU MUST ADD:</strong>&#160;&#160; <em>jbossws-native-saaj.jar, jbossws-native-jaxws.jar, jaxb-api.jar</em>&#160; FILES TO <em>%JBOSS_HOME%/lib/endorsed</em>&#160;&#160; AND</p><p class="MsoNormal">-Djava.endorsed.dirs=<em>%JBOSS_HOME%/lib/endorsed&#160; AS ARGUMENTS OF VM TO RUN THE EXAMPLE</em></p><p class="MsoNormal" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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;">&#160;</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>