Remote object call from module with different context

[Bindable]protected var service:mx.rpc.remoting.RemoteObject;           

[Bindable]

private var urlReq:String=URLUtil.getServerNameWithPort(FlexGlobals.topLevelApplication.url) + ‘/’;

[Bindable]
private var urlProtocol:String=URLUtil.getProtocol(FlexGlobals.topLevelApplication.url) + ‘://’;

private function setRPCService(destination:String):void
        {

                 service = new RemoteObject();
                  service.destination = destination ;

                   //service.endpoint

                   service.endpoint= urlProtocol+urlReq+context+’/messagebroker/amf’;

                  //for ex: urlProtocol+urlReq+’homecare/messagebroker/amf’; where homecare is context

                   service.makeObjectsBindable=true;
          }

 

setRPCService(delegate name );               

service.showBusyCursor = true;
 if(service!=null)
  {
         var rpcCall:AsyncToken;
         rpcCall = service.methodname(request parameter);
         rpcCall.addResponder(new mx.rpc.Responder(ResultHandler, FaultHandler));
    }

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: