Hi,

I can reproduce this issue from my side, the root cause is that you use constructor arg to init WSS4JInInterceptor in blueprint like
<bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
        <constructor-arg>
          <map>
            <entry key="action" value="UsernameToken"/>
            <entry key="passwordType" value="PasswordDigest"/>
            <entry key="passwordCallbackRef" ref="pwClbck"/>
          </map>
        </constructor-arg>
      </bean>
This can cause problem that the WSS4JInInterceptor.setProperties(Map) get invoked twice, the first time the constructor call it, the second time the IOC(blueprint in this case) container property autowire called it. There's another similar discussion when use spring[1], but the solution still applicable when use blueprint, you should avoid use the constructor-arg here, use set property directly instead, so change your server side configuration from
<bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
        <constructor-arg>
          <map>
            <entry key="action" value="UsernameToken"/>
            <entry key="passwordType" value="PasswordDigest"/>
            <entry key="passwordCallbackRef" ref="pwClbck"/>
          </map>
        </constructor-arg>
</bean>

to
<bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
                <property name="properties">
                    <map>
                        <entry key="action" value="UsernameToken"/>
<entry key="passwordType" value="PasswordDigest"/>
                        <entry key="passwordCallbackRef">
                            <ref component-id="pwClbck"/>
                        </entry>
                    </map>
                </property>
            </bean>
This should work.

[1]https://issues.apache.org/jira/browse/WSS-230

Freeman
On 2011-11-30, at 下午1:27, Chaks wrote:

Hello Freeman,
That didn't make any difference, still I get the same exception with
PasswordDigest as well. Please find the SOAP request message below,

********************************************************************************

<soapenv:Envelope xmlns:cxf="http://cxf.camel.demos.mycompany.com/";
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
 <soapenv:Header>
   <wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd ">
     <wsse:UsernameToken wsu:Id="UsernameToken-1"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd ">
       <wsse:Username>testuser</wsse:Username>
       <wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest ">WsieFP1Kj+qSKm6VyAhZeEPBJHU=</wsse:Password>
       <wsse:Nonce
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary ">UhaM20jCwsGyZNvkm6Nvyw==</wsse:Nonce>
       <wsu:Created>2011-11-30T05:21:49.817Z</wsu:Created>
     </wsse:UsernameToken>
   </wsse:Security>
 </soapenv:Header>
 <soapenv:Body>
   <cxf:greet>
     <name>Chaks</name>
   </cxf:greet>
 </soapenv:Body>
</soapenv:Envelope>

********************************************************************************

Thanks,
Chaks.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-Configuring-WSS4JInInterceptor-Using-a-Blueprint-tp5028621p5034577.html
Sent from the Camel - Users mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Email:[email protected]
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com









Reply via email to