0

I have an application that connects to an AMF gateway exclusively (in a certain mode) and I have a service that renders some HTML that I want to display in a new window outside of the Flex application.

Is it possible, in Flex, to use navigateToURL to send an AMF object and open the response in a new window?

EDIT: More specifically, does anyone have insight into how an AMF request can be properly constructed in actionscript and sent via the POST data of a URLRequest?

UPDATE: Still looking for a clear spec for AMF that makes it obvious how to construct the service call related headers in AMF and what headers are required. Some guidance in this area would be helpful. I've done more reading and have seen some people talk about some custom solutions they have that work in a similar way to what I've mentioned above, although it seems like those solutions are guarded assets. But this further enforces my belief that this is quite possible.

Resist Design
  • 4,462
  • 3
  • 22
  • 35

2 Answers2

0

I'd say no... Even if you could create an AMF packet by hand in AS3, how would you pass it to the URL using navigateToURL? How would the browser know how to handle the AMF values returned from your service call?

I suggest you call the AMF gateway service in your Flash app; do the processing that needs done; and then return a URL to the results. In the result handler method, you can open the URL using navigateToURL.

JeffryHouser
  • 39,401
  • 4
  • 38
  • 59
  • The goal is to not store the results on the server. As far as the browser parsing AMF from the response, this won't be necessary, the service is able to respond in HTML. I guess the biggest thing here is how to setup the data on the URLRequest that gets passed to navigateToURL. – Resist Design Apr 10 '12 at 22:10
  • What server are you using that it will provide an HTML/Plain Text response to an AMF Request? – JeffryHouser Apr 10 '12 at 22:43
  • AMFPHP, you just have to echo and exit() in your service! ;) – Resist Design Apr 10 '12 at 23:22
  • And maybe set your header content type too. – Resist Design Apr 10 '12 at 23:25
  • @ResistDesign One of us is mistaken how AMF Gateways work. I would have expected that if you make an AMF call to the server, it would provide an AMF Binary Response Back. If you make an HTTPService Call to the server, it would provide an HTTP Call back. you're saying the AMF call is returning a text/ASCII value. That is not the way I understand it working. The binary format may be transparent to you because the Flash Player automatically decodes/encodes the AMF calls when using RemoteObject. – JeffryHouser Apr 11 '12 at 01:02
  • No, AMFPHP works with the PHP buffer output which you can interrupt in any way you want. What any server returns does not have to be dependent on what it receives. – Resist Design Apr 12 '12 at 03:17
0

@Flextras is along the right lines - the AMF gateway in particular with AMFPHP isn't used with a URLRequest, instead you use the RPC remoting - most typically RemoteObject where you specify the receiving gateway (ie: endpoint or more generically the destination channel - but this one needs to be in your services-config which resides on the server), and you typically assign a responder to handle the result/failure events (in which your response is almost always a class marked as a [RemoteAlias]).

See: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/rpc/remoting/mxml/RemoteObject.html#includeExamplesSummary

Mike Petty
  • 949
  • 6
  • 6
  • In AMFPHP there are a series of actions that take place when a request is made. First the RAW POST data is decoded from AMF to PHP objects. Then the AMF headers are read to see what Class/Service and method to call. The return value of that method is then encoded back into AMF and added to the output buffer. At the point where the Class method is called you can override the buffer by printing/echoing whatever you want, then override the header content-type and then call the PHP exit() method to send your content and end the execution session so as to bypass AMFPHP's response actions. – Resist Design Apr 12 '12 at 03:33