You need to set up some <mx:operation> items inside your <mx:webservice> and
then you call serviceName.operationName.send() to actually make the request.
Here's a pointless example I have lying around (a test case from a bug
report, so it's not a very nice example):

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

    <mx:WebService fault="faulted(event)" load="loaded(event)" id="service"
result="resulted(event)">
        <mx:operation name="initiate"/>
    </mx:WebService>

    <mx:Script>
        <![CDATA[
            import mx.rpc.events.ResultEvent;
            import mx.rpc.soap.mxml.Operation;
            import flash.utils.getQualifiedClassName;
            import mx.rpc.soap.LoadEvent;
            import mx.controls.Alert;
            import mx.rpc.events.FaultEvent;

            public const wsdl : String = "
http://127.0.0.1:8777/mockVehicleOutOfRepairBinding?WSDL&interface=VehicleOutOfRepairBinding&part=VehicleOutOfRepair.wsdl
";

            [Bindable]
            public var isLoaded : Boolean = false;

            public function faulted(event : FaultEvent) : void {

                Alert.show(event.toString(), "Fault!");
            }

            public function loadStuff() : void {

                trace("Loading");
                service.loadWSDL(wsdl);
            }

            public function loaded(event : LoadEvent) : void {

                trace("Loaded!");
                isLoaded = true;
            }

            public function doStuff() : void {

                trace("DoingStuff");
                service.initiate.arguments = { payload : { disposableVehicle
: { status : "IN_REPAIR",

     federatedVehicleGUID : "8757865875",

     description : "Vehicle description",

     registration : "ABC-123" },

lotNoAndParkingBayId : { parkingBayId : 10,

            tenderId : 10 }}};
                service.initiate.send();
            }

            public function resulted(event : ResultEvent) : void {

                trace("Result : " + event.result);
            }

        ]]>
    </mx:Script>

    <mx:Button verticalCenter="0" horizontalCenter="-100" label="Load"
click="loadStuff()" width="80" height="40" enabled="{ !isLoaded }"/>
    <mx:Button verticalCenter="0" horizontalCenter="100" label="Initiate"
click="doStuff()" width="80" height="40" enabled="{ isLoaded }"/>

</mx:Application>


-Josh

On Wed, Jun 18, 2008 at 2:36 AM, gnuwolf <[EMAIL PROTECTED]> wrote:

>    Hi guys,
>
>
>
> I have these settings and code.
>
>
>
>
>
> proxy-config.xml:
>
>
>
> <destination id="ws-netsuite">
>
>         <properties>
>
>             <wsdl>
> https://webservices.netsuite.com/wsdl/v2008_1_0/netsuite.wsdl</wsdl>
>
>             <soap>*</soap>
>
>         </properties>
>
>         <adapter ref="soap-proxy"/>
>
>     </destination>
>
>
>
>
>
> MXML:
>
>
>
> <?xml version="1.0" encoding="utf-8"?>
>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute
> ">
>
>
>
> <mx:WebService id="srv" destination="ws-netsuite" useProxy="true"
> showBusyCursor="true"/>
>
>
>
>       <mx:Text x="212" y="206" text="Username"/>
>
>       <mx:TextInput x="289" y="204" id="username"/>
>
>       <mx:Text x="212" y="236" text="Password"/>
>
>       <mx:TextInput x="289" y="234" id="password" displayAsPassword="true"
> />
>
>
>
>       <mx:Button label="Login" click="srv.login()" x="289" y="264"/>
>
>
>
> </mx:Application>
>
>
>
>    - Ignore the other stuff, my problem is just related to the click event
>    handler.
>
>
>
> Problem is that whenever I click the button, nothing happens. I mean it
> should trigger a web services request…
>
>
>
> Right now, I'm not setting a parameter for the login operation so it should
> throw an error in the SOAP response.
>
>
>
> I was just testing the connectivity.
>
>
>
> Any kind of help will be appreciated. Thank you.
>
>
>  
>



-- 
"Therefore, send not to know For whom the bell tolls. It tolls for thee."

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]

Reply via email to