8 Replies Latest reply on May 9, 2010 12:07 AM by Radhakrishna Bhat

    WebService databinding not proper

    Maico5

      Hi,

       

      I'm totally new to Flashbuilder so bare with me.

       

      It seems this is not working properly. If the webservice returns more than one field the results will not display in a datagrid, its blank. If I change the webservice to only return one field that field does display properly.

       

       

      Below is the result of the web service I'm calling as shown in the test panel of Flash Builder. Does this look ok?

       

      Thanks.

       

       

       

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

      <SOAP-ENV:Envelope

        SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"

        xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"

        xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

        xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

        <SOAP-ENV:Body>

          <ns1:WebService_LocatorResponse xmlns:ns1="http://www.4d.com/namespace/default">

            <CustomerName href="#ref-1"/>

            <Address href="#ref-2"/>

            <City href="#ref-3"/>

            <State href="#ref-4"/>

            <Zip href="#ref-5"/>

            <Phone href="#ref-6"/>

            <Miles href="#ref-7"/>

            <SalesYTD href="#ref-8"/>

          </ns1:WebService_LocatorResponse>

          <SOAP-ENC:Array SOAP-ENC:arrayType="xsd:string[10]" id="ref-1">

            <item1>Happy Hearts Day Care, Inc.</item1>

            <item2>Marlette Community Schools</item2>

            <item3>Noel's Ark</item3>

            <item4>Angie's Wiggles &amp; Giggles Dayc</item4>

            <item5>Norma Sayers</item5>

            <item6>Over the Rainbow Day Care</item6>

            <item7>Countryside Daycare</item7>

            <item8>Wee Walk In</item8>

            <item9>Tamara Auld</item9>

            <item10>Angeleah Lynch</item10>

          </SOAP-ENC:Array>

          <SOAP-ENC:Array SOAP-ENC:arrayType="xsd:string[10]" id="ref-2">

            <item1>3073 Main Street</item1>

            <item2>3197 Sterling Street</item2>

            <item3>6824 Clifford Rd</item3>

            <item4>1585 East Dayton Road</item4>

            <item5>538 Meadow Drive</item5>

            <item6>8053 Gosline Rd</item6>

            <item7>3633 Densmore Rd</item7>

            <item8/>

            <item9>8301 South Sheridan Road</item9>

            <item10>4014 Skelton Road</item10>

          </SOAP-ENC:Array>

          <SOAP-ENC:Array SOAP-ENC:arrayType="xsd:string[10]" id="ref-3">

            <item1>Marlette</item1>

            <item2>Marlette</item2>

            <item3>Marlette</item3>

            <item4>Caro</item4>

            <item5>Caro</item5>

            <item6>Marlette</item6>

            <item7>Caro</item7>

            <item8>Brown City</item8>

            <item9>Millington</item9>

            <item10>Columbiaville</item10>

          </SOAP-ENC:Array>

          <SOAP-ENC:Array SOAP-ENC:arrayType="xsd:string[10]" id="ref-4">

            <item1>MI</item1>

            <item2>MI</item2>

            <item3>MI</item3>

            <item4>MI</item4>

            <item5>MI</item5>

            <item6>MI</item6>

            <item7>MI</item7>

            <item8>MI</item8>

            <item9>MI</item9>

            <item10>MI</item10>

          </SOAP-ENC:Array>

          <SOAP-ENC:Array SOAP-ENC:arrayType="xsd:string[10]" id="ref-5">

            <item1>48453</item1>

            <item2>48453</item2>

            <item3>48453</item3>

            <item4>48723</item4>

            <item5>48723</item5>

            <item6>48453</item6>

            <item7>48723</item7>

            <item8>48416</item8>

            <item9>48746</item9>

            <item10>48421</item10>

          </SOAP-ENC:Array>

          <SOAP-ENC:Array SOAP-ENC:arrayType="xsd:string[10]" id="ref-6">

            <item1>989-635-2626</item1>

            <item2>989-635-4925</item2>

            <item3>989-635-7884</item3>

            <item4>989-673-8815</item4>

            <item5>989-673-7446</item5>

            <item6>989-635-6670</item6>

            <item7>989-673-1364</item7>

            <item8>810-346-3686</item8>

            <item9>989-871-4447</item9>

            <item10>810-793-0356</item10>

          </SOAP-ENC:Array>

          <SOAP-ENC:Array SOAP-ENC:arrayType="xsd:float[10]" id="ref-7">

            <item1>7.74994045</item1>

            <item2>8.078687892</item2>

            <item3>9.062562736</item3>

            <item4>10.408472294</item4>

            <item5>12.439067148</item5>

            <item6>12.539467388</item6>

            <item7>15.191403538</item7>

            <item8>16.508578674</item8>

            <item9>16.969271668</item9>

            <item10>19.527102388</item10>

          </SOAP-ENC:Array>

          <SOAP-ENC:Array SOAP-ENC:arrayType="xsd:float[10]" id="ref-8">

            <item1>0</item1>

            <item2>0</item2>

            <item3>0</item3>

            <item4>0</item4>

            <item5>39.99</item5>

            <item6>0</item6>

            <item7>0</item7>

            <item8>0</item8>

            <item9>0</item9>

            <item10>0</item10>

          </SOAP-ENC:Array>

        </SOAP-ENV:Body>

      </SOAP-ENV:Envelope>

        • 1. Re: WebService databinding not proper
          Anand Gaurav Level 1

          Would it be possible for you to send the WSDL if available for this.

           

          >

          >  If I change the webservice to only  return one field that field does  display properly.

          >

           

          I would be interested to know the response for which it worked; because I tried with one field but it didn't. May be I didn't what you meant by "returning one field".

           

           

          Regards,

          Anand Gaurav.

          • 2. Re: WebService databinding not proper
            Maico5 Level 1

            Hi Anand,

             

            Thanks so much for the reply.  Here is the WSDL.

             

            ?xml version="1.0" encoding="UTF-8" ?>
            <!-- this WSDL file was automatically generated by 4D -->
            <definitions name="A_WebService" targetNamespace="http://www.4d.com/namespace/default" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.4d.com/namespace/default" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <types><schema targetNamespace="http://www.4d.com/namespace/default"               xmlns="http://www.w3.org/2001/XMLSchema"               xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
            <complexType name="ArrayOfstring" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">               <complexContent>                    <restriction base="SOAP-ENC:Array">                         <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]"/>                    </restriction>               </complexContent>          </complexType>
            </schema>                                              </types>
                 <message name="WebService_GetCustomersRequest">
                      <part name="inSizeOfArray" type="xsd:int"/>
                 </message>
                 <message name="WebService_LocatorRequest">
                 </message>
                 <message name="WebService_GetCustomersResponse">
                      <part name="CustomerName" type="tns:ArrayOfstring"/>
                      <part name="CustomerNumber" type="tns:ArrayOfstring"/>
                      <part name="Zipcode" type="tns:ArrayOfstring"/>
                 </message>
                 <message name="WebService_LocatorResponse">
                      <part name="CustomerName" type="xsd:string"/>
                      <part name="Address" type="xsd:string"/>
                      <part name="City" type="xsd:string"/>
                      <part name="State" type="xsd:string"/>
                      <part name="Zip" type="xsd:string"/>
                      <part name="Phone" type="xsd:string"/>
                      <part name="Miles" type="xsd:float"/>
                      <part name="SalesYTD" type="xsd:float"/>
                 </message>
                 <portType name="A_WebServiceRPC">
                      <operation name="WebService_GetCustomers">
                           <input message="tns:WebService_GetCustomersRequest"/>
                           <output message="tns:WebService_GetCustomersResponse"/>
                      </operation>
                      <operation name="WebService_Locator">
                           <input message="tns:WebService_LocatorRequest"/>
                           <output message="tns:WebService_LocatorResponse"/>
                      </operation>
                 </portType>
                 <binding name="A_WebServiceBinding" type="tns:A_WebServiceRPC">
            <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
                      <operation name="WebService_GetCustomers">
            <documentation>no documentation is available</documentation>
                           <soap:operation soapAction="A_WebService#WebService_GetCustomers"/>
                           <input>
                                <soap:body use="encoded" namespace="http://www.4d.com/namespace/default" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                           </input>
                           <output>
                                <soap:body use="encoded" namespace="http://www.4d.com/namespace/default" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                           </output>
                      </operation>
                      <operation name="WebService_Locator">
            <documentation>no documentation is available</documentation>
                           <soap:operation soapAction="A_WebService#WebService_Locator"/>
                           <input>
                                <soap:body use="encoded" namespace="http://www.4d.com/namespace/default" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                           </input>
                           <output>
                                <soap:body use="encoded" namespace="http://www.4d.com/namespace/default" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                           </output>
                      </operation>
                 </binding>
                 <service name="A_WebService">
                      <documentation></documentation>
                      <port name="A_WebServicePort" binding="tns:A_WebServiceBinding">
                           <soap:address location="http://localhost:8090/4DSOAP/"/>
                      </port>
                 </service>
            </definitions>
            

            • 3. Re: WebService databinding not proper
              Maico5 Level 1

              Hi Anand,

               

              What I meant by only returning on field was that if I modify the web service to only return the CustomerName and leave all the other field out it seems to work.  Thanks again.

               

              Darwin

              • 4. Re: WebService databinding not proper
                Anand Gaurav Level 1

                So you mean something like this ?

                 

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

                <SOAP-ENV:Envelope

                   SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"

                   xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"

                   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

                   xmlns:xsd="http://www.w3.org/2001/XMLSchema"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

                   <SOAP-ENV:Body>

                     <ns1:WebService_LocatorResponse xmlns:ns1="http://www.4d.com/namespace/default">

                       <CustomerName href="#ref-1"/>

                     </ns1:WebService_LocatorResponse>

                    <SOAP-ENC:Array  SOAP-ENC:arrayType="xsd:string[10]" id="ref-1">

                       <item1>Happy Hearts Day Care, Inc.</item1>

                       <item2>Marlette Community Schools</item2>

                       <item3>Noel's Ark</item3>

                      <item4>Angie's  Wiggles &amp; Giggles Dayc</item4>

                       <item5>Norma Sayers</item5>

                      <item6>Over  the Rainbow Day Care</item6>

                      <item7>Countryside  Daycare</item7>

                      <item8>Wee Walk In</item8>

                       <item9>Tamara Auld</item9>

                       <item10>Angeleah Lynch</item10>

                     </SOAP-ENC:Array>

                   </SOAP-ENV:Body>

                </SOAP-ENV:Envelope>

                 

                Regards,

                Anand Gaurav

                • 5. Re: WebService databinding not proper
                  Maico5 Level 1

                  Well, I thought so but I just tried again and cannot get it to work.

                  I tried so many things to try and get it to work I don't know what finally did work.

                  Sorry.

                   

                   

                  Darwin

                  • 6. Re: WebService databinding not proper
                    FlexualHealing

                    Hi,

                     

                     

                    Below is the result of the web service I'm calling as shown in the test panel of Flash Builder. Does this look ok?

                     

                    ...

                     

                    What do you mean by "test" panel?  If you have been able to populate a value in the DataGrid atleast once with the web service, the data side of things is probably ok.

                     

                    Can you post the code from the Flash Builder side of things?

                    • 7. Re: WebService databinding not proper
                      Maico5 Level 1

                      Hi,

                       

                      Thanks for the reply. By test panel I mean, in Flash Builder go to the Window->Other views->Flash Builder and take Test Operation. You get a panel where you can test your Service. You can view it in Tree view or Raw view.

                       

                      Here is the code.

                       

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

                      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                         xmlns:s="library://ns.adobe.com/flex/spark"

                         xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:locator="services.locator.*">

                      <fx:Script>

                      <![CDATA[

                      import mx.controls.Alert;

                      import mx.events.FlexEvent;

                       

                      protected function dataGrid_creationCompleteHandler(event:Event):void

                      {

                      WebService_LocatorResult.token = locator.WebService_Locator();

                      }

                       

                      ]]>

                      </fx:Script>

                      <fx:Declarations>

                      <s:CallResponder id="WebService_LocatorResult"/>

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

                      <!-- Place non-visual elements (e.g., services, value objects) here -->

                      </fx:Declarations>

                      <mx:DataGrid x="95" y="92" id="dataGrid" creationComplete="dataGrid_creationCompleteHandler(event)" dataProvider="{WebService_LocatorResult.lastResult}">

                      <mx:columns>

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

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

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

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

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

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

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

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

                      </mx:columns>

                      </mx:DataGrid>

                      </s:Application>

                      • 8. Re: WebService databinding not proper
                        Radhakrishna Bhat Level 3

                        Hi,

                         

                        I have logged a bug under SDK for this issue. https://bugs.adobe.com/jira/browse/SDK-26410

                         

                        -Radhakrishna