3 Replies Latest reply on Jul 3, 2007 4:33 AM by mujahidzain

    How to fetch table data from SAP Webservice in Flex

    Thenmalar
      Hi to all,
      I find difficulty in fetching table data in SAP Webservice I want to display the data in to my Combo control which gets data from table TQualification. How do i do that. my wsdl path is:
      http://entegdt21:8000/sap/bc/srt/rfc/sap/ZMasterWS?wsdl i don't know whether my code is correct or not.

      My code is

      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" width="1500" height="1600" x="6" y="103" creationComplete="doNewSearch()">

      <mx:Script>
      <![CDATA[

      import mx.rpc.soap.mxml.WebService;
      import mx.events.ItemClickEvent;
      import mx.rpc.events.ResultEvent;
      import mx.managers.CursorManager;
      import mx.controls.Alert;
      import mx.collections.*;


      default xml namespace = "https://entegdt21.enteg.com";
      [Bindable]private var _xmlResult:XML; //holds the result xml
      [Bindable]private var _xlData:XMLList; //dataProvider for the day weather dataGrid
      [Bindable]private var _sPlace:String;
      [Bindable]
      public var stateArray:ArrayCollection;

      private function doNewSearch():void {
      CursorManager.setBusyCursor();
      WES2.ZhrFunApplicantMasterdata.send();


      }
      private function onResult(oEvent:ResultEvent):void
      {

      _xmlResult = XML(oEvent.result);

      var xmlResultNode:XML = _xmlResult.TQualification;
      _xlData = xmlResultNode.Stext;
      } //onResult
      ]]>

      </mx:Script>




      <mx:WebService id="WES2" destination="masterws" useProxy="true" fault="Alert.show(event.fault.faultString) , 'Error'" result="onResult(event)" >
      <mx:operation name="ZhrFunApplicantMasterdata" resultFormat="e4x" >
      <mx:request>
      <RCINS>
      {int(empid.text)}
      </RCINS>
      </mx:request>
      </mx:operation>

      </mx:WebService>

      <mx:ComboBox dataProvider="{_xlData}" width="112"></mx:ComboBox>
      ......
      i couldn't get the data in to my combo control .If any one brings with the solution it would be more helpful to me.

      Thank u.

      regards,
      Malar

        • 1. Re: How to fetch table data from SAP Webservice in Flex
          ntsiii Level 3
          First, in onResult(), after:
          _xmlResult = XML(oEvent.result);
          Add this:
          trace(xmlResult .toXMLString())

          Do you see your webservice xml?
          Tracy
          • 2. Re: How to fetch table data from SAP Webservice in Flex
            Thenmalar Level 1
            Hi,
            Yes Now i'm able to fetch the Back End data through my webservice.
            My previous code like this ...
            _xmlResult = XML(oEvent.result);

            var xmlResultNode:XML = _xmlResult.TQualification;
            _xlData = xmlResultNode.Stext;


            Now the Code Must be

            private function onResult(oEvent:ResultEvent):void
            {

            _xmlResult = XML(oEvent.result);


            // var xmlResultNode:XML = _xmlResult.TQualification[0];

            //Alert.show("Result"+xmlResultNode.toXMLString());
            //var xmlDetailsNode:XML = xmlResultNode.Stext;

            _xlDataSpecial =_xmlResult.TSpeciallisation.item.Atext;
            _xlDataQualif=_xmlResult.TQualification.item.Stext;
            _xlDataSkill=_xmlResult.TSkill.item.Zqtest;
            _xlDataProfi=_xmlResult.TProficency.item.Pstext;
            _xlDataIndustry=_xmlResult.TIndustry.item.Brtxt;
            _xlDataDesig=_xmlResult.TDesignation.item.Ltext;
            _xlDataPostn=_xmlResult.TPosition.item.Plstx;
            _xlDataAdv=_xmlResult.TAdvertisement.item.Iname;



            Alert.show("value:"+_xlDataSpecial.toString());
            CursorManager.removeBusyCursor();

            } //onResult


            The Problem Has been Solved Now

            But now i get some different error Like

            Error #1096: XML parser failure: Unterminated element.


            i used Two webservices in my Mxml file

            i don't know where the problem is.........
            y such kind of problem comes/....

            Could u plz help me out.


            Thank u.

            Regards,
            Thenmalar
            • 3. Re: How to fetch table data from SAP Webservice in Flex
              mujahidzain
              hi there

              i am also getting the same error any update on this one can u mail me.

              regards