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

Re: [Ftpapi] Fwd: HTTP API Question



Vino,

 

in addition to Scott’s response I suggest to post a debug log, that we can see the http headers passed between the client and server.

 

If you cannot post a debug log, you can check the log by yourself like this:

 

Disable statement http_setauth(), enable the debug log with http_debug(*on: path_to_debug_log) and call the web service. Look for "HTTP/1.1 401 Unauthorized". A few lines below you should find the "WWW-Authenticate" header. That header is returned by the server to inform the client about the supported (required) authentication scheme. If the header is "WWW-Authenticate: Basic" then the server expects BASIC authentication.

 

POST /PMR/services/Namespaces HTTP/1.1

Host: 10.214.128.57:8080

User-Agent: http-api/1.38

Content-Length: 1100

Content-Type: text/xml; charset=utf-8

SOAPAction:

 

 

sendraw(): entered

<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope>...</soapenv:Envelope>

recvresp(): entered

HTTP/1.1 401 Unauthorized

Server: Apache-Coyote/1.1

WWW-Authenticate: Basic realm="Basic Authentication"

Content-Type: text/html;charset=utf-8

Content-Length: 954

Date: Tue, 27 Feb 2018 13:32:10 GMT

 

 

SetError() #13: HTTP/1.1 401 Unauthorized

recvresp(): end with 401

recvdoc parms: identity 954

interpret_auth(): entered

SetError() #36: This page requires a user-id & password

 

Enable statement http_setauth() and call the server again. Search the debug log for "Authorization: Basic". That is the header send by HTTP API to the server to authenticate the client. The string following "Authorization: Basic" is the user name and password concatenated by a colon and encoded to Base64. You can decode the Base64 string "RG9uYWxkOkR1Y2s=" at https://www.base64decode.org/ to see the user name and password. For example, "RG9uYWxkOkR1Y2s=" decodes to "Donald:Duck" where "Donald" is the user name and "Duck" the password.

 

POST /PMR/services/Namespaces HTTP/1.1

Host: 10.214.128.57:8080

User-Agent: http-api/1.38

Content-Length: 1100

Authorization: Basic RG9uYWxkOkR1Y2s=

Content-Type: text/xml; charset=utf-8

 

Do the decoded user name and password match the values that you passed to http_setauth()?

 

Thomas.

 

Von: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] Im Auftrag von Vino
Gesendet: Montag, 21. Mai 2018 19:39
An: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Betreff: [Ftpapi] Fwd: HTTP API Question

 

Hi Team,

 

I need to send SOAP request as a XML file to another server with basic authentication. I am little confused which procedures to use for authentication and send xml file. 

 

Please advise. 

 

Thanks.

 

Regards,

Vino.

 

--
IMPORTANT NOTICE:
This email is confidential, may be legally privileged, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone else is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender.
-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi