Making Service Accessible for FluorineFX

Posted by admin on December 17th, 2007

With FluorineFX you need to add the tag [RemotingServiceAttribute]] to our service class to make it accessible. It means you need a hard reference to FluorineFX in your class.

There’s however a configuration setting to make all services accessible at once:

<!– value=”browse|access” –>

<remotingServiceAttribute>access</remotingServiceAttribute>

<

Sending Arrays instead of ArrayCollections in Fluorine & FluorineFX

Posted by admin on December 17th, 2007

In Fluorine:

<classMappings>

 <classMapping>

  <type><![CDATA[System.Collections.Generic.List<T>]]></type>

  <customClass>Array</customClass>

 </classMapping>

</classMappings>

In FluorineFX:

In services-config.xml

<channels>

 <channel-definition id=my-amf class=mx.messaging.channels.AMFChannel>

  <endpoint uri=http://{server.name}:{server.port}/context.root}/Gateway.aspx class=flex.messaging.endpoints.AMFEndpoint/>

   <properties>

    <legacy-collection>true</legacy-collection>

   </properties>

  </channel-definition>

<!–

<channel-definition id=”my-rtmp” class=”mx.messaging.channels.RTMPChannel”>

<endpoint uri=”rtmp://{server.name}:2037″ class=”flex.messaging.endpoints.RTMPEndpoint”/>

<properties>

<idle-timeout-minutes>20</idle-timeout-minutes>

</properties>

</channel-definition>

–>

</channels>

<

.NET Invocation guide for Flash Remoting clients AS3

Posted by admin on December 17th, 2007

Finding examples with AS2 to do a Remote Call (Fluorine or WebORB) is easy.
However, finding an example for AS3 is very, very hard.
Here's how you do it (thanks to Ward De Langhe):

Actionscript:
  1. private function getGalleryData():void{
  2.  
  3. registerClassAlias("logics.BLL.CollectionEntity",GalleryVO);
  4. registerClassAlias("logics.BLL.GridRowEntity",GalleryRowVO);
  5. registerClassAlias("logics.BLL.PictureEntity",GalleryImageVO);
  6.  
  7. galleryService=new NetConnection();
  8. galleryService.objectEncoding=ObjectEncoding.AMF0;
  9. galleryService.connect(SiteModel.GATEWAY_URL);
  10. //SiteModel.GATEWAY_URL is url path to your gateway
  11. responder=new Responder(galleryResult, galleryFault);
  12. galleryService.call("remoting.service.CollectionService.GetCollection",responder);
  13. }
  14.  
  15. private function galleryResult(result:Object):void{
  16. galleryVO=result as GalleryVO;
  17. }
  18.  
  19. private function galleryFault(fault:Object):void{
  20. }

We haven't been able to figure aout why ObjectEncoding.AMF3 doesn't work.
Well, it works, but in the result the objects are not deserialized, so you just get Objects...

<

XML-Problem Fluorine (SOLVED)

Posted by admin on December 5th, 2007

SOLVED WITH FLUORINEFX VERSION 1.0.0.3!

In Fluorine there seems to be a problem with sending a xml object with null as a value.

Next screenshot is taken from Charles. As you can see there's a property Content which has null as a value. The property Content is typed to XML in Flex.

FluorineXmlProblemCharlesScreenShot

The error I get is:
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at System.Xml.XmlDocument.LoadXml(String xml)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadAMF3XmlDocument()
   at com.TheSilentGroup.Fluorine.AMFReader.ReadAMF3Data(Byte typeCode, IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadAMF3Data(IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadAMF3Object(Int32 handle, IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadAMF3Data(Byte typeCode, IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadAMF3Array(IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadAMF3Data(Byte typeCode, IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadAMF3Data(IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadAMF3Object(Int32 handle, IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadAMF3Data(Byte typeCode, IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadAMF3Array(IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadAMF3Data(Byte typeCode, IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadAMF3Data(IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadAMF3Object(Int32 handle, IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadAMF3Data(Byte typeCode, IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadAMF3Data(IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadData(Int32 typeCode, IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadData(IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadArray(IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadData(Int32 typeCode, IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFReader.ReadData(IApplicationContext applicationContext)
   at com.TheSilentGroup.Fluorine.AMFDeserializer.ReadBody(IApplicationContext applicationContext)

and

Root element is missing.

Screenshot from Charles:

FluorineXmlProblemCharlesScreenShot2

Apparently Fluorine doesn't check whether the value is null. We've looked into the source code of fluorine and indeed a XMLDocument is created with null as a parameter. This throws an exception... With WebOrb this problem does not occur.
I would have to ask if the problem is fixed with FluorineFX.

<

Copyright © 2007 Johlero – Cardoen Lieven. All rights reserved.