SlideShare une entreprise Scribd logo
1  sur  23
Collaborate


Knowledge Byte

    In this section, you will learn about:


         •   JAXB API
         •   SAAJ API




 ©NIIT                          Collaborate   Lesson 1C / Slide 1 of 23
Collaborate


JAXB API

    •    Is a Java technology that provides an API and tool that binds an XML schema
         to a representation in Java code.
    •    Provides the method for unmarshalling and marshalling.
    •    Used for developing an application that can read, manipulate, or recreate XML
         documents.
    •    Works as an abstraction layer between Java and an XML document because
         you do not need to know about the XML syntax or XML processing.




 ©NIIT                          Collaborate                   Lesson 1C / Slide 2 of 23
Collaborate


JAXB API (Contd.)
    •    Working of JAXB


          •   Components used while processing XML document are:


                •   XML Schema
                •   Binding Compiler
                •   Binding Declarations
                •   Binding Implementation Framework
                •   XML Input Document
                •   XML Output Document




 ©NIIT                          Collaborate               Lesson 1C / Slide 3 of 23
Collaborate


JAXB API (Contd.)
         •   The following figure shows the working of JAXB API:




 ©NIIT                         Collaborate                   Lesson 1C / Slide 4 of 23
Collaborate


JAXB API (Contd.)
    •    JAXB API


          •   Is defined in javax.xml.bind package, which contains classes and
              interfaces for unmarshalling, validating, and marshalling an XML
              document.
          •   Various classes contained in javax.xml.bind package are:


                •   JAXBContext
                •   Unmarshaller
                •   Validator
                •   Marshaller




 ©NIIT                          Collaborate                 Lesson 1C / Slide 5 of 23
Collaborate


SAAJ API

    •    Enables you to write SOAP messaging applications.
    •    Is a low-level API that contains methods to exchange messages between the
         clients and the Web applications.
    •    Enables you to write SOAP messaging applications.




 ©NIIT                         Collaborate                  Lesson 1C / Slide 6 of 23
Collaborate


SAAJ API (Contd.)
    •    SAAJ API


          •   SAAJ API is defined in the package, javax.xml.soap, which provides the
              primary abstraction for SOAP messages with attachments.
                 • The table list various interfaces present in the javax.xml.soap
                   package:


                Interface                              Description


    Detail                             Represents a container to store the
                                       DetailEntry objects.

    DetailEntry                        Stores information about SOAPFault objects.



 ©NIIT                          Collaborate                   Lesson 1C / Slide 7 of 23
Collaborate


SAAJ API (Contd.)
          •   The table list various interfaces present in the javax.xml.soap package
              (Contd.):


               Interface                              Description

   Name                                Represents an XML name.

   Node                                Represents a node element of an XML
                                       document.

   SOAPBody                            Represents an object that stores the SOAP
                                       body element of a SOAP message.

   SOAPBodyElement                     Stores information about a SOAPBody object.


 ©NIIT                           Collaborate                  Lesson 1C / Slide 8 of 23
Collaborate


SAAJ API (Contd.)
           •   The table list various interfaces present in the javax.xml.soap package
               (Contd.):



                 Interface                               Description

    SOAPElement                          Represents an element of a SOAP message.

    SOAPHeader                           Stores information about the header of a
                                         SOAP element.

    Text                                 Represents a node that stores text.




 ©NIIT                            Collaborate                   Lesson 1C / Slide 9 of 23
Collaborate


SAAJ API (Contd.)
         •   The following table describes the classes present in the javax.xml.soap
             package:

                Class                                Description

  AttachmentPart                     Creates an object to attach a single
                                     attachment to a SOAPMessage object.

  MimeHeader                         Creates an object to store the name of the
                                     MIME header and its value.

  MessageFactory                     Contains methods to initialize the
                                     SOAPMessage objects.

  SOAPConnection                     Creates a connection object that represents a
                                     point-to-point connection. The objects of this
                                     class enable clients to send messages
                                     directly to the remote destination.
 ©NIIT                         Collaborate                  Lesson 1C / Slide 10 of 23
