1 Reply Latest reply on Oct 17, 2008 8:18 AM by okgivemeanickname

    Problem about Webservice

    okgivemeanickname
      Hallo,

      I have two problems when i using web service in flex. The Web service is wrote with Java, and deployed in JBoss, i used Webservice Explorer to test it, no problem about Web service.

      =1=

      I used Flex Builder 3 to import the .wsdl, and use generated proxy classes to access Webservice functions.

      When the Java classes are in a same package, no problem. But when they are in different package, (so they have different namespace in QName, i think), i cannot read the data from the Object. (the values are always null)

      =2=

      Another Problem is, when i call call a function, and read the result with XXX_lastResult. It can not be immediate accessed. So I must make one button to run the webservice function, and the other button to read the result, and the user must click them one by one. if i write them in one function (or two functions but be called together with one click), it not work!

      Thank you.
        • 1. Re: Problem about Webservice
          okgivemeanickname Level 1
          thanks, this is my scripts:

          [Bindable]
          private var ws:WSInterfaceService = new WSInterfaceService();

          ...

          public function showDocs():void
          {
          // Webservice function call
          ws.getDocs();

          //set the result to a dataProvider in runtime, its not work! but if direct use the bindable link in <mx:DataGrid>, then no such problem.
          //dg.dataProvider = ws.getDocs_lastResult;
          }

          ...

          <mx:DataGrid width="100%" id="dg" dataProvider="{ws.getDocs_lastResult}">
          <mx:columns>
          <mx:DataGridColumn dataField="name" headerText="Name"/>
          <mx:DataGridColumn dataField="size" headerText="Size"/>
          <mx:DataGridColumn dataField="changedDate" headerText="Changed Date"/>
          <mx:DataGridColumn labelFunction="showURL" headerText="URL"/>
          </mx:columns>
          </mx:DataGrid>

          ...

          <mx:ControlBar horizontalAlign="center">
          <mx:Button label="Get date from server" click="showDocs()"/>

          ...