[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Basic authentication fails probably because of Base64 enconding
Hello, I'm trying to invoke this web service:
WSDL: [1]http://www.nexusonline.it:8088/4DWSDL
endpoint: [2]http://www.nexusonline.it:8088/4DSOAP/
instructions: [3]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: [4]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(
'[5]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: [6]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 [7]"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. http://www.nexusonline.it:8088/4DWSDL
2. http://www.nexusonline.it:8088/4DSOAP/
3. http://www.nexusonline.it:8088/esempio4d
4. http://www.nexusonline.it:8088/
5. http://www.nexusonline.it:8088/4DSOAP/
6. http://www.nexusonline.it:8088/
7. mailto:bubi@xxxxxxxxxxx
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------