• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Problem consumming ASP.NET service

Guest
Aug 03, 2010 Aug 03, 2010

Copy link to clipboard

Copied

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"?>

<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:service1="

services.service1.*"

  creationComplete="get_Platforms()"

>

  <fx:Script>

    <![CDATA[

      import mx.controls.Alert;

      protected function get_Platforms():void

{

Get_PlatformsResult.token = service1.Get_Platforms();

}

protected function button1_clickHandler(event:MouseEvent):void

{

get_Platforms();

}

]]>

</fx:Script>

<fx:Declarations>

   <s:CallResponder id="Get_PlatformsResult"/>

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

   </fx:Declarations>

<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:columns>

<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"/>

</mx:columns>

</mx:DataGrid>

</s:Application>

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">
  <soap:Body>
    <Get_PlatformsResponse xmlns="http://ssd.org/">
      <Get_PlatformsResult>
        <xs:schema attributeFormDefault="qualified"
          elementFormDefault="qualified" id="DataSet1"
          targetNamespace="http://tempuri.org/DataSet1.xsd"
          xmlns="http://tempuri.org/DataSet1.xsd"
          xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
          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:complexType>
              <xs:choice maxOccurs="unbounded" minOccurs="0">
                <xs:element name="PLTFRM">
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element name="NOBJNM">
                        <xs:simpleType>
                          <xs:restriction base="xs:string">
                            <xs:maxLength value="24"/>
                          </xs:restriction>
                        </xs:simpleType>
                      </xs:element>
                      <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:simpleType>
                          <xs:restriction base="xs:string">
                            <xs:maxLength value="8"/>
                          </xs:restriction>
                        </xs:simpleType>
                      </xs:element>
                      <xs:element minOccurs="0" name="SSTRTP">
                        <xs:simpleType>
                          <xs:restriction base="xs:string">
                            <xs:maxLength value="8"/>
                          </xs:restriction>
                        </xs:simpleType>
                      </xs:element>
                      <xs:element minOccurs="0" name="ORIENT" type="xs:decimal"/>
                      <xs:element minOccurs="0" name="DRVAL1" type="xs:decimal"/>
                    </xs:sequence>
                  </xs:complexType>
                </xs:element>
              </xs:choice>
            </xs:complexType>
            <xs:unique msdata:PrimaryKey="true" name="Constraint1">
              <xs:selector xpath=".//mstns:PLTFRM"/>
              <xs:field xpath="mstns:NOBJNM"/>
            </xs:unique>
          </xs:element>
        </xs:schema>
        <diffgr:diffgram
          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">
              <NOBJNM>HSBH010</NOBJNM>
              <WGSLON>49.97079977105860</WGSLON>
              <WGSLAT>28.21260502368780</WGSLAT>
              <STRTYP>MLS</STRTYP>
              <SSTRTP>N/A</SSTRTP>
              <DRVAL1>46.60</DRVAL1>
            </PLTFRM>
            <PLTFRM diffgr:id="PLTFRM2" msdata:rowOrder="1">
              <NOBJNM>HSBH011</NOBJNM>
              <WGSLON>49.83123349953370</WGSLON>
              <WGSLAT>28.16192967750440</WGSLAT>
              <STRTYP>MLS</STRTYP>
              <SSTRTP>N/A</SSTRTP>
              <DRVAL1>50.30</DRVAL1>
            </PLTFRM>

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 03, 2010 Aug 03, 2010

Copy link to clipboard

Copied

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.

Thanks

-Sunil

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 04, 2010 Aug 04, 2010

Copy link to clipboard

Copied

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

ReturnType.JPG

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 04, 2010 Aug 04, 2010

Copy link to clipboard

Copied

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.

Thanks

-Sunil

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 04, 2010 Aug 04, 2010

Copy link to clipboard

Copied

Hoping I understand you, I now have

<s:CallResponder

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

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

Main/Get_PltformResults_resultHandler->event->[inherited]->result->[inherited]

->Tables->[inherited]->PLTFRM->[inherited]->Rows->[inherited]->length=0

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 04, 2010 Aug 04, 2010

Copy link to clipboard

Copied

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 ()

{

super();

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

}

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

Thanks

-Sunil

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 04, 2010 Aug 04, 2010

Copy link to clipboard

Copied

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

Thanks

-Sunil

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 07, 2010 Aug 07, 2010

Copy link to clipboard

Copied

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.

Thanks

-Sunil


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.

Kev

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 08, 2010 Aug 08, 2010

Copy link to clipboard

Copied

K, will send you an email off list.

Thanks

-Sunil

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 13, 2010 Sep 13, 2010

Copy link to clipboard

Copied

LATEST

Hi,

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

-Radhakrishna

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines