1 Reply Latest reply on Oct 15, 2007 12:00 AM by Ivascu Cristian

    How to use generated code from "Import Web Services" in mxml client

    aj2008
      Hi,

      I am testing the new "Import Web Services (WSDL)" Data option using the attached WSDL which was generated by xfire. The sample code found in the remarks in the UserService.as file results in athe error: "Could not resolve <srv:getAllUsers_request_var> to a component implementation. test/src test.mxml"

      The mxml code I was using is an exact copy of the sample code:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" xmlns:srv="generated.webservices.*">
      <srv:UserService id="myService">
      <srv:getAllUsers_request_var>
      <srv:GetAllUsers_request />
      </srv:getAllUsers_request_var>
      </srv:UserService>
      <mx:Button id="myButton" label="Call operation" click="myService.getAllUsers_send()" />
      </mx:Application>

      Am I calling the generated code incorrectly or has the .as file generation failed somewhere?

      Thanks,


      Andy.

      WSDL file is below:
        • 1. Re: How to use generated code from &quot;Import Web Services&quot; in mxml client
          Ivascu Cristian Level 1
          Hi,

          The variable that the MXML tag references does not exist in the generated code, because the operation it is involved in (getAllUsers) does not have any input parameters. This is a known bug when generating comments - because we only generate an example for the first operation that is found inside the tree parsed from the wsdl - we generated a full example, including request/result event tags. No actual check is performed to verify that the operation does support it or not.
          In this particular case you can remove the MXML tags that handle defining the request variable, since the operation does not require them.

          We are working on better/ more functional comments on the generated code.

          Hope this helps,
          Cristian