Hello, last video, we have created our custom method and we expose it as a soup surface, then we use to view or to test this web surface. In this video, I need to consume this soap web surface in my ADF application. There are multiple way you can do that, but I will tell you the way which I will use follow to call as to which surface in ETF application. First, I will just take the after I run my soup, I will take the URL in the browser and test if that web surface is running. So those surfaces running and this is the wisdom of my web surface. I will copy this wisdom.
After that I will go and I will create a new application. This application will have the client or the closest which is responsible for calling this web service so that you can call this web service Any Java program not only ADF, but any from Java program, you can call this web service. So here, I will create a custom application. This application will be my two web service call client application. This is a client application or the application which will be used to call the web surface. The next next finish.
So this application has an empty project. From this project, I will create new and you can search here for the client web surface client you will find here web surface client and to proxy you can search for proxy as well. So you can use web surface client and the proxy. This option will be used to generate a client Java or client application for the web surface core. OBS okay. Next, here, it will ask me to enter the code surface wisdom URL.
This is the was the real URL which I have copied, Nick is now a developer will try to connect to this web surface and see if it is running or not. So it is running, Nick so you can easily press finish. So GW will general Java classes is that can be used to call your web surface. From this application, you can easily generate a jar file and use the jar file at any Java application to call a web service. The good thing is here that the developer will generate as you can see, here, we generate a client Java class. This client Java class has a main method so that you can test your code to the web surface locally here before you generate the jar file or use this short foil at any other application.
So after it's legible, but finished All generation hoses or clauses, it will generate a client Java classes with main method from his here you can call the web surface and test it before using read the jar file and use it at any other application. So, let's now try to invoke as this web surface here in the main. So, here let us maximize this you will find here this is our web surface sport. So, I will take this object this object now has all operation inside my web surface. So you can inside the throw here, this is area you can hear prizes object dot you will find all operation can be called inside scoop up. So you will find here create department if you want delete, find department to view you will find all operation here And you will find here get a custom department name this is our custom method.
So let us try to call get a custom department name and I will send department for example, then we can write here string to get the output string IP name equal and I will invoke the web surface and I will print a department name. Okay, so let's now try and see if I will successfully invoke the web surface or not. I get an error. Okay, because of the bug in this version, which the filename extension is too long anywhere you will find this filename or exe or extension is too long you will know because of the library which I showed you before. So, here is the project you will find here in the library and the class path there are checks Ws client and Jax Ws web surface this to a this tool library has a lot of JAR file. So, as you can see all this and at runtime here if you run it local, it will give you exceptions too long so I will remove both of this and I will add my custom one okay.
So, anytime you will find this error you know that one of this library is added you can remove it and add your own one. So now let us try to run it again and see Okay, as you can see now it is printed department name at mystery So, here it invokes web surface and it returns the result. So, I know now, this application has everything is okay to call my web surface. And this is the code which I can use to call my web surface. So even you will have a client code, which you can use in your ADF application or any Java application. This code now will be responsible for calling is a web surface.
So let's now try to create an ADF application and use this code inside the ADF application. So now I will create a new application and it will be if application key this call to put surface application Okay, Nick To finish in this PDF application or you need to call this web surface, so here I will generate page blank cold sore and press OK. Okay, so here I just need to add I am bought tickets to enter the department ID and bottom to invoke a web surface and output text to display the result. So I will add a banner group to it and they'll say this but incurably I will I will add it if in particular Soon I will add a button and I will add it if output text key. So, I will add here a department ID and from this point on I will invoke web surface to get a department name and here I will display a department name as an output.
Okay. So here is the department ID I will bind it as app to back pain to get the value so, I will insert the binding I will create a new been my pain, my pain and in the package called pain and scope is request please okay Robert, you will be dipped ID a bit ID input the guests key and this point this will allow us to sit the result in the same bean, I will add a new property without tickets. So result all the way up to whoops surface result would put tickets okay. And in this photon I need to call the web surface. So I will bind this action listener to the back bead. So in the actual listener, I will select the same beam and I will add here invoke web surface action listener.
So now in this bag beans wrote in the book, whoops action listener misheard now created here. So here is a muy bien. So, you will find the invoke web surface action listener. So now once I place in the bottom invoke web surface, it will call this method. So now I need to get the department ID, which is a user will enter here. And after that I need to call the web surface and says output result here.
So, first I need to get the department ID so I called object iD iD equal get it deep ID in particular to get a value. So, now I get the value from a multicast which is a user entered. After that I need to invoke the web service. I told you as a developer will create a Java client class and has the code which can be used to call the web service. So I will copy this code and I will add it here. Okay.
Then I don't need any credential because there is no security I will remove this line set a port credential, there's no credential here. All I need is this web surface score. But as you can see now, if I don't know what it is actually, so, what you have to do you should you should generate a jar file forms a client application which you call job surface and import it in this EDF application to set it if application will aware about what actually this admin surface is. So after you have the code here, I've first I second step, you can go to your client application, which is this code is which this code is running correctly, which we created. To call sub surface Jen. Right click deploy a module surface client deploy to JAR file.
So, I need to call generate a jar file from the application which are generated to test as a web surface. So, right click in the project deploy app module surface client the blow to your fire Nick has to finish. So, now this will get to the deployment, you will find the short file is generated here in this boss Okay, so I will copy suppose of the shot file and I will back again to my if application and I will import the library and the class boss is a view controller in the library and the class was I will add Azure directory. So I will open it and I will select my Azure file. So, once I select the job file here, which has the code All web service is ATF project. Now, in the beam here, I should import now we will be able to import the surface and you can see now if application know what is a module surface.
This JAR file which we generated here actually can be used at any Java application. Now you have a jar file and you have the code which we'll call sub surface so you can use it anywhere at any Java program. Okay. So now I will invoke the web surface and it returns the MR department name. And once it returns the document name I need to sit out booth tickets so I will get not get it. Oh getting through boop surfaces are outward thickest, don't sit it value department name, but of course, we instead of sent 10 here, I need to send the department ID, which the user will enter.
So, let us add here this will take integral, if you see here, it will take into integral, but this is object. So I have two class this object to integrate. So I will say trigger to parse integer string dot value of a department ID. This is how you can we don't need any need for this map this for tradition as well. So, this is the symbol, which is just these two lines to call the surface and you can invoke this object and you can invoke any operation such as object I will invoke my custom To work with name and since our would take us to the last missing thing you just need to add Porsche trigger here. So, that one's a prison just put on this output ticket should be refresh.
So, I will take this ID and brought it to the Porsche trigger OCR with text. So, let us now try to run and test it in this EDF application Okay, so, now let us know try to test it. So, I will send department 10 and invoke web surface now, it will invoke the web surface and because there is this administration, if I add For example, 120 What was the web surface and it will get divorced with name. So, this is one way That you can call the soup surface in your ADF application in a programmatic way. You can actually generate this client applications is client to project which has the old clauses to call is a web surface inside your ADF application itself it will be one of these project instead of ADF has to project it can be has a certain project which will be a client a call to the web surface.
This way I will show you once is security and I will show you how you can code the secure web surface. But in this video now, we are able to call ours to web surface. Next video I will show you how you can add security to this tube surface and how you can code secure web surface in your ADF application. So, see you next video