It was missing piece in t he AMFservice constructor,
corrected below

Latcho wrote:
Hi friends,

I'm a bit of a novice when it comes to remoting.
I want to be able to use remoting with weborb-php in AS3 pure sang, fairly compact , without mxml configuation and remaining as functional as possible.

Setting a direct endpoint into the remotingObject amfchannel was quite impossibe due to it beign a getter only and only configurable trough mxmlc,
So I had to set up a channel.
I also had to hack the mx messaging config LoaderConfig's url , otherwise the flex mx.rpc's classes fail, if it remains a null value. (found this hack/tip here: http://bugs.adobe.com/jira/browse/BLZ-16#action_171947 but figgured it can hold any value as long it's not null)

So I did this

  public dynamic class AMFService extends RemoteObject
  {
          ....
mx.messaging.config.LoaderConfig.mx_internal::_url = "notnull";

       public function AMFService(.......)
      (
_amfChannel = new AMFChannel(_destinationChannel,_serviceGateway);
          _amfChannel.connectTimeout = _conectTimeOut;
          _amfChannel.requestTimeout = _requestTimeout;
                    var myChannelSet:ChannelSet = new ChannelSet();
          myChannelSet.addChannel(_amfChannel);
this.channelSet = myChannelSet; this.source = _destinationClass;
           this.destination = _destinationId;

`        }


furthermore this to solve some Typing errors and to get the of Messages wright wright

      static private function registerClassAliases():void
      {
                    /* REGISTERCLASSALIAS()
* Preserves the class (type) of an object when the object is encoded in Action Message Format (AMF). * When you encode an object into AMF, this function saves the alias for its class,
           * so that you can recover the class when decoding the object.
* If the encoding context did not register an alias for an object's class,
           * the object is encoded as an anonymous object.
* Similarly, if the decoding context does not have the same alias registered,
           * an anonymous object is created for the decoded data.
           * */
           registerClassAlias("DSA", AsyncMessageExt);
registerClassAlias("flex.messaging.messages.AsyncMessage", AsyncMessage); registerClassAlias("DSA", AsyncMessageExt);
          registerClassAlias("DSC", CommandMessageExt);
registerClassAlias("flex.messaging.messages.CommandMessage",CommandMessage); registerClassAlias("flex.messaging.messages.RemotingMessage", RemotingMessage); registerClassAlias("DSK", AcknowledgeMessageExt); registerClassAlias("flex.messaging.messages.AcknowledgeMessage", AcknowledgeMessage); registerClassAlias("flex.messaging.messages.ErrorMessage", ErrorMessage); registerClassAlias("flex.messaging.messages.HTTPMessage",HTTPRequestMessage); registerClassAlias("flex.messaging.messages.SOAPMessage", SOAPMessage); registerClassAlias("flex.messaging.messages.MessagePerformanceInfo", MessagePerformanceInfo); registerClassAlias("flex.messaging.io.ArrayList", ArrayList); registerClassAlias("flex.messaging.io.ArrayCollection",ArrayCollection); registerClassAlias("flex.messaging.io.ObjectProxy",ObjectProxy); registerClassAlias("flex.messaging.config.ConfigMap", ConfigMap);
      }


Now my questions:
Is this the best way to keep it tiny and pure AS3 without mxml
Do I drop functionallity here if it comes to remoting (and not to the remote data processing) ? Can this be done in an oher AS3 way without hacking with the mx_internal trick ?
FYI, the filesize of my remoting test is now 86Kb in release mode.

Please help me out of uncertainty :)

Tnx
Latcho
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to