Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7701939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:06:48+00:00 2026-05-31T23:06:48+00:00

I have some problem with calling web service from flex. I have service with

  • 0

I have some problem with calling web service from flex. I have service with name UserService with one method string GetData(int i). I want to call this method from flex and get data. My code is here:

                    protected function application1_creationCompleteHandler(event:FlexEvent):void
        {
            uService = new UserService();
            uService.addEventListener("hello", echoResultHandler);
            uService.GetData(1);                            
        }

        public function echoResultHandler(event:ResultEvent):void { 
            var retStr:String = event.result as String;                 
            var retInt:int = event.result.echoInt; 
            Alert.show('want to play', retStr);
        } 

Might be my question is not difficult, but I can’t understand why it does’t works.. Can anybody help me?

Service code, generated by flex when I added reference to servese.

    internal class _Super_UserService extends com.adobe.fiber.services.wrapper.WebServiceWrapper
{


    public function _Super_UserService()
    {

        _serviceControl = new mx.rpc.soap.mxml.WebService();
        var operations:Object = new Object();
        var operation:mx.rpc.soap.mxml.Operation;

        operation = new mx.rpc.soap.mxml.Operation(null, "GetData");
         operation.resultType = String;
        operations["GetData"] = operation;

        _serviceControl.operations = operations;
        try
        {
            _serviceControl.convertResultHandler = com.adobe.serializers.utility.TypeUtility.convertResultHandler;
        }
        catch (e: Error)
        {  }


        preInitializeService();
        model_internal::initialize();
    }

    protected function preInitializeService():void
    {


        _serviceControl.service = "UserService";
        _serviceControl.port = "BasicHttpBinding_IUserService";
        wsdl = "http://localhost:3905/UserService.svc?wsdl";
        model_internal::loadWSDLIfNecessary();
    }

    public function GetData(value:int) : mx.rpc.AsyncToken
    {
        model_internal::loadWSDLIfNecessary();
        var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("GetData");
        var _internal_token:mx.rpc.AsyncToken = _internal_operation.send(value) ;
        return _internal_token;
    }

}

Inherited class:

public class UserService extends _Super_UserService
{

    protected override function preInitializeService():void
    {
       super.preInitializeService();
       // Initialization customization goes here
    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:06:49+00:00Added an answer on May 31, 2026 at 11:06 pm

    Your UserService class never dispatches an event named “hello”; so therefore your result handler will never be fired. I think you need to add a result handler to the ASynctoken.

    var call : Asynctoken =  uService.GetData(1);   
    call.addResponder( new AsyncResponder(echoResultHandler) );
    

    more info on the AsyncResponder and AsyncToken

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I am calling some web service method that I do not control.
Problem: We have a web app that calls some web services asynchronously (from the
I have an iOS app that is calling a web service for some XML
I have a problem regarding xml calling to REST web service, I have to
I have some interesting problem for an hour.. In my flex project, all width
Here's my problem. I have a middleware web service used by several web clients.
I have a problem with message driven EJB. I have too applications Web Service
I have an ASP.NET web application that presents data retrieved from a web service.
I have a web service that I am calling and their published WSDL doesn't
I have a singleton class to download some data from the web. I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.