Home Help Center

Ruby: Passing stringified proxies to web clients

PeteHPeteH Member Peter HugOrganization: Warehouse Optimization LLCProject: APAL
I want to basically URL encode some sringified proxy, pass it to the web client and then when it is returned, turn this back into a proxy.

IOW, I want to do this (NOTE: the variable ice is the ice communicator):

strID = ice.proxyToString(objData);
objDataClone = ice.stringToProxy(strID);
puts objData
puts objClone
objData.foo()
objDataClone.foo()

The two puts statements produce identical output. Yet, objDat.foo() works as expected but objDataClone.foo() produces:
test.rb:128: undefined method 'foo' for #<Ice::ObjectPrx:0x34272e1> NoMethodError

What am I missing? Also, I'm not sure if this entire approach is good practise or not.

Comments

  • PeteHPeteH Member Peter HugOrganization: Warehouse Optimization LLCProject: APAL
    Oops, I can answer the first question myself: I need to cast the returned proxy into a proxy of the appropriate type.

    Still, is it a good idea to pass stringified proxies to web clients and turning them back into proxies in subsequent requests to the server?
Sign In or Register to comment.