History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: SDK-15041
Type: Bug Bug
Status: Waiting on Info Waiting on Info
Priority: None None
Assignee: Steven Erat
Reporter: __________
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Flex SDK

Response XML from Web Service Not Decoded/Missing from Message

Created: 03/22/08 03:18 PM   Updated: 07/07/08 02:08 PM
Component/s: RPC: WebService
Security Level: Public (All JIRA Users )

Severity: Data Loss/Corruption
Reproducibility: Every Time
Discoverability: High
Found in Version: SDK Flex 3 (Released)
Affected OS(s): Mac - OS 10.4
Steps to Reproduce:
Steps to reproduce:
1. Call a web service that finds matching project names and produces the following SOAP message:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:mb="urn:ProjectService:1.0">
<SOAP-ENV:Body>
<mb:GetProjectNamesResponse>
<projectNameCount>
270
</projectNameCount>
<projectNames>
<name>
Test
</name>
<name>
Test86
</name>
<name>
TestPrj46267
</name>
</projectNames>
</mb:GetProjectNamesResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


 
 Actual Results:
 
[ResultEvent messageId="F91FAE9A-8B3C-3893-CCF1-D814B789097F" type="result" bubbles=false cancelable=true eventPhase=2]

Converting the result to XML produces:

[object Object]

 
 Expected Results:
 
 
 Workaround (if any):
 
 Interestingly, SOAP messages that have arrays of complex types or use the older style array (with "items") syntax work fine. The difference in this failure case is that the array is made up of simple types (string). The only workaround I've found is to respond with complex types (add an unnecessary element to each index in the array):

<name>...</name>

would need to be:

<ProjectName>
    <name>MyProject</name>
    <description>Element used to workaround Flex issue.</description>
</ProjectName>
 
Language Found: English
Bugbase Id: none
QA Owner: Bill Sahlas
Participants: __________, Steven Erat and Svetlin Kalaydjiev
JDK: Sun 1.5.x


 All   Comments      Sort Order:
__________ - [03/22/08 03:21 PM ]
I'd love to help debug this issue, but I am unable to add breakpoints to the Flex framework sources. If you can find a solution to FB-12293 (Flex Framework: source not found), I have no doubt I'd be a lot more helpful.

__________ - [03/22/08 04:07 PM ]
Instead of the result being an XML object as I expected, it actually ends up being Object. This Object then contains an ArrayCollection (projectNames). Now, I'm wondering if it should be an XML object. I can see the reason to decode it into an ArrayCollection, but isn't this also valid XML? When the Object is converted to an XML object, shouldn't it still work as an array of complex types does?

Svetlin Kalaydjiev - [03/27/08 10:47 AM ]
When accessing data from a web service, you have the option to choose resultFormat="object" or resultFormat="e4x" (there's also "xml", which is there for backwards compatibility with Flex 1.x)

"object" is the default resultFormat, which means that your result will be an AS Object (typically an Object, ObjectProxy, Array or ArrayCollection). You can access it through ResultEvent.result or WebService.lastResult. If you set resultFormat to "e4x", the result will be an XML object (XML or XMLList).

It is not clear from your description which resultFormat you are using. Do you prefer to work with XML objects or AS objects? In which case are you seeing incorrect behavior?
It would also help if you could please provide the wsdl of this webservice.

Thanks

__________ - [03/30/08 01:17 AM ]
Svetlin,

I'm using e4x. Unfortunately, the wsdl is not accessible externally at this time (project is not in production).

__________ - [03/30/08 01:25 AM ]
Seems like this situation is a result of optimizations designed to make life easier, but I also feel that access via XML should work. Note that it works for complex types, which do not undergo to optimization into an ArrayCollection. Since I now know that the XML is optimized into an ArrayCollection, this issue is not a blocker for me.

Steven Erat - [07/07/08 02:08 PM ]
Please save and attach the WSDL, the capture from the SOAP Response, and an MXML test case. Thank you.