Hi, nandana

Can I use a policy to specify that the server only needs username and password tokens? The server does not need encryption, signature, etc.
I used this policy in my server.
<wsp:Policy wsu:Id="UsernameToken"
            xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
            xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
            <wsp:ExactlyOne>
                <wsp:All>
                    <mtom:OptimizedMimeSerialization wsp:Optional="true" xmlns:mtom="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"/>
                    <sp:UsernameToken
                        sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient"
                        xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
                         />
                    <ramp:RampartConfig
                        xmlns:ramp="http://ws.apache.org/rampart/policy">
                        <ramp:passwordCallbackClass>
                            net.sf.webcommand.ws.WsPWCallbackHandler
                        </ramp:passwordCallbackClass>
                    </ramp:RampartConfig>
                </wsp:All>
            </wsp:ExactlyOne>
        </wsp:Policy>

I got a null pointer exception following the tutorial.  If I removed the mtom:OptimizedMimeSerialization, the client does send the message, but with a empty security header
<wsse:Security
            xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
            soapenv:mustUnderstand="true">

Did I write the policy correctly?

thanks

-jason



Nandana Mihindukulasooriya wrote:
Hi Daniel,

  
How can I get rid of the <user> element in the config file and set the
username/password in the handler PWCBClientHandler?
    

If you use the policy based configuration you can get rid of both
<user/> and password callback and set the username/password using
options in the client. Please take a look at the tutorial [1].

thanks,
/nandana

[1] - http://wso2.org/library/3190

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  

--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to