Hi Friends

I am sending a sample flex example that will send parameters to a webservice
methods

STEP 1) visit the webservice
 link http://www.webservicex.net/CurrencyConvertor.asmx?wsdl

STEP 2)search for operation in this file <wsdl:operation
name="ConversionRate"> this is the method and you people will find
parameters to send

i.e
<wsdl:part name="FromCurrency" type="s:string"/>
<wsdl:part name="ToCurrency" type="s:string"/>

now follow the flex example code below

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="vertical">

<mx:Script>
    <![CDATA[
        import mx.rpc.events.ResultEvent;

        private function resultSuc(eve:ResultEvent):void{
            lb2.text=eve.result.toString();
        }
    ]]>
</mx:Script>
    <mx:WebService id="webapp"
    wsdl="http://www.webservicex.net/CurrencyConvertor.asmx?wsdl";
    showBusyCursor="true">
        <mx:operation name="ConversionRate" result="resultSuc(event)">
        <mx:request>
            <FromCurrency>
                {one.text}
            </FromCurrency>
            <ToCurrency>
                {two.text}
            </ToCurrency>
        </mx:request>
        </mx:operation>
    </mx:WebService>
        <mx:Panel layout="absolute" x="38" y="27" height="233" width="328">
                <mx:Form width="279" height="183" x="19">

                        <mx:FormItem label="FromCurrency" height="28"
width="213">
                                <mx:TextArea id="one" height="28"
width="118"/>
                        </mx:FormItem>
                        <mx:FormItem label="ToCurrency" height="28"
width="214">
                                <mx:TextArea id="two" height="28"
width="119"/>
                        </mx:FormItem>

                </mx:Form>
       <mx:Button x="61" y="106" label="Button" width="90" height="32"
           click="webapp.getOperation('ConversionRate').send()"/>

        </mx:Panel>
        <mx:TextArea id="lb2" width="319" height="172" x="115" y="286"
backgroundColor="white"/>
</mx:Application>




i think it is useful to you
and you people work with as many as webservices and all the sample
webservices are available at www.webservicex.net

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to