Login
Register

Home

Trainings

Fusion Blog

EBS Blog

Authors

CONTACT US

Fusion Blog
  • Register

Oracle Gold Partners, our very popular training packages, training schedule is listed here
Designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new

Search Courses

 

Objective:
In the previous article How to validate XML against XSD in java we have learned about XML validation method. In this article we will learn about Role of XML in java platform, Introducing web services concept, Web services standard, API’s and tools to develop Java Services.


XML:
XML is a simple text based language which was designed to store and transport data in plain text format. It stands for Extensible Markup Language. Following are some of the salient features of XML.

XML is a markup language.

XML is a tag based language like HTML.

XML tags are not predefined like HTML.

You can define your own tags which is why it is called extensible language.

XML tags are designed to be self descriptive.

XML is W3C Recommendation for data storage and transport.


Example:

<?xml version="1.0"?>
<Class>
  <Name>First</Name>
  <Sections>
     <Section>
        <Name>A</Name>
        <Students>
           <Student>Rohan</Student>
           <Student>Mohan</Student>
           <Student>Sohan</Student>
           <Student>Lalit</Student>
           <Student>Vinay</Student>
        </Students>
     </Section>
     <Section>
        <Name>B</Name>
        <Students>
           <Student>Robert</Student>
           <Student>Julie</Student>
           <Student>Kalie</Student>
           <Student>Michael</Student>
        </Students>
     </Section>
  </Sections>
</Class>


Role of XML in Java Platform:

The features of XML and Java are:

  1. Platform Independent

  2. Security

  3. Scalability

  4. Reliability


The advantages of developing Web application using XML are:

  1. Supports Exchange of data between heterogeneous databases and Systems.

  2. Distributes data processing load to the web browser.

  3. Integrates Java servers with Web browsers.

  4. XML is the natural choice of developing enterprise level web applications using java because of its data portability and platform independence features.

  5. Developers can implement the platform independent features of java to develop applications and exchange application data using XML.


Web services concept:

Web Services tutorial is designed for beginners and professionals providing basic and advanced concepts of web services such as protocols, SOAP, RESTful, java web service implementation, JAX-WS and JAX-RS tutorials and examples.

A Web Service is can be defined by following ways:

  • is a client server application or application component for communication.

  • method of communication between two devices over network.

  • is a software system for interoperable machine to machine communication.

  • is a collection of standards or protocols for exchanging information between two devices or application.

There are three major web service components:


  1. SOAP: SOAP is an acronym for Simple Object Access Protocol.
SOAP is a XML-based protocol for accessing web services.

SOAP is a W3C recommendation for communication between applications.

SOAP is XML based, so it is platform independent and language independent. In other words, it can be used with Java, .Net or PHP language on any platform.

    2. WSDL: WSDL is an acronym for Web Services Description Language.

WSDL is a xml document containing information about web services such as method name, method parameter and how to access it.

WSDL is a part of UDDI. It acts as a interface between web service applications.

WSDL is pronounced as wiz-dull.

    3. UDDI: UDDI is an acronym for Universal Description, Discovery and Integration.

UDDI is a XML based framework for describing, discovering and integrating web services.

UDDI is a directory of web service interfaces described by WSDL, containing information about web services.

UDDI is an XML-based standard for describing, publishing, and finding web services.

  • UDDI stands for Universal Description, Discovery, and Integration.

  • UDDI is a specification for a distributed registry of web services.

  • UDDI is a platform-independent, open framework.

  • UDDI can communicate via SOAP, CORBA, Java RMI Protocol.

  • UDDI uses Web Service Definition Language(WSDL) to describe interfaces to web services.

  • UDDI is seen with SOAP and WSDL as one of the three foundation standards of web services.

  • UDDI is an open industry initiative, enabling businesses to discover each other and define how they interact over the Internet.

Partner Interface Processes (PIPs) are XML based interfaces that enable two trading partners to exchange data. Dozens of PIPs already exist. Some of them are listed here:

  • PIP2A2 : Enables a partner to query another for product information.

  • PIP3A2 : Enables a partner to query the price and availability of specific products.

  • PIP3A4 : Enables a partner to submit an electronic purchase order and receive acknowledgment of the order.

  • PIP3A3 : Enables a partner to transfer the contents of an electronic shopping cart.

  • PIP3B4 : Enables a partner to query the status of a specific shipment.

RESTful web services:

RESTful web services are built to work best on the Web. Representational State Transfer (REST) is an architectural style that specifies constraints, such as the uniform interface, that if applied to a web service induce desirable properties, such as performance, scalability, and modifiability, that enable services to work best on the Web. In the REST architectural style, data and functionality are considered resources and are accessed using Uniform Resource Identifiers (URIs), typically links on the Web. The resources are acted upon by using a set of simple), well-defined operations. The REST architectural style constrains an architecture to a client/server architecture and is designed to use a stateless communication protocol, typically HTTP. In the REST architecture style, clients and servers exchange representations of resources by using a standardized interface and protocol.