Collaborate


SAAJ API (Contd.)
         •   The following table describes the classes present in the javax.xml.soap
             package (Contd.):


                  Class                               Description


    SOAPMessage                        Creates an object to store a SOAP message.


    SOAPException                      Creates an object that represents a SOAP
                                       exception.




 ©NIIT                         Collaborate                  Lesson 1C / Slide 11 of 23
Collaborate


SAAJ API (Contd.)
         •   The following figure shows the components of SOAPMessage object:




 ©NIIT                         Collaborate                Lesson 1C / Slide 12 of 23
Collaborate


From the Expert’s Desk

    This section will introduce the following:


         •   Best Practices on processing XML documents.
         •   Tips on caching techniques in XSLT to enhance performance.
         •   Tips on development techniques to make XSLT stylesheets manageable.
         •   Tips on techniques to use the import and include statements for combining
             stylesheets.
         •   FAQs on retrieving status and error information related to SOAP
             messages.




 ©NIIT                          Collaborate                 Lesson 1C / Slide 13 of 23
Collaborate


Best Practices
Processing XML Documents
    •    You can process XML documents using either SAX or DOM parsers.
    •    Use SAX parser:


          •   To parse large sized XML documents.
          •   When XML document is not nested.


    •    Do not use SAX parser to modify the structure of an XML document.
    •    Use DOM parser:


          •   To parse small sized XML documents.
          •   When you know that the entire document is to be parsed.
          •   When you want to access the particular element in an XML document.


 ©NIIT                          Collaborate                Lesson 1C / Slide 14 of 23
Collaborate


Tips
Caching Techniques in XSLT to Enhance
Performance
    •    You can implement caching by loading transformation information into the
         object of JAXP’s javax.xml.transform.Templates interface.
    •    You can then use the Templates object to obtain a Transformer object.
    •    You can reuse the Templates object to produce more transformers later and
         save time on stylesheet parsing and compilation.
    •    The following syntax shows the declaration of Templates object to obtain a
         Transformer object:
         Source source_xslt = new StreamSource(xslt_File);
         TransformerFactory transformerFactory =
         TransformerFactory.newInstance();
         Templates cached_XSLT=transformerFactory.newTemplates(source_xslt);
         Transformer transformer = cached_XSLT.newTransformer();

 ©NIIT                         Collaborate                Lesson 1C / Slide 15 of 23
Collaborate


Tips (Contd.)
Development Techniques to Make XSLT
Stylesheets Manageable
    •    Techniques to make XSLT stylesheets easily readable and manageable are:


          •   Using syntax highlighting editor can make the XSLT stylesheets readable.
          •   Adding comment blocks can make XSLT templates descriptive and breaks
              the repetitiveness of scanning '<' and '>' characters page by page.
          •   Using naming conventions for variables and parameters.
          •   Breaking the functionalities into different stylesheets for reusing the code
              with the help of <xsl:import>




 ©NIIT                           Collaborate                  Lesson 1C / Slide 16 of 23
Collaborate


Tips (Contd.)
Techniques to Use the Import and Include
Statements for Combining Stylesheets

    •    Two methods to combine stylesheets are:


          •   The include mechanism
          •   The import mechanism




 ©NIIT                         Collaborate         Lesson 1C / Slide 17 of 23
Collaborate


Tips (Contd.)
Techniques to Use the Import and Include
Statements for Combining Stylesheets (Contd.)

         •   The include mechanism:


               •   A stylesheet is combined without changing the syntax of the
                   stylesheet.
               •   A stylesheet can include another stylesheet with the help of element,
                   <xsl:include>.
               •   The <xsl:include> element accepts a parameter, href whose value
                   is a URI reference.




 ©NIIT                           Collaborate                  Lesson 1C / Slide 18 of 23
