2 Replies Latest reply on Jul 10, 2008 9:01 AM by all4Flex

    new WebService not working

    all4Flex
      I have a WebService defined in the mxml (see below). I want the <mx:request> to be dynamic (based on user input); the request gets its text from an AS TextInput control. However, it does not work. Any idea what I might be missing? If I hardcode the TextInput text to be 'System-1', it works OK.

      <mx:WebService id="requestStatus_ws" wsdl="..../process/GeneralStatusProcessWS?wsdl"
      fault="requestStatus_fault(event);"
      <mx:operation name="GeneralStatusProcessWS" resultFormat="e4x" result="requestStatus_complete(event);">
      <mx:request format="xml" xmlns:xs="http//www.w3.org/2001/XMLSchema" xmlns="">
      <rootSys>
      <systemId>{requestStatus_input.text}</systemId>
      </rootSys>
      </mx:request>
      </mx:operation>
      </mx:WebService>
      <mx:TextInput id="requestStatus_input" text="Input Request Here"/>

      Also, since the above was not working, I tried to manually build the new WebService (see below). How can I define the 'request' info within the ActionScript, where 'request' contains the user defined info?

      statusWebService = new WebService();
      statusWebService.addEventListener("load", requestStatus_load);
      statusWebService.GeneralStatusProcessWS.resultFormat = "e4x";
      statusWebService.GeneralStatusProcessWS.addEventListener("fault", requestStatus_fault);
      statusWebService.GeneralStatusProcessWS.addEventListener("result", requestStatus_complete);
      statusWebService.GeneralStatusProcessWS.request.format = "xml";
      statusWebService.loadWSDL();

      Thanks in advance...Paul
        • 1. Re: new WebService not working
          ntsiii Level 3
          You can create the request object in AS regardless of you you instantiate the WebService and operation.

          Using your second example, and being certain that the loadWSDL complete event has fired, you could do this, say in a function:

          • 2. Re: new WebService not working
            all4Flex Level 1
            Tracy, I'm not sure what I am really after. I want to pass a user defined piece of data to a WebService (dynamically). I finally did get it to work by removing the mx:request's format="xml" part. I'll try your recommendation in a bit. thank you very much for your reply.
            Paul