Search code examples
javaweb-servicesoracle-databasejdeveloper

How to test Webservice in JDeveloper that uses Basic Authentication?


I have created a web-service that uses basic authentication in JDeveloper 11.1.1.4.

When i test my application using a client application is runs correctly so i know that the authentication mechanism has no problems.

How can i pass authentication info into the HTTP Analyzer by right clicking on Webservices and selecting Test Web Service?

I have tried to pass credentials through SOAP Headers > :WS-Security:Header like below but is not working

case1

I have also tried to pass authentication through Credentials option like shown below

case2

In both cases i get this error 500 HTTP Analyzer Server Error The server sent HTTP status code 401: Unauthorized: .....

How can i get through this? Thanks

UPDATE

I also tried to pass Authentication option to Request HTTP Headers but get the error message :

Error 403--Forbidden From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1: 10.4.4 403 Forbidden The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.


Solution

  • If you're using Basic authentication, all you need is set request header Authorization. Value of this header: prefix Basic, one space, Base64 encoded string with usrname:password, so your header for Aladin:sesam open should be like this: Basic QWxhZGluOnNlc2FtIG9wZW4=.

    On screenshot i see section Request HTTP headers, add Authorization header to it.