Can We Deploy Web Service Developed In Jdeveloper 10g In Weblogic 12c
In each of the examples below, nosotros have existing Java classes we ve written that we d like to make available to the globe via a Spider web Service. Coffee classes can be deployed equally stateless or stateful Web Services "pregnant that country is either preserved or not preserved between calls to the Spider web Service, respectively.
Stateless Java Spider web Services
For this instance, we have an existing Java class that returns the current condition of a database (i.e., up or down). Each time the form is chosen, the current condition of the database will be displayed; it is not necessary to notation if the class has been called previously, then this is an case of a stateless Java Web Service.
It s now time to add this existing Java class to my projection. Click the Add to Project push button, find the existing stateless Java class that you wish to add, as shown in Figure 17-four, and click Open .
Figure 17-4: Add a file to the project
If the file you re adding is non in the directory that you lot created your application in, yous ll need to verify that you wish to add this directory to your projection source path , as shown in Effigy 17-5.
Effigy 17-five: Add the project source path
At this betoken, the Java class is now part of your project. In Oracle JDeveloper 10 yard , there are ii ways to create a Web Service from this class. One method is to correct-click on the class and then select Generate Web Service from Class (displayed in Effigy 17-six):
Effigy 17-6: Options for the java class
Using this method automatically generates all of the necessary components to plow this form into a Web Service without prompting y'all for whatever options. This selection volition proper noun the Spider web Service MyWebService1, expose all of the bachelor methods in the class, and create a stateless form. Given this class merely has one method (nosotros wish to betrayal that method) and the desire is to create a stateless form, this method of automated Web Service cosmos works just fine. If y'all cull this method of Spider web Service creation, you can skip down to the department labeled Spider web Service Object Generated at this signal.
The other method that can be used to create a Web Service is the sorcerer-based approach. Selecting File New from the main Oracle JDeveloper x g bill of fare will bring up the New Gallery window, equally shown in Effigy 17-7.
Figure 17-7: The New Gallery window
Under the Full general category, select Web Services. You ll notation that at that place are a number of options available for Web Services. The first option is Java Web Service. Select it, and and so click OK. This starts a 3-step wizard process, which ends upwards with the same results equally the to a higher place right-click option. Still, information technology does let greater flexibility because the developer can specify choices relating to the generation and behavior of the Web Service as he goes through the wizard. Either choice likewise allows modification of the Web Service with a iii-tab Spider web Service modification window.
In Step 1, shown in Figure 17-8, a Coffee class needs to be selected that volition be the footing of the Web Service yous are attempting to create. In this figure, the DatabaseStatus Java course was selected "information technology was named DatabaseStatus.
Figure 17-8: Footstep one of 3 in the Web Service magician
Adjacent, the methods to be exposed in the Spider web Service are selected (see Figure 17-ix). Because this is going to be a stateless Spider web Service, the Stateful check box is left unselected . Clicking Adjacent moves the states to Step 3 in the wizard.
Figure 17-ix: Step 2 of three in the Spider web Service wizard
At this bespeak, you tin choose the port of your awarding server and the application server that this Web Service volition be deployed to (commonly referred to as an endpoint), as well as the proper noun infinite for the WSDL file that is generated (run into Figure 17-10). The other fields on this folio (Endpoint and Target Namespace) are automatically filled in (and not editable) based on the application server you choose to deploy the Web Service to.
Figure 17-x: Step 3 of iii in the Web Service wizard
If yous oasis t previously created an application server deployment profile, you can click on New at this fourth dimension.
Once the appropriate fields on this page have been filled in, click Next.
The last page congratulates you lot on the completion of the creation of your Spider web Service, as shown in Figure 17-11. Simply click Finish at this betoken.
Effigy 17-xi: Create Web Service finishing page
Web Service Object Generated
The Applications Navigator volition now include 2 new objects, every bit shown in Figure 17-12. The objects include the new Web Service (named DatabaseStatus) and the Web Service deployment resources (WebServices.deploy).
Figure 17-12: Applications Navigator with new Spider web Service object
Web Service Object Components
Click on the new Web Service object (i.e., the starting time DatabaseStatus object in Figure 17-12). As shown in Effigy 17-13, two objects appear in the structure window: a WSDL file and a Coffee file. You can select either object and view the contents of these automatically generated files. Oracle JDeveloper x thousand automatically creates the WSDL file based on the inputs and outputs of the methods exposed. This is a prime example of the power of Oracle JDeveloper 10 grand ˜s Spider web Service wizard. If you read through the WSDL, y'all ll besides understand why so many books require a considerable number of pages to discuss XML (the basis of the WSDL file) and WSDL construction. Using Oracle JDeveloper 10 g , the programmer is spared the details of learning the intricate syntax of XML and WSDL and only needs to focus on the purpose they fulfill in the Web Services architecture.
Figure 17-13: Spider web Service structure
Editing the Web Service Object
If you double-click the Spider web Service object, a iii-tab form will pop up allowing you to edit the Spider web Service object. This should expect very familiar, equally the 3 tabs are the same as the three steps in the wizard (see Effigy 17-xiv). If whatsoever of the fields are modified in the popular-up, the underlying Coffee and WSDL files are inverse correspondingly.
Figure 17-14: Edit Web Service object
We ll revisit deploying and executing this Web Service after roofing stateful Java Spider web Services and PL/SQL-based Web Services. If you re interested in these topics, see the corresponding sections beneath.
Stateful Java Web Services
For this example, we had an existing Java class chosen DOMESTICTAPI that queries data from an Excel spreadsheet and returns batches of information as private result sets. Considering we plan on calling the service numerous times to get our complete result set, this Web Service needs to maintain state (i.e., know that it has been chosen before) between calls.
Kickoff, our Coffee course needs to exist included in our projection. Click the Add to Projection icon to add the DOMESTICTAPI Java class as we did in Figure 17-four. Once more, in that location are two ways to create a Web Service for this Java class. The object can be right-clicked, then edited, or the developer can go through the three-step Spider web Service wizard. For this case, we re going to correct-click the object, then edit the object that JDeveloper creates. Afterward the object is generated (run into Figure 17-xv), it is named MyWebService1. To edit the object, you can double-click information technology in the Applications Navigator window or correct-click the object, and so select Edit.
Effigy 17-fifteen: Spider web Service for DOMESTICTAPI
At this point, nosotros renamed the Web Service to DOMESTICTAPI (the same name as the Java class). We then clicked on the Methods tab equally yous encounter in Figure 17-16. The Web Service is fabricated stateful by clicking the Stateful check box. We changed the timeout (seconds) from 0 to 20.
Figure 17-sixteen: Methods tab for DOMESTICTAPI
Our thinking here is that you re going to retrieve the side by side record set inside twenty seconds or yous must be washed fetching records. If the same user calls this stateful Web Service after the twenty-second time-out, she will get the beginning of the record set once once again " i.e., it will beginning over.
You can run into in Figure 17-16 that the fetchTable method is grayed out. Past clicking this method, then clicking the Why Not? button, every bit shown in Figure 17-17, y'all ll get a description as to why this method cannot be exposed every bit role of the Web Service.
Figure 17-17: The Why not? Button and its functionality
In this instance, it south because the oracle.sql.Assortment object doesn t have an XML schema mapping. For this Web Service, nosotros created another method called fetchTableSet and a record ready called DOMESTICSet to return my information ready using standard datatypes. Once the changes are made and you click OK the magician will detect that the changes made require regenerating the corresponding WSDL and Coffee files. Given these files already exist (and may have been mitt-edited by you), Oracle JDeveloper 10 g will prompt you lot, every bit shown in Figure 17-18, to ostend that you desire to lose the changes.
Effigy 17-xviii: Confirmation for generation
Similar to the information shown in Figure 17-12, the new Web Service object will appear in the Navigation Window. We ll talk nigh the deployment and utilise of this stateful Java Course Spider web Service shortly.
Can We Deploy Web Service Developed In Jdeveloper 10g In Weblogic 12c,
Source: https://flylib.com/books/en/4.186.1.140/1/
Posted by: greathouseinart1972.blogspot.com

0 Response to "Can We Deploy Web Service Developed In Jdeveloper 10g In Weblogic 12c"
Post a Comment