Highlighted

handling result ciontaining xml nodes from c# web service method call in flex

Avatar

Avatar

99Dev

Avatar

99Dev

99Dev

09-05-2008

I have read a article headed: Handling results as XML with
the e4x result format

Using this I have build a test application.But facing lot of
problems.



Here are the details of my code.I have used first example of
using namespace.



private namespace tempNamespace = "TEST1.WebServices";

use namespace tempNamespace;



I have specified result type as 'e4x' :



<mx:WebService id="myTestService" showBusyCursor="true"

wsdl="
http://localhost/TEST/TestFlexWS.asmx?WSDL"
useProxy="false">

<mx:operation name="HelloWorldEx" resultFormat="e4x"
result="Hello_Result_New(event);"
fault="Hello_fault_New(event);">

<mx:request>

<strProductName>Test</strProductName>

</mx:request>

</mx:operation>

</mx:WebService>



In result handler:



o/p of myTestService.HelloWorldEx.lastResult is:



<HelloWorldExResponse xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns="TEST1.WebServices" xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/">

<HelloWorldExResult>&lt;PRODUCTCOLLECTION&gt;

&lt;PRODUCT&gt;

&lt;PRODUCTNAME&gt;Test Product
121&lt;/PRODUCTNAME&gt;


&lt;/PRODUCT&gt;&lt;/PRODUCTCOLLECTION&gt;</HelloWorldExResult>

<TestResult></TestResult>

</HelloWorldExResponse>



When I display alert for :

Alert.show(
myTestService.HelloWorldEx.lastResult.HelloWorldExResult);



It's showing me result as:

<PRODUCTCOLLECTION>

<PRODUCT>

<PRODUCTNAME>NEW DAM</PRODUCTNAME>

</PRODUCT>

</PRODUCTCOLLECTION>



But when I display alert for inner node it doesn't show me
anything:

Alert.show(
myTestService.HelloWorldEx.lastResult.HelloWorldExResult.PRODUCTCOLLECTION.PRODUCT.PRODUCTNAME);



Can anybody help me out?

It will be gr8 help for me.