Please post the code for the ValueObject. Or a link to the code. Thanks, -Alex
On 8/15/16, 12:05 PM, "CodeGirl" <[email protected]> wrote: >I have some small images in .jpg format. >After some reading, I concluded my files were small enough to store in the >database but I was told to make the type varbinary(max) No problem so >far > >When I created my Entities JPA wanted to make it a byte[]. Seems no >problem. > >I defined my DTO object byte[] No Problem. > >In FlashBuilder, I use the WSDL Wizard to creat my service stuff as usual. > >I noticed it created the ValueObject with a ByteArray type. > >Here is my result handler > > protected function > getImagesResult_resultHandler(event:ResultEvent):void > { > dataList = new ArrayCollection(); > if (event.result != null) > { > if (event.result is ArrayCollection) > { > dataList = getImagesResult.lastResult; > } > else > { > dataList.addItem(toDTO(event.result)); > } > } > } > > public static function toDTO(o:Object):ImageDTO > { > var thisDTO:ImageDTO = new ImageDTO(); > thisDTO.id = o.id; > thisDTO.name = o.name; > thisDTO.width = o.width; > thisDTO.length = o.length; > thisDTO.height = o.height; > thisDTO.sideid = o.sideid; > thisDTO.pic = o.pic; > return thisDTO; > } > > >But when I run my app and I call getImages() > >I get this error: > >ReferenceError: Error #1065: Variable ByteArray is not defined. > at global/flash.utils::getDefinitionByName() > at >com.adobe.serializers.utility::TypeUtility$/assignProperty()[C:\depot\flex >\ide_trunk\ide_builder\com.adobe.flexbuilder.dcrad\serializers\src\com\ado >be\serializers\utility\TypeUtility.as:593] > at >com.adobe.serializers.utility::TypeUtility$/convertToStrongType()[C:\depot >\flex\ide_trunk\ide_builder\com.adobe.flexbuilder.dcrad\serializers\src\co >m\adobe\serializers\utility\TypeUtility.as:562] > at >com.adobe.serializers.utility::TypeUtility$/convertListToStrongType()[C:\d >epot\flex\ide_trunk\ide_builder\com.adobe.flexbuilder.dcrad\serializers\sr >c\com\adobe\serializers\utility\TypeUtility.as:518] > at >com.adobe.serializers.utility::TypeUtility$/convertResultHandler()[C:\depo >t\flex\ide_trunk\ide_builder\com.adobe.flexbuilder.dcrad\serializers\src\c >om\adobe\serializers\utility\TypeUtility.as:431] > at >mx.rpc.soap::Operation/http://www.adobe.com/2006/flex/mx/internal::process >Result()[E:\dev\4.5.1\frameworks\projects\rpc\src\mx\rpc\soap\Operation.as >:953] > at >mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::result >Handler()[E:\dev\4.5.1\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker. >as:313] > at >mx.rpc::Responder/result()[E:\dev\4.5.1\frameworks\projects\rpc\src\mx\rpc >\Responder.as:56] > at >mx.rpc::AsyncRequest/acknowledge()[E:\dev\4.5.1\frameworks\projects\rpc\sr >c\mx\rpc\AsyncRequest.as:84] > at >DirectHTTPMessageResponder/completeHandler()[E:\dev\4.5.1\frameworks\proje >cts\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:451] > at flash.events::EventDispatcher/dispatchEventFunction() > at flash.events::EventDispatcher/dispatchEvent() > at flash.net::URLLoader/onComplete() > > >Evidently, This is a bug in FlashBuilder. > >So since I am using SOAP and Flashbuilder to create my service and >valueObjects. > >How should I do images? Or is there a workaround to this problem? > > > >-- >View this message in context: >http://apache-flex-users.2333346.n4.nabble.com/jpg-images-via-SOAP-webserv >ice-using-SQL-Server-as-DB-tp13300.html >Sent from the Apache Flex Users mailing list archive at Nabble.com.
