users@glassfish.java.net

Re: Problem in SecureWebServiceClient(UsernameAuthenticationwithSymmetric key)

From: Kumar Jayanti <Vbkumar.Jayanti_at_Sun.COM>
Date: Tue, 25 Aug 2009 13:17:17 +0530

glassfish_at_javadesktop.org wrote:
> Hi,
>
> I am trying to create a secure client for sample application (Secure calculator) that comes with netbeans . When I execute sample project I am able to run it successfully.
> When I create my own Project to consume secured web service of Secure Calculator I get the following error:
>
> WSS1409.error.creating.usernametoken
> WSITPVD0029: Error in Securing Outbound Message.
> com.sun.xml.wss.impl.WssSoapFaultException: Username has not been set
> at com.sun.xml.wss.impl.SecurableSoapMessage.newSOAPFaultException(SecurableSoapMessage.java:318)
> at com.sun.xml.wss.provider.wsit.WSITClientAuthContext.secureOutboundMessage(WSITClientAuthContext.java:390)
> at com.sun.xml.wss.provider.wsit.WSITClientAuthContext.secureRequest(WSITClientAuthContext.java:252)
> at com.sun.xml.wss.provider.wsit.WSITClientAuthContext.secureRequest(WSITClientAuthContext.java:218)
> at com.sun.enterprise.webservice.ClientSecurityPipe.process(ClientSecurityPipe.java:142)
> at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
> at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
> at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
> at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
> at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
> at com.sun.xml.ws.client.Stub.process(Stub.java:248)
> at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:134)
> at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:244)
> at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:224)
> at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:117)
> at $Proxy93.add(Unknown Source)
> at org.syntel.TestServlet.processRequest(TestServlet.java:53)
> at org.syntel.TestServlet.doGet(TestServlet.java:81)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
> at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
> at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
> at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
> at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
> at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
> at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
> at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
> at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
> at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
> at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
> at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
> Caused by: com.sun.xml.wss.XWSSecurityException: Username has not been set
> at com.sun.xml.wss.impl.filter.AuthenticationTokenFilter.resolveUserNameTokenData(AuthenticationTokenFilter.java:369)
> at com.sun.xml.wss.impl.filter.AuthenticationTokenFilter.addUserNameTokenToMessage(AuthenticationTokenFilter.java:443)
> at com.sun.xml.wss.impl.filter.AuthenticationTokenFilter.processUserNameToken(AuthenticationTokenFilter.java:98)
> at com.sun.xml.wss.impl.HarnessUtil.processWSSPolicy(HarnessUtil.java:104)
> at com.sun.xml.wss.impl.HarnessUtil.processDeep(HarnessUtil.java:263)
> at com.sun.xml.wss.impl.SecurityAnnotator.processMessagePolicy(SecurityAnnotator.java:186)
> at com.sun.xml.wss.impl.SecurityAnnotator.secureMessage(SecurityAnnotator.java:147)
> at com.sun.xml.wss.provider.wsit.WSITClientAuthContext.secureOutboundMessage(WSITClientAuthContext.java:387)
> ... 44 more
> SEC2004: Container-auth: wss: Error securing request
> javax.xml.ws.WebServiceException: WSITPVD0029: Error in Securing Outbound Message.
> at com.sun.xml.wss.provider.wsit.WSITClientAuthContext.secureOutboundMessage(WSITClientAuthContext.java:396)
> at com.sun.xml.wss.provider.wsit.WSITClientAuthContext.secureRequest(WSITClientAuthContext.java:252)
> at com.sun.xml.wss.provider.wsit.WSITClientAuthContext.secureRequest(WSITClientAuthContext.java:218)
> at com.sun.enterprise.webservice.ClientSecurityPipe.process(ClientSecurityPipe.java:142)
> at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
> at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
> at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
> at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
> at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
> at com.sun.xml.ws.client.Stub.process(Stub.java:248)
> at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:134)
> at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:244)
> at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:224)
> at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:117)
> at $Proxy93.add(Unknown Source)
> at org.syntel.TestServlet.processRequest(TestServlet.java:53)
> at org.syntel.TestServlet.doGet(TestServlet.java:81)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
> at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
> at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
> at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
> at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
> at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
> at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
> at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
> at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
> at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
> at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
> at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
> Caused by: javax.xml.ws.soap.SOAPFaultException: Username has not been set
> at com.sun.xml.wss.provider.wsit.WSITAuthContextBase.getSOAPFaultException(WSITAuthContextBase.java:1390)
> ... 45 more
> Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context ''
>
>
>
> Actually I followed all the steps for creating secured web service client:
> What exactly I have done is:
> 1) I have created a project
> 2) I have a created a web service client for the secured web service(secure calculator)
> 3) Edit web service attributes use development faults
>
You would have to set the default username and password fields. What
were they set to.

> 4) Created JSP and calling servlet as per sample application
>
> and I ran the project then I get the above error.
>
> Please help me what might be the problem or issue.
> [Message sent by forum member 'jayanth_gande' (jayanth_gande_at_syntelinc.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=361817
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>