<!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="https://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;">
    Unable to publish Apache CXF STS issue in EAP 6.1
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/mpag1980">Anu Raj</a> in <i>JBoss Web Services Development</i> - <a href="https://community.jboss.org/message/826945#826945">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,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I implemented the sample Apache CXF STS in EAP 6.1 as shown in the link below.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><a class="jive-link-external-small" href="https://docs.jboss.org/author/display/JBWS/WS-Security">https://docs.jboss.org/author/display/JBWS/WS-Security</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>When I try to access the CXF TokenService WSDL, it says "</p><h1 style="font-family: Tahoma, Arial, sans-serif; color: white; background-color: #525d76; font-size: 22px;">JBWEB000065: HTTP Status 404 - JBWEB000234: Servlet TestSecurityTokenService is currently unavailable</h1><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>My code is exactly the same as shown in the link above.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>web.xml</p><p>************</p><p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;web-app</p><p><span>&#160;&#160; version="2.5" xmlns="</span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/javaee" rel="nofollow" target="_blank">http://java.sun.com/xml/ns/javaee</a><span>"</span></p><p><span>&#160;&#160; xmlns:xsi="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a><span>"</span></p><p><span>&#160;&#160; xsi:schemaLocation="</span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/javaee" rel="nofollow" target="_blank">http://java.sun.com/xml/ns/javaee</a><span> </span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" rel="nofollow" target="_blank">http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd</a><span>"&gt;</span></p><p>&#160;&#160; &lt;servlet&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;servlet-name&gt;TestSecurityTokenService&lt;/servlet-name&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;servlet-class&gt;STS.SampleSTS&lt;/servlet-class&gt;</p><p>&#160;&#160; &lt;/servlet&gt;</p><p>&#160;&#160; &lt;servlet-mapping&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;servlet-name&gt;TestSecurityTokenService&lt;/servlet-name&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;url-pattern&gt;/SecurityTokenService/*&lt;/url-pattern&gt;</p><p>&#160;&#160; &lt;/servlet-mapping&gt;</p><p>&lt;/web-app&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Jboss-web.xml</p><p>*******************</p><p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span>&lt;!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "</span><a class="jive-link-external-small" href="http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd" target="_blank">http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd</a><span>"&gt;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;jboss-web&gt;</p><p>&#160;&#160; &lt;security-domain&gt;java:/jaas/JBossWS-trust-sts&lt;/security-domain&gt;</p><p>&lt;/jboss-web&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>SampleSTS.java</p><p>************************</p><p>/*</p><p> * JBoss, Home of Professional Open Source.</p><p> * Copyright 2012, Red Hat Middleware LLC, and individual contributors</p><p> * as indicated by the @author tags. See the copyright.txt file in the</p><p> * distribution for a full listing of individual contributors.</p><p> *</p><p> * This is free software; you can redistribute it and/or modify it</p><p> * under the terms of the GNU Lesser General Public License as</p><p> * published by the Free Software Foundation; either version 2.1 of</p><p> * the License, or (at your option) any later version.</p><p> *</p><p> * This software is distributed in the hope that it will be useful,</p><p> * but WITHOUT ANY WARRANTY; without even the implied warranty of</p><p> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</p><p> * Lesser General Public License for more details.</p><p> *</p><p> * You should have received a copy of the GNU Lesser General Public</p><p> * License along with this software; if not, write to the Free</p><p> * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA</p><p><span> * 02110-1301 USA, or see the FSF site: </span><a class="jive-link-external-small" href="http://www.fsf.org" rel="nofollow" target="_blank">http://www.fsf.org</a><span>.</span></p><p> */</p><p>package STS;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>import java.util.Arrays;</p><p>import java.util.LinkedList;</p><p>import java.util.List;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>import javax.servlet.annotation.WebServlet;</p><p>import javax.xml.ws.WebServiceProvider;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>import org.apache.cxf.annotations.EndpointProperties;</p><p>import org.apache.cxf.annotations.EndpointProperty;</p><p>import org.apache.cxf.interceptor.InInterceptors;</p><p>import org.apache.cxf.sts.StaticSTSProperties;</p><p>import org.apache.cxf.sts.operation.TokenIssueOperation;</p><p>import org.apache.cxf.sts.operation.TokenValidateOperation;</p><p>import org.apache.cxf.sts.service.ServiceMBean;</p><p>import org.apache.cxf.sts.service.StaticService;</p><p>import org.apache.cxf.sts.token.provider.SAMLTokenProvider;</p><p>import org.apache.cxf.sts.token.validator.SAMLTokenValidator;</p><p>import org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider;</p><p>import org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>@WebServiceProvider(serviceName = "SecurityTokenService",</p><p>&#160;&#160;&#160;&#160;&#160; portName = "UT_Port",</p><p><span>&#160;&#160;&#160;&#160;&#160; targetNamespace = "</span><a class="jive-link-external-small" href="http://docs.oasis-open.org/ws-sx/ws-trust/200512/" rel="nofollow" target="_blank">http://docs.oasis-open.org/ws-sx/ws-trust/200512/</a><span>",</span></p><p>&#160;&#160;&#160;&#160;&#160; wsdlLocation = "WEB-INF/wsdl/ws-trust-1.4-service.wsdl")</p><p>@EndpointProperties(value = {</p><p>&#160;&#160;&#160;&#160;&#160; @EndpointProperty(key = "ws-security.signature.username", value = "mystskey"),</p><p>&#160;&#160;&#160;&#160;&#160; @EndpointProperty(key = "ws-security.signature.properties", value = "stsKeystore.properties"),</p><p>&#160;&#160;&#160;&#160;&#160; @EndpointProperty(key = "ws-security.callback-handler", value = "STSCallbackHandler"),</p><p>&#160;&#160;&#160;&#160;&#160; @EndpointProperty(key = "ws-security.validate.token", value = "false") //to let the JAAS integration deal with validation through the interceptor below</p><p>})</p><p>@InInterceptors(interceptors = {"org.jboss.wsf.stack.cxf.security.authentication.SubjectCreatingPolicyInterceptor"})</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>public class SampleSTS extends SecurityTokenServiceProvider</p><p>{</p><p>&#160;&#160; @SuppressWarnings("deprecation")</p><p>public SampleSTS() throws Exception</p><p>&#160;&#160; {</p><p>&#160;&#160;&#160;&#160;&#160; super();</p><p>&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160; StaticSTSProperties props = new StaticSTSProperties();</p><p>&#160;&#160;&#160;&#160;&#160; props.setSignaturePropertiesFile("stsKeystore.properties");</p><p>&#160;&#160;&#160;&#160;&#160; props.setSignatureUsername("mystskey");</p><p>&#160;&#160;&#160;&#160;&#160; props.setCallbackHandlerClass(STSCallbackHandler.class.getName());</p><p>&#160;&#160;&#160;&#160;&#160; props.setIssuer("DoubleItSTSIssuer");</p><p>&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160; List&lt;ServiceMBean&gt; services = new LinkedList&lt;ServiceMBean&gt;();</p><p>&#160;&#160;&#160;&#160;&#160; StaticService service = new StaticService();</p><p><span>&#160;&#160;&#160;&#160;&#160; service.setEndpoints(Arrays.asList("</span><a class="jive-link-external-small" href="http://localhost:(\\d)*/PalmUtilServices/services/PalmUtilityService" rel="nofollow" target="_blank">http://localhost:(\\d)*/PalmUtilServices/services/PalmUtilityService</a><span>", "</span><a class="jive-link-external-small" href="http://" rel="nofollow" target="_blank">http://</a><span>\\[::1\\]:(\\d)*/PalmUtilServices/services/PalmUtilityService"));</span></p><p>&#160;&#160;&#160;&#160;&#160; services.add(service);</p><p>&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160; TokenIssueOperation issueOperation = new TokenIssueOperation();</p><p>&#160;&#160;&#160;&#160;&#160; issueOperation.setServices(services);</p><p>&#160;&#160;&#160;&#160;&#160; issueOperation.getTokenProviders().add(new SAMLTokenProvider());</p><p>&#160;&#160;&#160;&#160;&#160; issueOperation.setStsProperties(props);</p><p>&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160; TokenValidateOperation validateOperation = new TokenValidateOperation();</p><p>&#160;&#160;&#160;&#160;&#160; validateOperation.getTokenValidators().add(new SAMLTokenValidator());</p><p>&#160;&#160;&#160;&#160;&#160; validateOperation.setStsProperties(props);</p><p>&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160; this.setIssueOperation(issueOperation);</p><p>&#160;&#160;&#160;&#160;&#160; this.setValidateOperation(validateOperation);</p><p>&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I am not getting any deployment error.I am not sure what&#160; I am missing.</p><p>Also please let me know if there is a way we can view the list of deployed webservices in EAP 6.1 from admin console similar to soa-p.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Your help will be appreciated.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks,</p><p>Anu</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/826945#826945">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2047">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>