JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Java CAPS XSLT Service Engine Tutorial     Java CAPS Documentation
search filter icon
search icon

Document Information

XSLT Designer: Simple Transformation Tutorial

Overview

Configuring the Tutorial Environment

Creating the XSLT Module Project

To Create a New XSLT Module Project

Creating XML Schemas

To Create the XML Schema for the Incoming Message

To Create the XML Schema for the Outgoing Message

Creating a WSDL File

To Create a WSDL File

Creating an XSLT Service

To Create an XSLT Service

To Populate the XSL Stylesheet

Creating and Deploying the Composite Application

To Create a Composite Application Project

To Add a JBI Module

To Deploy the HelloXSLTCAP Composite Application

Performing a Test Run of the XSL Transformation Service

To Create a Test Case

To Test the Application:

Performing a Test Run of the XSL Transformation Service

Testing an XSL Transformation Service means sending a message that the Service is expecting and receiving, in this case, a reply message.

Before we can perform the testing, we must create a test case.

To Create a Test Case

  1. In the Projects window, expand the HelloXSLTCAP node and right-click the Test node.
  2. From the popup menu, select New Test Case.
  3. In the Test Case Name field, type JohnSmith. Click Next.
  4. Under Select the WSDL Document, expand HelloXSLTransformation - XSLT Process Files and select HelloXSLTWSDL.wsdl. Click Next.
  5. Under Select the Operation to Test, expand HelloXSLTWSDLBinding and select HelloXSLTWSDLOperation. Click Finish.
  6. The JohnSmith node appears under HelloXSLTCAP > Test and the input message file—Input.xml—opens in the editor.
    image:Input Message
  7. In the Input.xml file, modify the
     <hel:name>?string?</hel:name>

    line to

     <hel:name>John Smith</hel:name>

    The Input.xml file should be:

     <soapenv:Envelope xsi:schemaLocation=
    "http://schemas.xmlsoap.org/soap/envelope/ http://schemas.xmlsoap.org/
    soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv=
    "http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:hel="http://xml.netbeans.org/schema/HelloXSLTIncoming">
    
            <soapenv:Body>
    
                    <hel:name>John Smith</hel:name>
    
            </soapenv:Body>
    
    </soapenv:Envelope> 
    
                    
  8. Click the Save All button on the toolbar.

    The Output node under the test case node refers to the expected reply message that is used for comparison with the actual reply messages. Before we run the test for the first time, the Output.xml file is empty. The first test run will populate Output.xml with the real output. Subsequent test runs will compare the real output against the content of Output.xml

To Test the Application:

  1. Right-click the JohnSmith node and select Run. Notice that the test fails and the following dialog box appears:
    image:Overwrite Dialog
  2. Click Yes. Notice that the failed test node appears below the Output node.
    image:Failed Test Node
  3. Double-click the failed test node to see the message that the XSL Transformation Service sent back:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/
    XMLSchema-instance" xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/ 
    http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://xml.netbeans.org/
    schema/HelloXSLTOutgoing">
    
            <SOAP-ENV:Header/>
    
            <SOAP-ENV:Body>
    
                    <ns:greeting xmlns:ns="http://xml.netbeans.org/schema/
    HelloXSLTOutgoing">Hello John Smith</ns:greeting>
    
            </SOAP-ENV:Body>
    
    </SOAP-ENV:Envelope>

    Notice the line

     <ns:greeting xmlns:ns="http://xml.netbeans.org/schema/HelloXSLTOutgoing">Hello John Smith</ns:greeting> 
    
                    

    The XSL Transformation Service received the name, concatenated it with the string 'Hello' and sent the reply message.

  4. Run the test again. The test is marked as passed.
    image:Test Passed

    You have successfully created, deployed and tested an XSL Transformation Service.

    Now that you have successfully created the Request-Reply XSL Transformation Service, continue with the Service Bridge type.