Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
Adobe Flex SDK 4.1 (Release)
-
None
-
None
-
Affected OS(s): All OS Platforms
Affected OS(s): All OS Platforms
Language Found: English
Description
Steps to reproduce:
1. Create a WCF service with an operation that returns a System.Data.DataSet object.
2. Using Flex Builder's "Connect to Web Service...", generate the client classes for the service, pointing to the WSDL of the new service.
3. Create and run an application that instantiates the service class, and tries to invoke service methods.
Actual Results:
An exception is thrown when the service class is instantiated. This happens when the internal web service code tries to load the WSDL, and fails (probably model_internal::loadWSDLIfNecessary() ). The SchemaLoader tries to access the namespace attribute of each <xsd:import> element, without first checking whether the attribute exists.
There is no way to catch this exception, because it happens in a callback that is not exposed to customization.
ReferenceError: Error #1065: Variable @namespace is not defined.
at mx.rpc.xml::SchemaLoader/schemaImports()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\xml\SchemaLoader.as:107]
at mx.rpc.wsdl::WSDLLoader/schemaImports()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\wsdl\WSDLLoader.as:273]
at mx.rpc.wsdl::WSDLLoader/resultHandler()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\wsdl\WSDLLoader.as:167]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at HTTPOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\http\HTTPService.as:989]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:318]
at mx.rpc::Responder/result()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:56]
at mx.rpc::AsyncRequest/acknowledge()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:84]
at DirectHTTPMessageResponder/completeHandler()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:446]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
Expected Results:
In any case, an exception should not be thrown where it is impossible for the client to catch it. Ideally, we should be able to decide if and when the WSDL is requested - doing it as part of the service class construction is surprising behavior, and seems like bad design.
If the Flex Builder "Test Operation" window can test the service successfully, which it can, then there should be a way to use that service successfully from code. Currently, this is not the case.
Workaround (if any):
Notes:
We know it is bad practice to use the .NET DataSet class to expose data through a web service. But sometimes we have no choice in the matter as the service client.