[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Basic authentication fails probably because of Base64 enconding



   Hi Mirco,
   When I decode this: YnViaUBleGFtcGxlLm9yZzo=
   I get this (as expected): [1]bubi@xxxxxxxxxxx:
   When I decode this:
   YnViaUBleGFtcGxlLm9yZyAgICAgICAgICAgICAgICAgAAAAAAAAAAAAAAAAAAAAAAA6
   I get this:  [2]"bubi@xxxxxxxxxxx(blanks here):"
   So it would seem that you are not %trimming blanks from the e-mail
   address before passing it to HTTPAPI??  But, your "setAuth" line does
   show the %trim() BIF, so I'm a little confused.  Why would that be?
   -SK

   On 12/4/2012 7:11 AM, Mirco Andreon wrote:

   More info: it seems not to be an encoding problem. If I try with a
   string literal instead of a variable
   http_setAuth( HTTP_AUTH_BASIC : '[[3]1]bubi@xxxxxxxxxxx' : '');
   the encoding is ok (YnViaUBleGFtcGxlLm9yZzo=).
   So this is not the problem. All seems the same now on both Web Services
   Explorer and HTTPAPI, but the latter doesn't work (always Bad Request).
Mirco Andreon

Il 04/12/2012 11:02, Mirco Andreon ha scritto:

   Hello, I'm trying to invoke this web service:

     WSDL: [2][4]http://www.nexusonline.it:8088/4DWSDL
     endpoint: [3][5]http://www.nexusonline.it:8088/4DSOAP/
     instructions: [4][6]http://www.nexusonline.it:8088/esempio4d
     method: Get_BankFromCAB
         parameters:
             ABI, 5 chars code
             CAB, 5 chars code
     Authentication: basic with an email as username and an empty string
     as password

   This is how Eclipse Web Services Explorer allows me to invoke it
   (following is Wireshark capture of the HTTP request):

     POST /4DSOAP/ HTTP/1.1
     Host: [5]www.nexusonline.it:8088
     Content-Type: text/xml; charset=utf-8
     Content-Length: 590
     Accept: application/soap+xml, application/dime, multipart/related,
     text/*
     User-Agent: IBM Web Services Explorer
     Cache-Control: no-cache
     Pragma: no-cache
     SOAPAction: "Nexus_WebService#Get_BankFromCAB"
     Authorization: Basic YnViaUBleGFtcGxlLm9yZzo=
     Connection: close

   [SOAP envelope omitted, because it's like mine]
   and it works.
   This is how I invoke it by HTTPAPI:

     http_setAuth( HTTP_AUTH_BASIC : %trim(email) : '');
     rc = http_url_post(
                         '[6][7]http://www.nexusonline.it:8088/4DSOAP/'
                       : %addr(SoapReq)+2
                       : %len(SoapReq)
                       : soapfile
                       : HTTP_TIMEOUT
                       : HTTP_USERAGENT
                       : 'text/xml; charset=utf-8'
                       : '"Nexus_WebService#Get_BankFromCAB"' );

   and it doesn't work.
   This is an extract from '/tmp/httpapi_debug.txt':

     POST /4DSOAP/ HTTP/1.1
     Host: [7]www.nexusonline.it:8088
     User-Agent: http-api/1.24
     Content-Type: text/xml; charset=utf-8
     SOAPAction: "Nexus_WebService#Get_BankFromCAB"
     Content-Length: 594
     Authorization: Basic
     YnViaUBleGFtcGxlLm9yZyAgICAgICAgICAgICAgICAgAAAAAAAAAAAAAAAAAAAAAAA6

   [if I read further I can see SOAP response saying
   <SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Bad
   Request.</SOAP-ENV:Fault>]
   The only difference I see is Authorization parameter. I always use
   username [8][8]"bubi@xxxxxxxxxxx" and empty password, but seems HTTPAPI is
   encoding in a slightly different way. Also putting double-quotes in
   SOAP action seems strange to me but I don't think it's the problem.
   Any help is appretiated, thanks!
--
Mirco Andreon

References

   1. [9]mailto:bubi@xxxxxxxxxxx
   2. [10]http://www.nexusonline.it:8088/4DWSDL
   3. [11]http://www.nexusonline.it:8088/4DSOAP/
   4. [12]http://www.nexusonline.it:8088/esempio4d
   5. [13]http://www.nexusonline.it:8088/
   6. [14]http://www.nexusonline.it:8088/4DSOAP/
   7. [15]http://www.nexusonline.it:8088/
   8. [16]mailto:bubi@xxxxxxxxxxx


-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
[17]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------

References

   1. mailto:bubi@xxxxxxxxxxx
   2. mailto:bubi@xxxxxxxxxxx(blankshere):
   3. mailto:1]bubi@xxxxxxxxxxx
   4. http://www.nexusonline.it:8088/4DWSDL
   5. http://www.nexusonline.it:8088/4DSOAP/
   6. http://www.nexusonline.it:8088/esempio4d
   7. http://www.nexusonline.it:8088/4DSOAP/
   8. mailto:bubi@xxxxxxxxxxx
   9. mailto:bubi@xxxxxxxxxxx
  10. http://www.nexusonline.it:8088/4DWSDL
  11. http://www.nexusonline.it:8088/4DSOAP/
  12. http://www.nexusonline.it:8088/esempio4d
  13. http://www.nexusonline.it:8088/
  14. http://www.nexusonline.it:8088/4DSOAP/
  15. http://www.nexusonline.it:8088/
  16. mailto:bubi@xxxxxxxxxxx
  17. http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------