Collaborate


Tips (Contd.)
Techniques to Use the Import and Include
Statements for Combining Stylesheets (Contd.)

         •   The import mechanism:


               •   A stylesheet overrides the other stylesheet.
               •   A stylesheet can be imported with the help of the statement,
                   <xsl:import>.
               •   You need to use the statement, <xsl:import> within the CSS file or
                   STYLE element.
               •   The statement, <xsl:import> should occur at the start of the
                   stylesheet.



 ©NIIT                          Collaborate                 Lesson 1C / Slide 19 of 23
Collaborate


FAQs
    •    How can you retrieve status and error information when a SOAP message does
         not reach its destination properly?


          •   An object of the SOAPFault class is used to receive status and error
              information when the message does not reach its destination successfully.
          •   A SOAPFault object is present in the SOAPBody object of the message.
          •   A SOAPFault object informs the end user about a problem, such as an
              exception object.
          •   A SOAPFault object contains a:


                •   fault code: Represents the code that indicates a problem.
                •   fault string: Represents the fault as a String object.
                •   fault actor: Identifies the source of the fault.
                •   detail object: Represents the fault that occurs because of a SOAPBody
                    object.

 ©NIIT                            Collaborate                  Lesson 1C / Slide 20 of 23
Collaborate


Challenge

         3.   Consider the following two statements:
                   Statement A: A registry is a directory provided by a service
              provider to publish their Web service.
                   Statement B: A registry is a directory provided by a service
              provider to allow clients to bind with its Web service.
              Identify the correct option:
              a.   Both statements A and B are true
              b.   Both statements A and B are false
              c.   Statement A is true while statement B is false
              d.   Statement A is false while statement B is true




 ©NIIT                        Collaborate                   Lesson 1C / Slide 21 of 23
Collaborate


Challenge (Contd.)

         2.   What does the fault string element of a SOAP message represent?
         3.   The classes and interfaces of the ____________ package can be used to
              create and send SOAP messages from a Java application.
         4.   The ___________ method allows you to parse an XML document using
              both SAX and DOM parsers.
         5.    A ___________ document defines a Web service and are used by
              service providers to publish their Web service in registries.




 ©NIIT                        Collaborate                Lesson 1C / Slide 22 of 23
Collaborate


Solution

         •   b. Both statement A and B are false
         •   The fault string element represents an error in the SOAP message
         •   javax.xml.soap
         •   parse()
         •   WSDL




 ©NIIT                      Collaborate                 Lesson 1C / Slide 23 of 23

Contenu connexe

Similaire à Deawsj 7 ppt-1_c

Deawsj 7 ppt-2_c
Deawsj 7 ppt-2_cDeawsj 7 ppt-2_c
Deawsj 7 ppt-2_cNiit Care
 
Deawsj 7 ppt-1_b
Deawsj 7 ppt-1_bDeawsj 7 ppt-1_b
Deawsj 7 ppt-1_bNiit Care
 
Java architecture for xml binding
Java architecture for xml bindingJava architecture for xml binding
Java architecture for xml bindingKiran Gajbhiye
 
Chapter 12:Understanding Server-Side Technologies
Chapter 12:Understanding Server-Side TechnologiesChapter 12:Understanding Server-Side Technologies
Chapter 12:Understanding Server-Side TechnologiesIt Academy
 
Hibernate interview questions
Hibernate interview questionsHibernate interview questions
Hibernate interview questionsvenkata52
 
Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.suranisaunak
 
Java Collection Interview Questions [Updated]
Java Collection Interview Questions [Updated]Java Collection Interview Questions [Updated]
Java Collection Interview Questions [Updated]SoniaMathias2
 
Java 8 - Features Overview
Java 8 - Features OverviewJava 8 - Features Overview
Java 8 - Features OverviewSergii Stets
 
