-
1. Re: How to get amf headers?
sn1ckers Dec 3, 2009 4:09 AM (in response to sn1ckers)I solved it at posting my findings here.
To get the header I had to send in a Object to the client parameter on NetConnection like the code below:
public class UsingNetConnectionWithHeader
{
public function UsingNetConnectionWithHeader
{
netCon = new NetConnection();
netCon.addEventListener(NetStatusEvent.NET_STATUS, connectionHandler);
netCon.connect(remotingGateway);
netCon.client = new CustomClient();
netCon.call("Method", new Responder(successfulResult, erroneousResult),param1,param2...);
}
public function connectionHandler(ev:NetStatusEvent):void
{
if(ev.info.code == "NetConnection.Call.Failed")
{
trace("Call failed");
}}
public function successfulResult(obj:Object):void
{
trace("Call Successful");
}function erroneousResult(obj:Object):void
{
trace("Call Failed");
}}
public class CustomClient
{
public function CustomHeader(content:String):void
{
trace("Got header with content:" + content);
}
}
To get this to work the custom header name must be CustomHeader.
