<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
How can I resolve "General web Service security error"?
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/cbejarano">Carlos Bejarano</a> in <i>JBoss AS Documentation</i> - <a href="https://community.jboss.org/message/775157#775157">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I am using Jboss 6.1.0 Final and Jboss-cxf 3.4.1 GA...</p><p>I have problems using BindingProvider to set credential and consume a remote web service.</p><p>The user and pass are stored in a external file named</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Here my console message:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>hn.com.tigo.corporatesms.negocio.wsclient.SendMessageTechnicalExceptionMsg: BEA-386200: General web service security error</p><p>          at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146)</p><p>          at $Proxy62.sendMessage(Unknown Source)</p><p>          at hn.com.tigo.corporatesms.negocio.wsclient.facade.SendSMSWSClientFacade.sendSMS(SendSMSWSClientFacade.java:89)</p><p>          at hn.com.tigo.corporatesms.negocio.wsclient.facade.SendSMSWSClientFacade.sendSMSToMSISDN(SendSMSWSClientFacade.java:140)</p><p>          at hn.com.tigo.corporatesms.negocio.sms.SendSMS.send(SendSMS.java:120)</p><p>          at hn.com.tigo.corporatesms.negocio.sms.SendSMS.send(SendSMS.java:98)</p><p>          at hn.com.tigo.corporatesms.negocio.motor.tarea.TareaMotor02.sendSubscriberList(TareaMotor02.java:298)</p><p>          at hn.com.tigo.corporatesms.negocio.motor.tarea.TareaMotor02.doTask(TareaMotor02.java:234)</p><p>          at hn.com.tigo.corporatesms.negocio.motor.tarea.TareaMotor02.ejecutarTarea(TareaMotor02.java:89)</p><p>          at hn.com.tigo.corporatesms.negocio.timer.TareaGeneral.run(TareaGeneral.java:132)</p><p>          at java.lang.Thread.run(Thread.java:662)</p><p>Caused by: org.apache.cxf.binding.soap.SoapFault: BEA-386200: General web service security error</p><p>          at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:75)</p><p>          at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:46)</p><p>          at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)</p><p>          at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)</p><p>          at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:99)</p><p>          at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)</p><p>          at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)</p><p>          at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)</p><p>          at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)</p><p>          at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)</p><p>          at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)</p><p>          at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)</p><p>          at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)</p><p>          at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)</p><p>          at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)</p><p>          at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)</p><p>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)</p><p>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)</p><p>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)</p><p>          at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)</p><p>          at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)</p><p>          ... 10 more</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>and here my client code:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-java"><font color="navy"><b>private</b></font> GeneralResponse sendSMS(MobileMessage pMobileMessage)
                              <font color="navy"><b>throws</b></font> SendMessageTechnicalExceptionMsg <font color="navy">{</font>
                    <font color="navy"><b>try</b></font> <font color="navy">{</font>
                              System.out.println(<font color="red">"Inicializar Servicio :::> "</font> + this.urlWSDL);
                              MessagingServiceHttpBindingQSService servicio = <font color="navy"><b>new</b></font> MessagingServiceHttpBindingQSService(
                                                  <font color="navy"><b>new</b></font> URL(this.urlWSDL));
                              System.out.println(<font color="red">"Estado Servicio :::> "</font> + servicio);
                              MessagingService port = servicio
                                                  .getMessagingServiceHttpBindingQSPort();
                              Map<String, Object> ctx = ((BindingProvider) port)
                                                  .getRequestContext();
                              ctx.put(<font color="red">"ws-security.username"</font>, userName);
                              ctx.put(<font color="red">"ws-security.password"</font>, password);
                              System.out.println(<font color="red">"Port :::> "</font> + port);
                              printXMLRequest(pMobileMessage);
                              GeneralResponse response = port.sendMessage(pMobileMessage);
                              printXMLResponse(response);
                              <font color="navy"><b>return</b></font> response;
                    <font color="navy">}</font> <font color="navy"><b>catch</b></font> (MalformedURLException ex) <font color="navy">{</font>
                              SendMessageTechnicalExceptionMsg sendEX = <font color="navy"><b>new</b></font> SendMessageTechnicalExceptionMsg(
                                                  ex.getMessage(), ex.getCause());
                              sendEX.setStackTrace(ex.getStackTrace());
                              <font color="navy"><b>throw</b></font> sendEX;
                    <font color="navy">}</font> <font color="navy"><b>catch</b></font> (Exception e) <font color="navy">{</font>
                              SendMessageTechnicalExceptionMsg sendEX = <font color="navy"><b>new</b></font> SendMessageTechnicalExceptionMsg(
                                                  e.getMessage(), e.getCause());
                              sendEX.setStackTrace(e.getStackTrace());
                              <font color="navy"><b>throw</b></font> sendEX;
 
                    <font color="navy">}</font>
 
 
          <font color="navy">}</font>
 
</code></pre></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/775157#775157">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss AS Documentation at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2079">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>