<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: CXF WS-Security using JSR 181 + Interceptor Annotations (XFire Migration)</title>
	<atom:link href="http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/feed/" rel="self" type="application/rss+xml" />
	<link>http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/</link>
	<description>Arsenal blog by a Canadian</description>
	<pubDate>Tue, 02 Dec 2008 23:06:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7-beta2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Nilantha</title>
		<link>http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-804</link>
		<dc:creator>Nilantha</dc:creator>
		<pubDate>Wed, 12 Mar 2008 15:14:01 +0000</pubDate>
		<guid isPermaLink="false">http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-804</guid>
		<description>Thanks for posting this,

I would like to add following...

for those who need to access Spring context in any part of the application including CallbackHanders, this would be helpful

http://www.mail-archive.com/axis-user@ws.apache.org/msg22148.html

please update if you come across any better way of doing that.

Thanks,
Nilantha</description>
		<content:encoded><![CDATA[<p>Thanks for posting this,</p>
<p>I would like to add following&#8230;</p>
<p>for those who need to access Spring context in any part of the application including CallbackHanders, this would be helpful</p>
<p><a href="http://www.mail-archive.com/axis-user@ws.apache.org/msg22148.html" rel="nofollow">http://www.mail-archive.com/axis-user@ws.apache.org/msg22148.html</a></p>
<p>please update if you come across any better way of doing that.</p>
<p>Thanks,<br />
Nilantha</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sai C</title>
		<link>http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-803</link>
		<dc:creator>Sai C</dc:creator>
		<pubDate>Tue, 11 Mar 2008 16:23:45 +0000</pubDate>
		<guid isPermaLink="false">http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-803</guid>
		<description>I am calling a .Net web service in Java (client)and used the JAXWsProxyFactoryBean by enabling the WSAddressFeature, however, my soap header does not contain a  though it prints an  element. Could somebody let me know how do I get wsa:action in soap header using CXF API.

Appreciate your help.

Regards,
Sai</description>
		<content:encoded><![CDATA[<p>I am calling a .Net web service in Java (client)and used the JAXWsProxyFactoryBean by enabling the WSAddressFeature, however, my soap header does not contain a  though it prints an  element. Could somebody let me know how do I get wsa:action in soap header using CXF API.</p>
<p>Appreciate your help.</p>
<p>Regards,<br />
Sai</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yulinxp</title>
		<link>http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-784</link>
		<dc:creator>yulinxp</dc:creator>
		<pubDate>Thu, 10 Jan 2008 15:45:37 +0000</pubDate>
		<guid isPermaLink="false">http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-784</guid>
		<description>It will handle PasswordDigest automatically.
For PasswordText, I have to do the comparison and throw exception.

public class ServerPasswordCallback implements CallbackHandler {
    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {

        WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];

        String strClientPwd = pc.getPassword();
        int usage = pc.getUsage();

        if(pc.getIdentifer().equals("joe")) {

        	String strServerPwd = "password";

        	if(usage == WSPasswordCallback.USERNAME_TOKEN) {	//PasswordDigest
        	    pc.setPassword(strServerPwd);

        	}else if(usage == WSPasswordCallback.USERNAME_TOKEN_UNKNOWN) {	//PasswordText
        	    pc.setPassword(strServerPwd);

        	    if(!strClientPwd.equalsIgnoreCase(strServerPwd)){	//DIY compare
        	    	throw new WSSecurityException(WSSecurityException.FAILED_AUTHENTICATION);
        	    }
        	}
        }
    }
}</description>
		<content:encoded><![CDATA[<p>It will handle PasswordDigest automatically.<br />
For PasswordText, I have to do the comparison and throw exception.</p>
<p>public class ServerPasswordCallback implements CallbackHandler {<br />
    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {</p>
<p>        WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];</p>
<p>        String strClientPwd = pc.getPassword();<br />
        int usage = pc.getUsage();</p>
<p>        if(pc.getIdentifer().equals(&#8221;joe&#8221;)) {</p>
<p>        	String strServerPwd = &#8220;password&#8221;;</p>
<p>        	if(usage == WSPasswordCallback.USERNAME_TOKEN) {	//PasswordDigest<br />
        	    pc.setPassword(strServerPwd);</p>
<p>        	}else if(usage == WSPasswordCallback.USERNAME_TOKEN_UNKNOWN) {	//PasswordText<br />
        	    pc.setPassword(strServerPwd);</p>
<p>        	    if(!strClientPwd.equalsIgnoreCase(strServerPwd)){	//DIY compare<br />
        	    	throw new WSSecurityException(WSSecurityException.FAILED_AUTHENTICATION);<br />
        	    }<br />
        	}<br />
        }<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arsenalist</title>
		<link>http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-801</link>
		<dc:creator>Arsenalist</dc:creator>
		<pubDate>Mon, 07 Jan 2008 17:45:45 +0000</pubDate>
		<guid isPermaLink="false">http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-801</guid>
		<description>I see what you're saying and maybe they've changed the implementation on the server side however ValidateUserTokenInterceptor was present in the XFire samples and its use was recommended by the committers.  I think you also need to look at the source code for the WSS4J class UsernameTokenProcessor to learn more.

Have you tried the case where you specify an invalid username/password or a valid username but an invalid password? Do you still receive the SoapFault?</description>
		<content:encoded><![CDATA[<p>I see what you&#8217;re saying and maybe they&#8217;ve changed the implementation on the server side however ValidateUserTokenInterceptor was present in the XFire samples and its use was recommended by the committers.  I think you also need to look at the source code for the WSS4J class UsernameTokenProcessor to learn more.</p>
<p>Have you tried the case where you specify an invalid username/password or a valid username but an invalid password? Do you still receive the SoapFault?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yulinxp</title>
		<link>http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-802</link>
		<dc:creator>yulinxp</dc:creator>
		<pubDate>Mon, 07 Jan 2008 17:22:40 +0000</pubDate>
		<guid isPermaLink="false">http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-802</guid>
		<description>You mention:
Since WSS4J validates a UsernameToken only if it finds a security header we need to cover the case where no security header is specified.

In the following snippet from WSS4JInInterceptor.java
public void handleMessage(SoapMessage msg) throws Fault

if (wsResult == null) { // no security header found
 if (doAction == WSConstants.NO_SECURITY) {
    return;
 } else {
    LOG.warning("Request does not contain required Security header");
     throw new SoapFault(new Message("NO_SECURITY", LOG), version.getSender());
 }
}

If no security header found, a SoapFault is thrown. In my test, I set WS Security in server but not in client. And my client side does receive that SoapFault. So do we still need ValidateUserTokenInterceptor?</description>
		<content:encoded><![CDATA[<p>You mention:<br />
Since WSS4J validates a UsernameToken only if it finds a security header we need to cover the case where no security header is specified.</p>
<p>In the following snippet from WSS4JInInterceptor.java<br />
public void handleMessage(SoapMessage msg) throws Fault</p>
<p>if (wsResult == null) { // no security header found<br />
 if (doAction == WSConstants.NO_SECURITY) {<br />
    return;<br />
 } else {<br />
    LOG.warning(&#8221;Request does not contain required Security header&#8221;);<br />
     throw new SoapFault(new Message(&#8221;NO_SECURITY&#8221;, LOG), version.getSender());<br />
 }<br />
}</p>
<p>If no security header found, a SoapFault is thrown. In my test, I set WS Security in server but not in client. And my client side does receive that SoapFault. So do we still need ValidateUserTokenInterceptor?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nigel</title>
		<link>http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-793</link>
		<dc:creator>Nigel</dc:creator>
		<pubDate>Sat, 10 Nov 2007 09:06:21 +0000</pubDate>
		<guid isPermaLink="false">http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-793</guid>
		<description>&lt;a href="http://www.hpc.jcu.edu.au/projects/archer-data-activities/svn/MCATExtClientDemo/trunk/src/main/webapp/WEB-INF/clientBeans.xml" title="clientBean.xml" rel="nofollow"&gt;Client Bean&lt;/a&gt;

Thanks</description>
		<content:encoded><![CDATA[<p><a href="http://www.hpc.jcu.edu.au/projects/archer-data-activities/svn/MCATExtClientDemo/trunk/src/main/webapp/WEB-INF/clientBeans.xml" title="clientBean.xml" rel="nofollow">Client Bean</a></p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nigel</title>
		<link>http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-792</link>
		<dc:creator>Nigel</dc:creator>
		<pubDate>Sat, 10 Nov 2007 09:04:18 +0000</pubDate>
		<guid isPermaLink="false">http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-792</guid>
		<description>Is there an example of a client which is a Spring application, ie</description>
		<content:encoded><![CDATA[<p>Is there an example of a client which is a Spring application, ie</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Madhavan</title>
		<link>http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-789</link>
		<dc:creator>Matt Madhavan</dc:creator>
		<pubDate>Thu, 25 Oct 2007 22:40:59 +0000</pubDate>
		<guid isPermaLink="false">http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-789</guid>
		<description>Hi,
I am doing java first development. And I obtain my client proxy from the client-beans.xml file.

How do I code my client now when I obtain my client proxy from using spring?

Thanks
Matt</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I am doing java first development. And I obtain my client proxy from the client-beans.xml file.</p>
<p>How do I code my client now when I obtain my client proxy from using spring?</p>
<p>Thanks<br />
Matt</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Feng</title>
		<link>http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-797</link>
		<dc:creator>Feng</dc:creator>
		<pubDate>Fri, 12 Oct 2007 17:03:28 +0000</pubDate>
		<guid isPermaLink="false">http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-797</guid>
		<description>I am also wondering what if the client is not Java based, say a .NET client, is there any example about integration ?</description>
		<content:encoded><![CDATA[<p>I am also wondering what if the client is not Java based, say a .NET client, is there any example about integration ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Feng</title>
		<link>http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-790</link>
		<dc:creator>Feng</dc:creator>
		<pubDate>Wed, 10 Oct 2007 20:53:29 +0000</pubDate>
		<guid isPermaLink="false">http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-790</guid>
		<description>Shawn:
  I have trouble compile
  SportsService_Service service = new SportsService_Service();
  May I ask for the wsdl and the command that you use to generate the SportsService_Service class ?
  Thanks
Feng</description>
		<content:encoded><![CDATA[<p>Shawn:<br />
  I have trouble compile<br />
  SportsService_Service service = new SportsService_Service();<br />
  May I ask for the wsdl and the command that you use to generate the SportsService_Service class ?<br />
  Thanks<br />
Feng</p>
]]></content:encoded>
	</item>
</channel>
</rss>
