Cannot get <wsse:Password> element printed out in the esb message

289 views Asked by At

I am trying to build a SOAP xml request which includes multiple namespaces using smooks action and freemarker tempting. Here is my code snippet in jboss-esb.xml and smooks-upgraded-right-now-query.xml is the templating file where I am building a SOAP client request to a web service.

Jboss-esb.xml

<action class="org.jboss.soa.esb.smooks.SmooksAction" name="create-right-now-details-query">
<property name="smooksConfig" value="/smooks/smooks-upgraded-right-now-query.xml"/>
<property name="resultType" value="STRING" />
</action>
<action class="org.jboss.soa.esb.actions.SystemPrintln" name="printMessageRequest">
<property name="message" value="GetInfoFromRightNow before request"/>
<property name="printfull" value="true"/>
</action>

Following is the smooks-upgraded-right-now-query.xml

smooks-upgraded-right-now-query.xml

<?xml version="1.0" encoding="UTF-8"?>
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
    xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd">
    <params>
        <param name="inputType">input.java</param>
        <param name="stream.filter.type">SAX</param>
        <param name="input.java" type="input.type.actived">com.ws.custom.Update</param>
    </params>

<ftl:freemarker applyOnElement="#document"> 

<ftl:template><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v11="urn:basews.customws.com/v1_2" xmlns:v12="urn:objectws.customws.com/v1_2">
    <soapenv:Header>
      <ns7:ClientInfoHeader soapenv:mustUnderstand="0" xmlns:ns7="urn:messages.ws.customws.com/v1_2">
        <ns7:AppID>Appid01</ns7:AppID>
      </ns7:ClientInfoHeader>
      <wsse:Security mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:UsernameToken>
            <wsse:Username>user</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>
</soapenv:Envelope>]]></ftl:template>

    <param name="rootElementName">Envelope</param>
    <param name="messageType">XML</param>

</ftl:freemarker>


<resource-config selector="#document">
<resource>org.milyn.delivery.DomModelCreator</resource>
</resource-config>

</smooks-resource-list>

As you can see above, I am just building a SOAP header which includes plain text. I am not reading any input from previous messages in the action pipeline.

I am able to print this SOAP header using SystemPrintln action if and only if <wsse:Password> element is removed from the above template. This happened to be the case even if I use xslt templating. I don't understand if this password element is misinterpreted by the smooks parser.

The only useful message I see in the log is [org.milyn.delivery.AbstractParser] (pool-96-thread-1:) XMLReader property 'http://xml.org/sax/properties/lexical-handler' not recognized by XMLReader 'org.milyn.delivery.java.XStreamXMLReader'.

Any clue is appreciated.

1

There are 1 answers

0
sanBV On BEST ANSWER

It seems like log4j can be configured to omit messages based on expressions inside the message like "Password" in this case.

This is the only reason I could think of why my message is discarded by the logger.

Please read the following link for more information.

http://pic.dhe.ibm.com/infocenter/sfsf/v9r1/index.jsp?topic=%2Fcom.ibm.help.custom.basics.doc%2FCstm_mask_info_using_log4j.html