9 Replies Latest reply on Sep 13, 2010 7:51 AM by Radhakrishna Bhat

    Problem consumming ASP.NET service


      Im using data services wizards to link to a web service - I follow the same procedure as the 'one hour application' example.

      All appears to go well, the service reads the WSDL and comes back with the method. Service package is auto generated.

      Then I auto generate the valueObjects. I bind my datagrid to the repeating data and the column names resond with my data names.


      BUT when I run it theres no errors and no binding.

      Network Monitor shows the data responding as expected.


      ANY IDEAS??


      Generated code below:


      <?xml version="1.0" encoding="utf-8"?>









      955" minHeight="600"










            import mx.controls.Alert;



            protected function get_Platforms():void


      Get_PlatformsResult.token = service1.Get_Platforms();





      protected function button1_clickHandler(event:MouseEvent):void












         <s:CallResponder id="Get_PlatformsResult"/>


         <service1:Service1 id="service1" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>






      <s:Button x="10" y="10" label="Button" click="button1_clickHandler(event)"/>



      <mx:DataGrid x="10" y="39" width="656" height="281" id="dataGrid" dataProvider="{Get_PlatformsResult.lastResult.Tables.PLTFRM.Rows}">




      <mx:DataGridColumn headerText="NOBJNM" dataField="NOBJNM"/>


      <mx:DataGridColumn headerText="WGSLON" dataField="WGSLON"/>


      <mx:DataGridColumn headerText="WGSLAT" dataField="WGSLAT"/>


      <mx:DataGridColumn headerText="STRTYP" dataField="STRTYP"/>


      <mx:DataGridColumn headerText="SSTRTP" dataField="SSTRTP"/>


      <mx:DataGridColumn headerText="DRVAL1" dataField="DRVAL1"/>







      Truncated XML: from test Operation raw view below:-

      <?xml version="1.0" encoding="UTF-8"?>
      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
          <Get_PlatformsResponse xmlns="http://ssd.org/">
              <xs:schema attributeFormDefault="qualified"
                elementFormDefault="qualified" id="DataSet1"
                xmlns:mstns="http://tempuri.org/DataSet1.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
                <xs:element msdata:IsDataSet="true"
                  msdata:UseCurrentLocale="true" name="DataSet1">
                    <xs:choice maxOccurs="unbounded" minOccurs="0">
                      <xs:element name="PLTFRM">
                            <xs:element name="NOBJNM">
                                <xs:restriction base="xs:string">
                                  <xs:maxLength value="24"/>
                            <xs:element minOccurs="0" name="WGSLON" type="xs:decimal"/>
                            <xs:element minOccurs="0" name="WGSLAT" type="xs:decimal"/>
                            <xs:element minOccurs="0" name="STRTYP">
                                <xs:restriction base="xs:string">
                                  <xs:maxLength value="8"/>
                            <xs:element minOccurs="0" name="SSTRTP">
                                <xs:restriction base="xs:string">
                                  <xs:maxLength value="8"/>
                            <xs:element minOccurs="0" name="ORIENT" type="xs:decimal"/>
                            <xs:element minOccurs="0" name="DRVAL1" type="xs:decimal"/>
                  <xs:unique msdata:PrimaryKey="true" name="Constraint1">
                    <xs:selector xpath=".//mstns:PLTFRM"/>
                    <xs:field xpath="mstns:NOBJNM"/>
                xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
                <DataSet1 xmlns="http://tempuri.org/DataSet1.xsd">
                  <PLTFRM diffgr:id="PLTFRM1" msdata:rowOrder="0">
                  <PLTFRM diffgr:id="PLTFRM2" msdata:rowOrder="1">

        • 1. Re: Problem consumming ASP.NET service
          SunilAdobe Adobe Employee

          Are you sure the data provider for your datagrid "Get_PlatformsResult.lastResult.Tables.PLTFRM.Rows" is correct. If lastResult or Tables or PLTFRM is an array then you might have to access it using the array index. For example if Tables is an array that is being returned you might have to have something like this Get_PlatformsResult.lastResult.Tables[0].PLTFRM.Rows as the dataprovider.


          Just to know whether you are getting data back, can you do a test operation available in the Data / service panel on the corresponding webservice method.




          • 2. Re: Problem consumming ASP.NET service
            klgklg Level 1

            I don't think this is the problem,  but I tried using [] in the data provider in every pos comination. It gave me the following compilation error:-

            Data binding will not be able to detect changes when using square bracket operator. For Array, please use ArrayCollection.getItemAt() instead.


            The incoming data looks good I had run the test before but heres the outputTestResults.JPG


            Also heres the output when I autogenerate the return type



            I really appreciate the help tho. I'm supposed to give a recommendation for this software to my management and ease of connection to our existing web services is a must.


            Cheers Kev

            • 3. Re: Problem consumming ASP.NET service
              SunilAdobe Adobe Employee

              Ok, I guess converting the data to value objects might be an issue.

              Can you just do this, put a result handler for the call responder get_platformsResult. (You can do this by typing result in that tag, it should automatically generate a handler)


              In that handler can you put a break point and see what event.result is. If it does not have data then there is some issue while converting to value objects.

              If that is the issue, then you can attach a sample project that demonstrates this issue and we can suggest a workaround and fix the bug if any.




              1 person found this helpful
              • 4. Re: Problem consumming ASP.NET service
                klgklg Level 1

                Hoping I understand you, I now have



                id="Get_PlatformsResult" result="Get_PlatformsResult_resultHandler(event)"/>


                I put a break point on the handler and then drill down the values




                Am I looking at the right thing?

                Seems I have an array of Rows with a length of zero = no data?

                But then why does the test show OK?

                OR is the problem in the object.values?


                Cheers Kev


                • 5. Re: Problem consumming ASP.NET service
                  SunilAdobe Adobe Employee

                  Yes, the problem is converting the data to value objects. It would be really helpful if you can attach a sample project with this issue for us to debug.


                  As a workaround:


                  If you notice in the generated super[service name].as, there is a _serviceControl.convertResultHandler assignment, which converts the result to the value objects. You can override the constructor in the derived file (not starting with super) something like this.


                  public function ()



                            _serviceControl.convertResultHandler = null; //  or have your result handler.



                  By the way the convertResultHandler functionality is not supported in Flex SDK less than 3.5.




                  • 6. Re: Problem consumming ASP.NET service
                    SunilAdobe Adobe Employee

                    Filed http://bugs.adobe.com/jira/browse/FB-27280 for you to track, pls. attach the faulty project, it will be real useful.




                    • 7. Re: Problem consumming ASP.NET service
                      klgklg Level 1

                      SunilAdobe wrote:


                      Filed http://bugs.adobe.com/jira/browse/FB-27280 for you to track, pls. attach the faulty project, it will be real useful.




                      OK Thanks,

                      but how do i attach the project - I dont see an attach file on my interface.

                      OR drop me your email to gibsonkl@aramco.com.sa and I email the files to you.



                      • 8. Re: Problem consumming ASP.NET service
                        SunilAdobe Adobe Employee

                        K, will send you an email off list.




                        • 9. Re: Problem consumming ASP.NET service
                          Radhakrishna Bhat Level 3



                          Thanks for sending project and WSDL response. Can you please also send us the WSDL?

                          You can either attach it here or send it to -   rbhat@adobe.com