user3648426
user3648426

Reputation: 251

Consuming web service from Adobe FLEX

I am new to FLEX and I want to invoke a service that returns a string object:

    <mx:WebService id = "myService" wsdl = "http://myhost.com/Service1.svc?wsdl">
        <mx:operation name = "opName" resultFormat = "object" />
    </mx:WebService>

What is the syntax to store the string returned by the service in a variable?

Upvotes: 0

Views: 106

Answers (1)

Brian
Brian

Reputation: 3914

Simple, use the result handler:

<mx:WebService ... result="myResultHandler(event)">

public function myResultHandler(e:ResultEvent):void {
    myVar = e.result;
}

See also see: reference1 and reference2

Upvotes: 1

Related Questions