Creating Web services from Java classes is a straightforward process. The class must have one or more methods that a servlet running under Oracle9iAS Web services can invoke. This invocation happens when a client of that Web service calls the corresponding Web service method. This ection discusses the theory and issues involved in creating Web services out of Java classes for Oracle9iAS.
Oracle9iAS Web services support two types of implementations for Java classes running as Web services:
To deploy a Java class Web service, you need to package a J2EE .ear file that includes the required files and deployment descriptors. You also need to make some modifications in the web.xml file and package the Java class file into a .war file.
To use a Java class as a Web service, you need to add a <servlet> entry and a corresponding <servlet-mapping> entry into web.xml. The resulting web.xml file is assembled as part of a J2EE .war file that is included in the .ear file, which defines the Web service. Following is the syntax for these tags:
Adding these tags allows the Oracle9iAS Web services servlet to access the Java class for the Web service.
The following list presents the servlet tags and the tags under them:
An optional <param-name> with the value session-timeout and a corresponding <param-value> set to an integer value in seconds specify the timeout for the session. This optional parameter only applies for stateful Java Web services. The default value for the session timeout for stateful Java sessions, in which no session timeout is specified, is 60 seconds. An optional <param-name> with the value interface-name and a corresponding <param-value> set to the fully qualified name of the Java interface specify the methods to include in the Web service. This init parameter tells the Web service servlet generation code which methods the Web service should expose. If the parameter interface-name is not included in the <servlet> definition, then all public methods in the class are included in the Web service.
Here is an example of a sample web.xml file:
After the web.xml file is modified, add the Java class, which provides the functionality of the Web service, and any other support files to a .jar file either under WEB-INF/classes or WEBINF/ lib.
To add Web services based on Java classes, you need to include an application.xml file and package the application.xml and .war file containing the Java classes into a J2EE .ear file. Here is the code of a sample application.xml file:
After you have created the .ear file, your Web service is ready for deployment and use. From there, you can deploy the Web service as you would deploy any standard J2EE application that is stored in an .ear file (to run under OC4J).
Notice that we haven't really spoken of what tools to use for various tasks, such as creating the .ear file. That is because JDeveloper automates the whole process.
XML Related Interview Questions
|Soap Tool Interview Questions||HTML Interview Questions|
|PHP Interview Questions||ASP.NET Interview Questions|
|PHP5 Interview Questions||Java Interview Questions|
|CSS Interview Questions||XSLT Interview Questions|
|Java XML Interview Questions||XMLHttpRequest (XHR) Interview Questions|
|ebXML Interview Questions||XML DOM Interview Questions|
|XML-RPC Interview Questions||XSD Interview Questions|
|Soap Web Services Interview Questions||XSL Interview Questions|
|Xml Publisher Interview Questions|
Basics Of Xml
Basics Of Web Services
Introduction To Soap
Introduction To Uddi
Introduction To Wsdl
Creating A Web Service Using The Microsoft Soap Toolkit
Building Web Applications On The .net Platform
Creating An Asp.net Web Service
Creating A Web Service From An Interface
Introduction To The Atl Server
Creating A Web Service Using The Atl Server Library
Design And Creation Of The Knowledge Share Web Service
Introduction To Java Xml Technologies
Developing Java Web Services
Design And Creation Of A Web Service Using The Ibm Toolkit
Introduction To Mobile Applications
Creating A Mobile Application That Consumes A Web Service
Web Services Development With Jdeveloper
Creating Web Services Using Perl
Integration Of Xml Web Services With The Office Xp And Sql
Server 2000 Toolkits
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.