The following principles encourage RESTful applications to be simple, lightweight, and fast:

  • Resource identification through URI: A RESTful web service exposes a set of resources that identify the targets of the interaction with its clients. Resources are identified by URIs, which provide a global addressing space for resource and service discovery. See The @Path Annotation and URI Path Templates for more information.

  • Uniform interface: Resources are manipulated using a fixed set of four create, read, update, delete operations: PUT, GET, POST, and DELETE. PUT creates a new resource, which can be then deleted by using DELETE. GET retrieves the current state of a resource in some representation. POST transfers a new state onto a resource. See Responding to HTTP Methods and Requests for more information.

  • Self-descriptive messages: Resources are decoupled from their representation so that their content can be accessed in a variety of formats, such as HTML, XML, plain text, PDF, JPEG, JSON, and others. Metadata about the resource is available and used, for example, to control caching, detect transmission errors, negotiate the appropriate representation format, and perform authentication or access control. See Responding to HTTP Methods and Requests and Using Entity Providers to Map HTTP Response and Request Entity Bodies for more information.

  • Stateful interactions through hyperlinks: Every interaction with a resource is stateless; that is, request messages are self-contained. Stateful interactions are based on the concept of explicit state transfer. Several techniques exist to exchange state, such as URI rewriting, cookies, and hidden form fields. State can be embedded in response messages to point to valid future states of the interaction. See Using Entity Providers to Map HTTP Response and Request Entity Bodies and “Building URIs” in the JAX-RS Overview document for more information.

 

API's:

JAXP:

The Java API for XML Processing (JAXP) is for processing XML data using applications written in the Java programming language.

JAXP leverages the parser standards Simple API for XML Parsing (SAX) and Document Object Model (DOM) so that you can choose to parse your data as a stream of events or to build an object representation of it.

JAXP also supports the Extensible Stylesheet Language Transformations (XSLT) standard, giving you control over the presentation of the data and enabling you to convert the data to other XML documents or to other formats, such as HTML.

JAXP also provides namespace support, allowing you to work with DTDs that might otherwise have naming conflicts. Finally, as of version 1.4, JAXP implements the Streaming API for XML (StAX) standard.

Designed to be flexible, JAXP allows you to use any XML-compliant parser from within your application. It does this with what is called a pluggability layer, which lets you plug in an implementation of the SAX or DOM API.

The pluggability layer also allows you to plug in an XSL processor, letting you control how your XML data is displayed.

SAX:

This lesson focuses on the Simple API for XML (SAX), an event-driven, serial-access mechanism for accessing XML documents.

This protocol is frequently used by servlets and network-oriented programs that need to transmit and receive XML documents, because it is the fastest and least memory-intensive mechanism that is currently available for dealing with XML documents, other than the Streaming API for XML (StAX).

Setting up a program to use SAX requires a bit more work than setting up to use the Document Object Model (DOM). SAX is an event-driven model (you provide the callback methods, and the parser invokes them as it reads the XML data), and that makes it harder to visualize. Finally, you cannot "back up" to an earlier part of the document, or rearrange it, any more than you can back up a serial data stream or rearrange characters you have read from that stream.

For those reasons, developers who are writing a user-oriented application that displays an XML document and possibly modifies it will want to use the DOM mechanism described in Document Object Model.

However, even if you plan to build DOM applications exclusively, there are several important reasons for familiarizing yourself with the SAX model:

  • Same Error Handling: The same kinds of exceptions are generated by the SAX and DOM APIs, so the error handling code is virtually identical.

  • Handling Validation Errors: By default, the specifications require that validation errors be ignored. If you want to throw an exception in the event of a validation error (and you probably do), then you need to understand how SAX error handling works.

  • Converting Existing Data: As you will see in Document Object Model, there is a mechanism you can use to convert an existing data set to XML. However, taking advantage of that mechanism requires an understanding of the SAX model.





Varun Kapila

Comments   

0 #1 s128.net 2022-02-18 04:30
You really make it seem so easy with your presentation but I find this matter
to be actually something that I think I would never understand.
It seems too complex and extremely broad for me.
I am looking forward for your next post, I'll try to get the hang of it!
Quote
0 #2 situs s128 2022-02-22 01:13
hello!,I really like your writing very a lot! share
we be in contact extra about your article on AOL?
I require a specialist in this area to solve my problem.
Maybe that's you! Having a look ahead to see you.
Quote
0 #3 s 128 2022-02-22 04:00
Why users still make use of to read news papers when in this technological globe the whole thing is
accessible on net?
Quote
0 #4 s 128 2022-02-22 18:02
Hi to every body, it's my first visit of this webpage;
this website includes remarkable and genuinely good stuff in support of visitors.
Quote
0 #5 s128 2022-02-23 03:15
Hello! Do you know if they make any plugins to help with SEO?
I'm trying to get my blog to rank for some targeted keywords but I'm not seeing very good results.