.net Based Component Technologies
.net Based Component Technologies.net Based Component Technologies
.net Based Component Technologiesprakashk453625
 
Xml Messaging With Soap
Xml Messaging With SoapXml Messaging With Soap
Xml Messaging With SoapAkramWaseem
 
Xml messaging with soap
Xml messaging with soapXml messaging with soap
Xml messaging with soapJohnny Pork
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework Serhat Can
 

Similaire à Deawsj 7 ppt-1_c (20)

Deawsj 7 ppt-2_c
Deawsj 7 ppt-2_cDeawsj 7 ppt-2_c
Deawsj 7 ppt-2_c
 
Deawsj 7 ppt-1_b
Deawsj 7 ppt-1_bDeawsj 7 ppt-1_b
Deawsj 7 ppt-1_b
 
Dacj 1-2 c
Dacj 1-2 cDacj 1-2 c
Dacj 1-2 c
 
Core_Java_Interview.pdf
Core_Java_Interview.pdfCore_Java_Interview.pdf
Core_Java_Interview.pdf
 
Lezione 03 Introduzione a react
Lezione 03   Introduzione a reactLezione 03   Introduzione a react
Lezione 03 Introduzione a react
 
Java architecture for xml binding
Java architecture for xml bindingJava architecture for xml binding
Java architecture for xml binding
 
Intro lift
Intro liftIntro lift
Intro lift
 
Chapter 12:Understanding Server-Side Technologies
Chapter 12:Understanding Server-Side TechnologiesChapter 12:Understanding Server-Side Technologies
Chapter 12:Understanding Server-Side Technologies
 
Objective-C
Objective-CObjective-C
Objective-C
 
Hibernate interview questions
Hibernate interview questionsHibernate interview questions
Hibernate interview questions
 
Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.
 
Java Collection Interview Questions [Updated]
Java Collection Interview Questions [Updated]Java Collection Interview Questions [Updated]
Java Collection Interview Questions [Updated]
 
Java 8 - Features Overview
Java 8 - Features OverviewJava 8 - Features Overview
Java 8 - Features Overview
 
.net Based Component Technologies
.net Based Component Technologies.net Based Component Technologies
.net Based Component Technologies
 
Xml messaging with soap
Xml messaging with soapXml messaging with soap
Xml messaging with soap
 
Xml Messaging With Soap
Xml Messaging With SoapXml Messaging With Soap
Xml Messaging With Soap
 
Xml messaging with soap
Xml messaging with soapXml messaging with soap
Xml messaging with soap
 
Hibernate3 q&a
Hibernate3 q&aHibernate3 q&a
Hibernate3 q&a
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Spring
SpringSpring
Spring
 

Plus de Niit Care (20)

Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
 
Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
 
Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
 
Ajs 2 a
Ajs 2 aAjs 2 a
Ajs 2 a
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 

