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

How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 

Dernier (20)

How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 

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