If you know of any please share. Kudos!
Quote
0 #6 s128.net 2022-02-23 05:36
If you wish for to obtain a great deal from this paragraph then you have to apply these strategies to your
won blog.
Quote
0 #7 s128 deposit 2022-02-23 11:47
I would like to thank you for the efforts you've put in writing this website.
I really hope to see the same high-grade content by you in the future as well.

In fact, your creative writing abilities has encouraged me to get my own site now ;)
Quote
0 #8 s128 2022-03-11 02:53
I have read so many articles concerning the blogger lovers
but this article is genuinely a nice article, keep it up.
Quote
0 #9 link alternatif s128 2022-03-11 05:48
Thanks for the marvelous posting! I certainly enjoyed reading it, you're a great author.
I will make sure to bookmark your blog and definitely will come back down the road.
I want to encourage one to continue your great writing, have
a nice holiday weekend!
Quote
0 #10 S128.Com 2022-03-12 13:53
Everything is very open with a really clear clarification of the challenges.
It was really informative. Your website is very useful. Thank you for sharing!
Quote
0 #11 s128 2022-03-24 08:01
I am genuinely grateful to the owner of this website who has shared this great piece of writing
at here.
Quote
0 #12 s128 2022-03-24 09:06
I got this website from my pal who told me about this website and at the moment this time I
am browsing this web page and reading very informative articles or reviews at this place.
Quote
0 #13 s 128 2022-03-24 23:10
Interesting blog! Is your theme custom made or did you download it from somewhere?
A design like yours with a few simple tweeks would really make my blog stand out.

Please let me know where you got your design. Kudos
Quote
0 #14 s128 2022-03-25 14:29
It is not my first time to go to see this web site, i am
visiting this site dailly and get fastidious data from here every
day.
Quote
0 #15 S128.Com 2022-03-25 20:11
That is a good tip especially to those new to the blogosphere.

Simple but very precise information… Thank you for sharing
this one. A must read article!
Quote
0 #16 s 128 2022-03-25 23:52
whoah this weblog is wonderful i really like reading your posts.
Keep up the good work! You know, lots of people are hunting round for this info, you could help them greatly.
Quote
0 #17 s128 2022-03-26 13:46
This is my first time pay a quick visit at here and i am genuinely happy to read everthing at alone place.
Quote
0 #18 s128.net 2022-03-31 13:26
I love your blog.. very nice colors & theme. Did you create this website yourself or did you hire
someone to do it for you? Plz reply as I'm looking to create my own blog and would like to find out where
u got this from. kudos
Quote
0 #19 s128 2022-04-16 02:16
It's going to be end of mine day, but before ending I am reading this fantastic paragraph to increase my experience.
Quote
0 #20 s1288 2022-04-25 20:09
May I simply just say what a comfort to find someone that genuinely understands what they're talking about on the web.

You certainly understand how to bring an issue to light and make it important.
More and more people should look at this and understand this
side of the story. I was surprised you are not
more popular given that you certainly possess the gift.
Quote
0 #21 s 128 2022-04-29 20:12
Very descriptive post, I enjoyed that bit. Will there be
a part 2?
Quote
0 #22 s1288 2022-04-30 00:45
Thanks for the good writeup. It actually was a amusement account it.
Look complicated to more added agreeable from you!
By the way, how can we be in contact?
Quote
0 #23 s128.com 2022-04-30 03:40
Every weekend i used to pay a quick visit this web site, as i wish for enjoyment, for the reason that this this web page conations actually nice funny stuff too.
Quote
0 #24 s128.com 2022-05-15 03:53
I've read a few good stuff here. Definitely worth bookmarking for
revisiting. I surprise how so much attempt you set to create one of these excellent informative
website.
Quote
0 #25 s128 2022-05-23 22:17
This post is worth everyone's attention.
Where can I find out more?
Quote
0 #26 s128 2022-06-19 06:06
Hey there! Do you know if they make any plugins to protect
against hackers? I'm kinda paranoid about losing everything I've worked hard on. Any suggestions?
Quote
0 #27 s128 2022-06-19 14:42
Hello! Someone in my Myspace group shared this website with us so
I came to check it out. I'm definitely enjoying the information. I'm
bookmarking and will be tweeting this to my followers! Outstanding
blog and outstanding style and design.
Quote
0 #28 s128 2022-06-19 15:38
It's going to be ending of mine day, except before ending I am reading this great post to increase my knowledge.
Quote

Add comment


Security code
Refresh

About the Author

Varun Kapila

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  Mar 2024  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
      1  2  3
  4  5  6  7  8  910
11121314151617
18192021222324
25262728293031

Enquire For Training

Fusion Training Packages

Get Email Updates


Powered by Google FeedBurner