General Interface is an open source project hosted by the Dojo Foundation

Testing Mappings

The XML Mapping Utility includes features for verifying inbound and outbound messages generated using a rules file. The entire test sequence consists of executing outbound mappings, generating the outbound message, sending the message, receiving the response, and executing inbound mappings. Outbound and inbound filtering logic can also be entered and verified.

To test the address example, complete these steps:

  1. Simulate user input by manually typing a valid 5-digit or 9-digit zip code in the Type Zip Code field in the work area. For example, type 11357 in the Type Zip Code field.
  2. Select the LicenseKey input rule in the Rules Tree panel in the XML Mapping Utility. Confirm that you selected Script as the Type and entered setValue("0") in the Path/Value column of the Mappings table. If you haven't, refer to the instructions in Defining Mappings.
    Click here to expand screenshot...


  3. Click the Test button on the XML Mapping Utility toolbar to open the Test Interface Tool.
  4. Select ReturnCityState from the drop-down list at upper left.
  5. Before testing the mappings, insert breakpoints for viewing request and response messages at each step in the process.
    1. Click the Send tab and click the Pause Before Sending the Message button to insert a breakpoint.
    2. Click the Apply tab and click the Pause Before Executing Inbound Mappings button next to the Inbound Mapping header to insert a breakpoint.
  6. Click the Create tab. The Outbound Mappings panel lists the bound request parameters and mapping information.
    Click here to expand screenshot...


  7. Click the Start Test button next to the Outbound Mappings header to begin testing the mappings. When the message is generated, the message displays in the Send tab.
    Click here to expand screenshot...


  8. Verify the message matches the following:
    <SOAP-ENV:Envelope
          xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
          xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <SOAP-ENV:Body>
    
            <jsx1:ReturnCityState
               xmlns:jsx1="http://ws.cdyne.com/"><jsx1:zipcode>11357
               </jsx1:zipcode><jsx1:LicenseKey>0</jsx1:LicenseKey>
            </jsx1:ReturnCityState>
          </SOAP-ENV:Body>
       </SOAP-ENV:Envelope>

    The zip code you specified in the dialog should display as the contents of the jsx1:zipcode element. For example,

    <jsx1:zipcode>11357</jsx1:zipcode>

    If the message code is incorrect, return to the XML Mapping Utility and verify that bindings are correctly specified before proceeding.

  9. Click the Resume Test (Send Message) button next to the URL field. The outbound message is sent to the web service. When a response is received, the message displays in the Receive tab and the XML Mapping Utility automatically advances to the Apply tab.
  10. Click the Receive tab to view the inbound message. City and state information is returned in the City and StateAbbrev elements. However, this data has not yet been bound to any text boxes. If you view the application in the work area, the City and State fields are still blank.
    Click here to expand screenshot...


  11. Click the Apply tab. The Test Interface displays inbound mappings to text boxes.
    Click here to expand screenshot...


  12. Click the Resume (Execute Inbound Mappings) button next to the Inbound Mappings header. In the work area, you can see that inbound mappings are applied to text boxes. The City and State fields have a blue background because the fields are disabled. This is to prevent users from entering data in these fields.
    Click here to expand screenshot...


    The testing cycle for this data service configuration is complete, and the XML Mapping Utility cycles back to the Create tab.

This concludes the tutorial. For other examples of connecting to web services, see samples in workspace/JSXAPPS/samples and on the Developer Network at http://www.generalinterface.org.

Contents

Searching General Interface Docs

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.