3 Replies Latest reply on Dec 11, 2012 11:19 AM by Tomás Gübeli

    Basic Authentication with SOAPProxy or SOAPClient  or HTTPRouter

    Juan Rios Newbie

      Hello I am new to JBoss ESB, I've been trying to consume a web service with three Apis, first with HttpRouter, then with SoapClient and finally SOAPProxy and in all these cases the response was the same.

       

      Error 401--Unauthorized

      From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:

      10.4.2 401 Unauthorized

      The request requires user authentication. The response MUST include a WWW-Authentic ate header field (section 14.46) containing a challenge applicable to the requested resource. The client MAY repeat th e request with a suitable Authorization header field (section 14.8). If the request already included Authorization cre dentials, then the 401 response indicates that authorization has been refused for those credentials. If the 401 respon se contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user SHOULD be presented the entity that was given in the response, since that entity MAY include rele vant diagnostic information. HTTP access authentication is explained in section 11.

       

       

      I consulted on almost every forum and many solutions presented when applying but not any.

       

      This is a picture of the work environment.

       

      Sin título.jpg

      This is my xml

       

       

       

       

       

      <?

      xml version="1.0"

      ?>

      <jbossesb

      xmlns=

      "http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd">

       

      <globals>

       

      <war-security domain="other" method="BASIC"/>

       

      </globals>

       

      <providers>

       

      <fs-provider name="InputFile">

       

      <fs-bus busid="inputFile"
      >

       

      <fs-message-filter directory="/tmp" input-suffix="esbfile"
      />

       

      </fs-bus>

       

      </fs-provider>

       

      </providers>

       

      <services>

       

      <service category="consume" description="Consume un servicio web" invmScope="GLOBAL" name="ConsumeServicio"
      >

       

      <listeners >

       

      <fs-listener busidref="inputFile" is-gateway="true" name="ListennerInputFile" />

       

      </listeners >

       

      <actions mep="RequestResponse" >

       

      <action class="action.GetFile" name="getFile" process="process"
      />

       

      <action class="org.jboss.soa.esb.actions.SystemPrintln" name="showMessageBefore"
      >

       

      <property name="message" value="ConsumeServicio->Actions->showMessageBefore"
      />

       

      <property name="printfull" value="true"
      />

       

      </action >

       

      <action class="org.jboss.soa.esb.actions.routing.http.HttpRouter" name="consumeServicioSII" >

       

      <property name="method" value="POST"
      />

       

      <property name="endpointUrl" value="*"
      >

       

      <http-client-property name="username" value="******"
      />

       

      <http-client-property name="password" value="*******"
      />

       

      <http-client-property name="file" value="/HttpRouter-localhost-https-9433.properties"
      />

       

      </property >

       

      </action >

       

      <action class="org.jboss.soa.esb.actions.SystemPrintln" name="showMessageAfter" >

       

      <property name="message" value="ConsumeServicio->Actions->showMessageAfter"
      />

       

      </action >

       

      <action class="org.jboss.soa.esb.actions.SyncServiceInvoker" name="enviaAConsumeWSClient" >

       

      <property name="service-category" value="consume"
      />

       

      <property name="service-name" value="ConsumeSOAPProxy"
      />

       

      </action >

       

      </actions >

       

      </service >

       

       

       

      <service category= "consume" description="Consume mediante la clae SOAPProxy" invmScope="GLOBAL" name="ConsumeSOAPProxy" >

       

      <security  allbackHandler="org.jboss.soa.esb.services.security.auth.login.JBossSTSIssueCallbackHandler" moduleName="" >

       

      <property name="password" value="********" />

       

      <property name="username" value="**********"
      />

       

      </security >

       

      <property name="username" value="***********" />

       

      <property name="password" value="************"
      />

       

      <actions mep="RequestResponse"
      >

       

      <action class="action.GetFile" name="getFile" process="process"
      />

       

      <action class="org.jboss.soa.esb.actions.SystemPrintln" name="showMessageBefore"
      >

       

      <property name="message" value="Services->Actions-ConsumeSOAPProxy>showMessageBefore"
      />

       

      <property name="printfull" value="true"
      />

       

      </action >

       

      <action class="org.jboss.soa.esb.actions.soap.proxy.SOAPProxy" name="ConsumeWSSIISOAPProxy" >

       

      <property name="wsdl" value="En?wsdl"
      />

       

      <property name="file" value="/META-INF//httpclient-8443.properties"
      />

       

      <!-- <property name="clientCredentialsRequired" value="true"/>-->

       

      <property name="method" value="POST"
      />

       

      <property name="endpointUrl" value="**"
      />

       

      <property name="headers"
      >

       

      <header name="username" value="*******"
      />

       

      <header name="password" value="******"
      />

       

      </property >

       

      </action >

       

      <action class="org.jboss.soa.esb.actions.SystemPrintln" name="showMessageAfter" >

       

      <property name="message" value="Services->Actions-ConsumeSOAPProxy>showMessageAfter"
      />

       

      </action >

       

      </actions >

       

      </service >

       

      </services >

      </

      jbossesb >

       

      And this is my property file

       

       

      configurators=AuthBASIC,HttpProtocol

       

       

      auth-username=********

       

      auth-password=***********

       

      authscope-host=127.0.0.1

       

      authscope-port=8080

       

       

      protocol-socket-factory=org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocketFactory

       

      keystore=/keystore.jks

       

      keystore-passw=hola1982

       

      truststore=/truststore.jks

       

      truststore-passw=hola1982

       

       

      max-connections-per-host=5

       

       

      I hope you can help me thanks!