Dernier

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Dernier (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

Deawsj 7 ppt-1_c

  • 1. Collaborate Knowledge Byte In this section, you will learn about: • JAXB API • SAAJ API ©NIIT Collaborate Lesson 1C / Slide 1 of 23
  • 2. Collaborate JAXB API • Is a Java technology that provides an API and tool that binds an XML schema to a representation in Java code. • Provides the method for unmarshalling and marshalling. • Used for developing an application that can read, manipulate, or recreate XML documents. • Works as an abstraction layer between Java and an XML document because you do not need to know about the XML syntax or XML processing. ©NIIT Collaborate Lesson 1C / Slide 2 of 23
  • 3. Collaborate JAXB API (Contd.) • Working of JAXB • Components used while processing XML document are: • XML Schema • Binding Compiler • Binding Declarations • Binding Implementation Framework • XML Input Document • XML Output Document ©NIIT Collaborate Lesson 1C / Slide 3 of 23
  • 4. Collaborate JAXB API (Contd.) • The following figure shows the working of JAXB API: ©NIIT Collaborate Lesson 1C / Slide 4 of 23
  • 5. Collaborate JAXB API (Contd.) • JAXB API • Is defined in javax.xml.bind package, which contains classes and interfaces for unmarshalling, validating, and marshalling an XML document. • Various classes contained in javax.xml.bind package are: • JAXBContext • Unmarshaller • Validator • Marshaller ©NIIT Collaborate Lesson 1C / Slide 5 of 23
  • 6. Collaborate SAAJ API • Enables you to write SOAP messaging applications. • Is a low-level API that contains methods to exchange messages between the clients and the Web applications. • Enables you to write SOAP messaging applications. ©NIIT Collaborate Lesson 1C / Slide 6 of 23
  • 7. Collaborate SAAJ API (Contd.) • SAAJ API • SAAJ API is defined in the package, javax.xml.soap, which provides the primary abstraction for SOAP messages with attachments. • The table list various interfaces present in the javax.xml.soap package: Interface Description Detail Represents a container to store the DetailEntry objects. DetailEntry Stores information about SOAPFault objects. ©NIIT Collaborate Lesson 1C / Slide 7 of 23
  • 8. Collaborate SAAJ API (Contd.) • The table list various interfaces present in the javax.xml.soap package (Contd.): Interface Description Name Represents an XML name. Node Represents a node element of an XML document. SOAPBody Represents an object that stores the SOAP body element of a SOAP message. SOAPBodyElement Stores information about a SOAPBody object. ©NIIT Collaborate Lesson 1C / Slide 8 of 23
  • 9. Collaborate SAAJ API (Contd.) • The table list various interfaces present in the javax.xml.soap package (Contd.): Interface Description SOAPElement Represents an element of a SOAP message. SOAPHeader Stores information about the header of a SOAP element. Text Represents a node that stores text. ©NIIT Collaborate Lesson 1C / Slide 9 of 23
  • 10. Collaborate SAAJ API (Contd.) • The following table describes the classes present in the javax.xml.soap package: Class Description AttachmentPart Creates an object to attach a single attachment to a SOAPMessage object. MimeHeader Creates an object to store the name of the MIME header and its value. MessageFactory Contains methods to initialize the SOAPMessage objects. SOAPConnection Creates a connection object that represents a point-to-point connection. The objects of this class enable clients to send messages directly to the remote destination. ©NIIT Collaborate Lesson 1C / Slide 10 of 23
  • 11. Collaborate SAAJ API (Contd.) • The following table describes the classes present in the javax.xml.soap package (Contd.): Class Description SOAPMessage Creates an object to store a SOAP message. SOAPException Creates an object that represents a SOAP exception. ©NIIT Collaborate Lesson 1C / Slide 11 of 23
  • 12. Collaborate SAAJ API (Contd.) • The following figure shows the components of SOAPMessage object: ©NIIT Collaborate Lesson 1C / Slide 12 of 23
  • 13. Collaborate From the Expert’s Desk This section will introduce the following: • Best Practices on processing XML documents. • Tips on caching techniques in XSLT to enhance performance. • Tips on development techniques to make XSLT stylesheets manageable. • Tips on techniques to use the import and include statements for combining stylesheets. • FAQs on retrieving status and error information related to SOAP messages. ©NIIT Collaborate Lesson 1C / Slide 13 of 23
  • 14. Collaborate Best Practices Processing XML Documents • You can process XML documents using either SAX or DOM parsers. • Use SAX parser: • To parse large sized XML documents. • When XML document is not nested. • Do not use SAX parser to modify the structure of an XML document. • Use DOM parser: • To parse small sized XML documents. • When you know that the entire document is to be parsed. • When you want to access the particular element in an XML document. ©NIIT Collaborate Lesson 1C / Slide 14 of 23
  • 15. Collaborate Tips Caching Techniques in XSLT to Enhance Performance • You can implement caching by loading transformation information into the object of JAXP’s javax.xml.transform.Templates interface. • You can then use the Templates object to obtain a Transformer object. • You can reuse the Templates object to produce more transformers later and save time on stylesheet parsing and compilation. • The following syntax shows the declaration of Templates object to obtain a Transformer object: Source source_xslt = new StreamSource(xslt_File); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Templates cached_XSLT=transformerFactory.newTemplates(source_xslt); Transformer transformer = cached_XSLT.newTransformer(); ©NIIT Collaborate Lesson 1C / Slide 15 of 23
  • 16. Collaborate Tips (Contd.) Development Techniques to Make XSLT Stylesheets Manageable • Techniques to make XSLT stylesheets easily readable and manageable are: • Using syntax highlighting editor can make the XSLT stylesheets readable. • Adding comment blocks can make XSLT templates descriptive and breaks the repetitiveness of scanning '<' and '>' characters page by page. • Using naming conventions for variables and parameters. • Breaking the functionalities into different stylesheets for reusing the code with the help of <xsl:import> ©NIIT Collaborate Lesson 1C / Slide 16 of 23
  • 17. Collaborate Tips (Contd.) Techniques to Use the Import and Include Statements for Combining Stylesheets • Two methods to combine stylesheets are: • The include mechanism • The import mechanism ©NIIT Collaborate Lesson 1C / Slide 17 of 23
  • 18. Collaborate Tips (Contd.) Techniques to Use the Import and Include Statements for Combining Stylesheets (Contd.) • The include mechanism: • A stylesheet is combined without changing the syntax of the stylesheet. • A stylesheet can include another stylesheet with the help of element, <xsl:include>. • The <xsl:include> element accepts a parameter, href whose value is a URI reference. ©NIIT Collaborate Lesson 1C / Slide 18 of 23
  • 19. Collaborate Tips (Contd.) Techniques to Use the Import and Include Statements for Combining Stylesheets (Contd.) • The import mechanism: • A stylesheet overrides the other stylesheet. • A stylesheet can be imported with the help of the statement, <xsl:import>. • You need to use the statement, <xsl:import> within the CSS file or STYLE element. • The statement, <xsl:import> should occur at the start of the stylesheet. ©NIIT Collaborate Lesson 1C / Slide 19 of 23
  • 20. Collaborate FAQs • How can you retrieve status and error information when a SOAP message does not reach its destination properly? • An object of the SOAPFault class is used to receive status and error information when the message does not reach its destination successfully. • A SOAPFault object is present in the SOAPBody object of the message. • A SOAPFault object informs the end user about a problem, such as an exception object. • A SOAPFault object contains a: • fault code: Represents the code that indicates a problem. • fault string: Represents the fault as a String object. • fault actor: Identifies the source of the fault. • detail object: Represents the fault that occurs because of a SOAPBody object. ©NIIT Collaborate Lesson 1C / Slide 20 of 23
  • 21. Collaborate Challenge 3. Consider the following two statements: Statement A: A registry is a directory provided by a service provider to publish their Web service. Statement B: A registry is a directory provided by a service provider to allow clients to bind with its Web service. Identify the correct option: a. Both statements A and B are true b. Both statements A and B are false c. Statement A is true while statement B is false d. Statement A is false while statement B is true ©NIIT Collaborate Lesson 1C / Slide 21 of 23
  • 22. Collaborate Challenge (Contd.) 2. What does the fault string element of a SOAP message represent? 3. The classes and interfaces of the ____________ package can be used to create and send SOAP messages from a Java application. 4. The ___________ method allows you to parse an XML document using both SAX and DOM parsers. 5. A ___________ document defines a Web service and are used by service providers to publish their Web service in registries. ©NIIT Collaborate Lesson 1C / Slide 22 of 23
  • 23. Collaborate Solution • b. Both statement A and B are false • The fault string element represents an error in the SOAP message • javax.xml.soap • parse() • WSDL ©NIIT Collaborate Lesson 1C / Slide 23 of 23