Code I

<table border="0" width="600" align="center">
   <tr>
      <td colspan="2">
         <h3>News Headlines - Coldfusion MX Example</h3>
         <hr />
      </td>
      </tr>
      <tr>
         <td>
            Enter Topic
         </td>
         <td>
            <form name="formTopicSubmit" 
               action="#CGI.SCRIPT_NAME#" method="post">
               <input name="sTopic" 
                  value="#sTopic#" 
                  width="50" 
                  maxlength="254">
               <input type="submit" name="tSubmitted" value="Submit">
            </form>
         </td>
      </tr>
</table>

Code II

 <cfif isdefined("form.sTopic") and form.sTopic GT "">
   <cfset sTopic = form.sTopic />
   <cftry>

      <cfinvoke 
         webservice="http://www.xmlme.com/WSCustNews.asmx?WSDL"
         method="getCustomNews"
         returnvariable="aString">
         <cfinvokeargument name="topic" value="#sTopic#"/>
      </cfinvoke>
      <cfset MyXml = XmlParse(aString) />
      <cfset xRoot = MyXml.Xmlroot>
      <cfset bNode = xRoot.XmlName>
      <cfset cNode = xRoot.XmlChildren[1].XmlName>
      <cfset myNewsFeed = XMLSearch(MyXml, "/#bNode#/#cNode#")>
      <cfset xCount = arraylen(myNewsFeed)>

   <cfcatch>
      <cfset xCount = 0>
   </cfcatch>
   </cftry>
</cfif>

Code III
 
<cfif xCount>
   <table border="0" width="600" align="center">
      <cfloop from="1" to="#arrayLen(myNewsFeed)#" index="i">
      <cfoutput>
         <tr>
            <td colspan="2" bgcolor="##66FFFF">
               <font>#myNewsFeed[i].headline_text.xmltext#</font>
            </td>
         </tr>
         <tr>
            <td>
               <font style="font-weight:bold">Source: </font>
               <font>#myNewsFeed[i].source.xmltext#</font>
            </td>
            <td>
               <font style="font-weight:bold">Date/Time: </font>
               <font>#myNewsFeed[i].harvest_time.xmltext#</font>
            </td>
         </tr>
         <tr>
            <td colspan="2">
               <font>
               <a href="#myNewsFeed[i].url.xmltext#" target="_blank">
               Click Here To Read Story</a>
               </font>
               <hr />
               <br />
            </td>
         </tr>
      </cfoutput>
      </cfloop>
   </table>

Code IV
 
<cfelseif isdefined("form.tSubmitted") and trim(sTopic) is not "">
   <table border="0" width="600" align="center">
      <tr>
         <td align="center">
            <font style="font-weight:bold">
            No Information Available For Topic Submitted<br />
            Or unable to connect to Web Service.<br />
            Please try again.
            </font>
         </td>
      </tr>
   </table>
</cfif>