I am trying to set up a web service that returns stock quote
information.  This is my first experience with web services and I seem
to be stuck on some really simple things.  First of all, I cannot seem
to get the results to display at all when I send the service.  I know
it is being received on their end but I cannot get any information to
display in text boxes or labels.  I also cannot figure out how to add
a header that contains a value for the parameter "Username".

A few notes:

The XML that the getQuote operation returns is:

<ExtendedQuote>
<Outcome>Success</Outcome>
<Identity>IP</Identity>
<Delay>0.0625</Delay>
<Name>MICROSOFT CP</Name>
<Exchange>NASDAQ</Exchange>
<Quote>
<Symbol>MSFT</Symbol>
<Previous_Close>30.09</Previous_Close>
<Open>30.08</Open>
<High>30.14</High>
<Low>29.89</Low>
<Last>29.98</Last>
<Bid>N/A</Bid>
<Bid_Size>N/A</Bid_Size>
<Ask>35.00</Ask>
<Ask_Size>N/A</Ask_Size>
<Percent_Change>-0.37</Percent_Change>
<Change>-0.11</Change>
<Volume>32272086</Volume>
<High_52_Weeks>30.26</High_52_Weeks>
<Low_52_Weeks>21.46</Low_52_Weeks>
<Date>12/21/2006</Date>
<Time>4:00:00 PM</Time>
</Quote>
</ExtendedQuote>

I am also using WebOrb for PHP with other applications in this project
but I am not sure why that would make any difference
(http://www.themidnightcoders.com/weborb/php/index.htm).

Any help with either of these would be greatly appreciated!  Thank you,
-Dan


My code is as follows:

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>

     <mx:Script>
         <![CDATA[
          import mx.controls.Alert;
          import mx.rpc.events.ResultEvent;
          import mx.rpc.events.FaultEvent;
          import mx.rpc.soap.LoadEvent;
         ]]>
     </mx:Script>

     <mx:WebService id="WS"
wsdl="http://www.xignite.com/xQuotes.asmx?WSDL"; useProxy="false"
showBusyCursor="true" fault="Alert.show(event.fault.toString(),'Error')">
         <mx:operation name="GetQuote">
             <mx:request>
                 <Symbol>{stockSymbol.text}</Symbol>
             </mx:request>
         </mx:operation>
     </mx:WebService>

     <mx:Panel title="WebService Example" height="75%" width="75%"
paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">
         <mx:Label width="100%" color="blue" text="Enter a stock
symbol to obtain a quote."/>
         <mx:TextInput id="stockSymbol" text="FDX"/>
         <mx:Button label="Get Quote" click="WS.GetQuote.send()"/>
         <mx:Label text="{WS.GetQuote.result}" fontWeight="bold"
id="stockquote"/>
         <mx:DataGrid id="dataGridStock"
dataProvider="{WS.getQuote.result}">
             <mx:columns>
                 <mx:DataGridColumn headerText="Symbol"
dataField="Symbol"/>
                 <mx:DataGridColumn headerText="Last" dataField="Last"/>
                 <mx:DataGridColumn headerText="Name" dataField="Name"/>
             </mx:columns>
         </mx:DataGrid>
         <mx:Text text="{WS.getQuote.ArrayOfQuote.Quote.Name}"/>
         <mx:Text text="{WS.getQuote.Quote.Last}"/>
         <mx:Text text="{WS.getQuote.Last}"/>
         <mx:Text text="{WS.getQuote.Quote}"/>
         <mx:Text text="{WS.getQuote.ExtendedQuote.Quote.Last}"/>
         <mx:TextInput text="{WS.getQuote.Quote.Last}"/>
         <mx:TextInput text="{WS.getQuote.Last}"/>
         <mx:TextInput text="{WS.getQuote.ExtendedQuote.Quote.Last}"/>
     </mx:Panel>
     
</mx:Application>

Reply via email to