[jboss-user] [JBossWS] - Re: How can I change mustUnderstand attribute of wsse:securi

mariovvl do-not-reply at jboss.com
Sat Jan 12 13:38:41 EST 2008


Thanks for the info! I tried your suggestion but run into another problem:

After I added in my own post handler, the outgoing soap message did not contain the wsse:Security element anymore! I basically got an empty header 


  | <env:Header/>
  | 
  | my debug log shows:
  | 
  | INFO [STDOUT] org.jboss.ws.soap.SOAPHeaderImpl at 1093b10[[env:Header: null]]
  | INFO [STDOUT] org.jboss.ws.soap.SOAPBodyImpl at 104a340[[env:Body: null]]
  | INFO [STDOUT] org.jboss.ws.soap.SOAPHeaderElementImpl at c22b28[[wsse:Security: null]]
  | 
  | . 

In my post handler I did not do anything except print out the header child elements as shown below, so I don't understand how the security element got removed. Here's my code and configuration (I'm using jboss4.0.4.GA and jbossws1.0.3.GA):

I added my post-handler to the standard-jbossws-client-config.xml as followed:

<?xml version="1.0" encoding="UTF-8"?>
  | 
  | <!-- $Id: standard-jbossws-client-config.xml 283 2006-05-05 23:08:11Z jason.greene at jboss.com $ -->
  | 
  | <jbossws-config xmlns="urn:jboss:jbossws-config:5.0"
  |   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  |   xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
  |   xsi:schemaLocation="urn:jboss:jbossws-config:5.0 http://www.jboss.com/xml/jbossws-config_1_0.xsd">
  |   ...
  |   <client-config>
  |     <config-name>Standard Secure Client</config-name>
  |     <post-handler-chain>
  |       <handler-chain-name>PostHandlerChain</handler-chain-name>
  |       <handler>   <j2ee:handler-name>WSSecurityHandlerOutbound</j2ee:handler-name> 
  |       <j2ee:handler-class>org.jboss.ws.wsse.WSSecurityHandlerOutbound</j2ee:handler-class>
  | 
  |       </handler>      
  |       <handler>
  |         <j2ee:handler-name>MyOutboundHandler</j2ee:handler-name>
  |         <j2ee:handler-class>org.test.soap.handler.MyOutboundHandler</j2ee:handler-class>
  |       </handler>      
  |     </post-handler-chain>
  |   </client-config>
  |   ...
  |   
  | </jbossws-config>

My handler looks like this:


  | public class MyOutboundHandler extends GenericHandler {
  | ...
  | public MyOutboundHandler () {};
  | 
  | public boolean handleRequest(MessageContext msgContext) {
  | SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
  |             SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
  | 
  |             SOAPHeader soapHeader = soapEnvelope.getHeader();
  |             Iterator it4 = soapHeader.getAllAttributes();
  |             while (it4.hasNext()) {
  |             	System.out.println(it4.next());
  |             };
  | 
  |  	       Iterator it = soapHeader.getChildElements();
  | 		   while (it.hasNext()) {
  | 		    	System.out.println(it.next());
  | 		   };
  | }
  | ...
  | }
  | 
  | 

Any idea what I'm doing wrong? 

Thanks,
    Mario

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119358#4119358

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119358



More information about the jboss-user mailing list