Hi Sanjay, Which versions of Axis2 and Rampart are you using? Seems like the way you access the MessageContext instance is wrong.
If you are using the latest 1.3 version, please use : MessageContext msgCtx = MessageContext.getCurrentMessageContext(); to obtain the message context within the "echo" method in the service class. Thanks, Ruchith Sanjay Vivek wrote:
Hi Nandana, The SOAP request is given below: POST /axis2/services/TokenService HTTP/1.1 Content-Type: text/xml; charset=UTF-8 SOAPAction: "urn:echo" User-Agent: Axis2 Host: 127.0.0.1:8083 Transfer-Encoding: chunked 490 <?xml version='1.0' encoding='UTF-8'?> <soapenv:Envelope 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-wsse curity-secext-1.0.xsd" soapenv:mustUnderstand="1"> <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssec urity-utility-1.0.xsd" wsu:Id="Timestamp-16842840"> <wsu:Created>2008-01-17T12:04:34.149Z</wsu:Created> <wsu:Expires>2008-01-17T12:09:34.149Z</wsu:Expires> </wsu:Timestamp> <wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssec urity-utility-1.0.xsd" wsu:Id="UsernameToken-9182681"> <wsse:Username>sanjay</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-t oken-profile-1.0#PasswordDigest">2jnM9V+QKd/VawjXTuuJ8FmcbV4=</wsse:Pass word> <wsse:Nonce>yNG7Fs/FiEpGYdp3z5Myww==</wsse:Nonce> <wsu:Created>2008-01-17T12:04:34.133Z</wsu:Created> </wsse:UsernameToken> </wsse:Security> </soapenv:Header> <soapenv:Body> <ns1:echo xmlns:ns1="http://extract.rampart.apache.org"> <param0>Hello world</param0> </ns1:echo> </soapenv:Body></soapenv:Envelope>0And the SOAP response is: HTTP/1.1 500 Internal Server Error Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=UTF-8 Transfer-Encoding: chunked Date: Thu, 17 Jan 2008 12:04:34 GMT Connection: close 148 <?xml version='1.0' encoding='UTF-8'?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <soapenv:Fault> <faultcode>soapenv:Server</faultcode> <faultstring>Exception occurred while trying to invoke service method echo</faultstring> <detail /> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope> I'm not sure if this helps. I've pretty much used the same code in basic/sample03 and I've only done very minor changes to the code so it should work. Thanks again. Regards Sanjay-----Original Message-----From: Nandana Mihindukulasooriya [mailto:[EMAIL PROTECTED] Sent: 17 January 2008 11:58To: rampart-dev@ws.apache.orgSubject: Re: Exception when attempting to obtain UserNameToken information at the service.Hi Sanjay,Is there a reason for these exceptions? I can't really figure out what'sgoing wrong because the exceptions doesn't tell me much.Can you capture the soap response from TCPMon and post it ? We will be able to see the stack trace in the soap response which provide us more details about the exception.Regards, Nandana
signature.asc
Description: OpenPGP digital signature