1 Reply Latest reply on Jun 13, 2008 7:05 AM by jrunrandy

    new Webservice in ActionScript

    all4Flex
      I am using FB3 and have mxml that reads
      <mx:TextInput id="status_input"/>
      <mx:WebService id="status_ws" wsdl=" http://localhost:2580/process/StatusWS?wsdl" fault="fault(event);">
      <mx:operation name="StatusWS" resultFormat="e4x" result="results(event);">
      <mx:request format="xml" xmlns:xs="http//www.w3.org/2001/XMLSchema" xmlns="">
      <rootSys>
      <systemId>{status_input.text}</systemId>
      </rootSys>
      </mx:request>
      </mx:operation>
      </mx:WebService>

      Based on button selection, the TextInput control (id="status_input") is populated and should be passed to the <systemId> tag. I check on the WebService side and the field is blank - the XML reads: <rootSys></systemId></rootSys>

      I've researched the Internet and all say this should work. Alas, it does not.

      As a result, I tried to create a new WebService via ActionScript so I can populate the tag. Here is the block of code to do that. I researched and can't see how to set the XML and attribute in AS. I can set the wsdl based on a setting, I can't figure out how to set the systemID attribute.
      statusWebService = new WebService();
      statusWebService.port = "StatusWSPort"; is this the port# or a text field?
      statusWebService.service = "StatusWSService";
      statusWebService.wsdl = settings.status.@wsdl;
      statusWebService.addEventListener("fault", fault);
      statusWebService.GeneralStatusProcessWS.addEventListener("result", results);
      statusWebService.GeneralStatusProcessWS.resultFormat = "e4x";
      statusWebService.GeneralStatusProcessWS.request.format = "xml";
      statusWebService.GeneralStatusProcessWS.request.systemId = "NOT WORKING
      statusWebService.loadWSDL();

      Basically I have a few questions:
      1. mxml: How come my TextInput control (id="status_input") does not populate the WebService properly?
      2. AS: how can I manually build a new WebService and populate the necessary fields (mx:results and the necessary tag (<systemId>))?
      3. AS: in the script code, what is it looking for for port number? text or numeric?

      thank you in advance

      pauls