XML
  Home arrow XML arrow Page 2 - Send Part of an XForms Instance to a Web S...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
XML

Send Part of an XForms Instance to a Web Service
By: developerWorks
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 4
    2004-11-02

    Table of Contents:
  • Send Part of an XForms Instance to a Web Service
  • Structuring the form
  • Creating the submission
  • Resources

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Send Part of an XForms Instance to a Web Service - Structuring the form


    (Page 2 of 4 )

    The goal of this project is to create a form that submits a SOAP message and then retrieves the SOAP response and displays the result. To do that, you need to add a submission trigger button and the ability to read the returned data, as shown in Listing 3:

    Listing 3. Adding the rest of the form itself

    ...
              </data>

             </xforms:instance>

          </xforms:model>

    <xforms:switch id="switch1">
      <xforms:case id="requestGUI">

          <xforms:select1 appearance="minimal"
                          ref="instance('weatherInstance')//zipcode">
             <xforms:label>Choose Employee</xforms:label>
             <xforms:itemset nodeset="instance('weatherInstance')//emp">
               <xforms:label ref="name"/>
               <xforms:value ref="zip"/>
             </xforms:itemset>
          </xforms:select1>

          <xforms:trigger style="display:block">
            <xforms:label>Get sensor ambient temperature</xforms:label>
            <xforms:action ev:event="DOMActivate">
               <xforms:send submission="getweather" />
               <xforms:toggle case="responseGUI" />
            </xforms:action>
         </xforms:trigger>

       </xforms:case>

       <xforms:case id="responseGUI">

           <xforms:output ref="instance('weatherInstance')//return">
              <xforms:label>Employee local temperature:</xforms:label>
           </xforms:output>

       </xforms:case>
    </xforms:switch>

    </body>
    </html>

    Here you separate the form into two cases because the instance that provides data for the controls will be different before and after submission. You start with the first case, which includes the employee data control and a trigger button. When the user clicks the trigger, the browser sends the getweather submission (which you'll create next) and changes to the responseGUI case, which will look for data in the new structure. Once in the responseGUI case, the browser displays the temperature, which is in the return element.

    Now you just have to create the actual submission.

    IBM developerWorksVisit developerWorks for thousands of developer articles, tutorials, and resources related to open standard technologies, IBM products, and more. See developerWorks.

    More XML Articles
    More By developerWorks


     

    XML ARTICLES

    - Using Regions with XSL Formatting Objects
    - Using XSL Formatting Objects
    - More Schematron Features
    - Schematron Patterns and Validation
    - Using Schematron
    - Datatypes and More in RELAX NG
    - Providing Options in RELAX NG
    - An Introduction to RELAX NG
    - Path, Predicates, and XQuery
    - Using Predicates with XQuery
    - Navigating Input Documents Using Paths
    - XML Basics
    - Introduction to XPath
    - Simple Web Syndication with RSS 2.0
    - Java UI Design with an IDE







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek