JBoss Community

How can I resolve "General web Service security error"?

created by Carlos Bejarano in JBoss AS Documentation - View the full discussion

Hi,

 

I am using Jboss 6.1.0 Final and Jboss-cxf 3.4.1 GA...

I have problems using BindingProvider to set credential and consume a remote web service.

The user and pass are stored in a external file named

 

Here my console message:

 

hn.com.tigo.corporatesms.negocio.wsclient.SendMessageTechnicalExceptionMsg: BEA-386200: General web service security error

          at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146)

          at $Proxy62.sendMessage(Unknown Source)

          at hn.com.tigo.corporatesms.negocio.wsclient.facade.SendSMSWSClientFacade.sendSMS(SendSMSWSClientFacade.java:89)

          at hn.com.tigo.corporatesms.negocio.wsclient.facade.SendSMSWSClientFacade.sendSMSToMSISDN(SendSMSWSClientFacade.java:140)

          at hn.com.tigo.corporatesms.negocio.sms.SendSMS.send(SendSMS.java:120)

          at hn.com.tigo.corporatesms.negocio.sms.SendSMS.send(SendSMS.java:98)

          at hn.com.tigo.corporatesms.negocio.motor.tarea.TareaMotor02.sendSubscriberList(TareaMotor02.java:298)

          at hn.com.tigo.corporatesms.negocio.motor.tarea.TareaMotor02.doTask(TareaMotor02.java:234)

          at hn.com.tigo.corporatesms.negocio.motor.tarea.TareaMotor02.ejecutarTarea(TareaMotor02.java:89)

          at hn.com.tigo.corporatesms.negocio.timer.TareaGeneral.run(TareaGeneral.java:132)

          at java.lang.Thread.run(Thread.java:662)

Caused by: org.apache.cxf.binding.soap.SoapFault: BEA-386200: General web service security error

          at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:75)

          at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:46)

          at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)

          at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)

          at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:99)

          at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)

          at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)

          at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)

          at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)

          at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)

          at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)

          at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)

          at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)

          at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)

          at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)

          at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)

          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)

          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)

          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)

          at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)

          at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)

          ... 10 more

 

 

 

and here my client code:

 

private GeneralResponse sendSMS(MobileMessage pMobileMessage)
                              throws SendMessageTechnicalExceptionMsg {
                    try {
                              System.out.println("Inicializar Servicio :::> " + this.urlWSDL);
                              MessagingServiceHttpBindingQSService servicio = new MessagingServiceHttpBindingQSService(
                                                  new URL(this.urlWSDL));
                              System.out.println("Estado Servicio :::> " + servicio);
                              MessagingService port = servicio
                                                  .getMessagingServiceHttpBindingQSPort();
                              Map<String, Object> ctx = ((BindingProvider) port)
                                                  .getRequestContext();
                              ctx.put("ws-security.username", userName);
                              ctx.put("ws-security.password", password);
                              System.out.println("Port :::> " + port);
                              printXMLRequest(pMobileMessage);
                              GeneralResponse response = port.sendMessage(pMobileMessage);
                              printXMLResponse(response);
                              return response;
                    } catch (MalformedURLException ex) {
                              SendMessageTechnicalExceptionMsg sendEX = new SendMessageTechnicalExceptionMsg(
                                                  ex.getMessage(), ex.getCause());
                              sendEX.setStackTrace(ex.getStackTrace());
                              throw sendEX;
                    } catch (Exception e) {
                              SendMessageTechnicalExceptionMsg sendEX = new SendMessageTechnicalExceptionMsg(
                                                  e.getMessage(), e.getCause());
                              sendEX.setStackTrace(e.getStackTrace());
                              throw sendEX;
  
                    }
 
 
          }
 

Reply to this message by going to Community

Start a new discussion in JBoss AS Documentation at Community