Hello, last video I show you how you can call the wrist with wrist a full web surface from ATF application. In this video I will show you how you can secure your wrist as a basic authentication and how we can call this wrist from ATF application. So now let us this simple and easy just select your rest web service. If you now I will secure my RESTful web service so I will select the project rest web service and from application secure configure it if security I will apply it if security over this project and I will select it if authentication exists. So it will be basic authentication. Next, Next, finish okay as you can see here means that with XML if you open your XML, if you go to security, security constraints here you can control if you want to apply your security over all HTTP method, or if you want to apply only this security only in get or in the Delete, or post, so whatever you want, you can select or you can see I want to apply the security in all HTTP method.
So this is all just all just you enable security in XML. This will be done automatically once you select the project and from applications if you configure the security. So let's now try to run this application. Okay, so this is the URL. Let us copy So your URL and go to school boy, it does make a new rest project. But this URL and I will add the version number and resource name.
Okay. And it does invoke the get method you will find here also is our exception error authorizing error, so we need a security so you can't code this web surface unless you apply a basic authentication. So let's try to add here in a basic authentication and test it. They will select here add a new syndication, basic syndication, and let us introduce a new one buzzword WebLogic WebLogic one. Let's try to invoke it now. You'll find this coal sick successfully.
He was brought here a secure a beer here and say you're ill, and you are able to invoke your web surface as normal. Just need to applies a basic authentication. So let's now try to run our ADF application, which use this web surface to display the data and see how we can configure the web service call with the security. If application core is the application, which we developed last video, let us run this application here onto our web surface. As you can see here, no that is returned it and let's have a look into look You will find here Exception Handling 401 which is authorized it error. So now we are not able to call the web service because we didn't apply the security.
So let's add security here. So here we invoke the get method. This is our get method. So from here, we can add our security so I will right here string username. Equal interviews are named with logic. Currently we use the WebLogic user username and password which you use to log into the WebLogic console.
String password equal logic one Then we will write this code which will add in the connection interoperability code also right authorization basic and we will add the, this is trick. This is actually we add here a message through with user name, column and password This is how the string should look like username, password. After that you will encode it using data type converter. Basic is for binary as in as a string and basit as a property authorization property for the connection request. So this is the highlight code which we added for applying the basic credential security, we add this this code. So, let us now try to run the ATF application again.
This call on deployed and it has now run it again and see if it will invoke the data correctly is a good surface character understanding the data or not. Now, the data is displayed and the web surface is cooled successfully after we add the username and password credential in the HTTP requests here. So, this is how you can secure your wrist web surfers using basic authentication and the existence of How you can call your secure web service. So see you next video.