Converting Proxies to Strings
This page describes how an application can stringify a proxy and create a property dictionary that captures all the proxy's properties.
Stringifying a Proxy
You can stringify a proxy by calling toString
on this proxy. For example:
const greeter = new GreeterPrx(communicator, "greeter:tcp -h localhost -p 4061");
const s = greeter.toString();
toString
stringifies non-printable ASCII characters and non-ASCII characters in the proxy's identity, facet and object adapter ID as specified through the Ice.ToStringMode property.
Proxy To Property
You can also perform a deeper proxy stringification by calling proxyToProperty
on your communicator. For example:
const greeter = new GreeterPrx(communicator, "greeter:tcp -h localhost -p 4061");
const propertyDict = communicator.proxyToProperty(greeter,"Greeter");
const greeter = new GreeterPrx(communicator, "greeter:tcp -h localhost -p 4061");
const propertyDict: Map<string,string> propertyDict =
communicator.proxyToProperty(greeter,"Greeter");
The resulting map or dictionary holds all the proxy properties for the supplied proxy. The second parameter of propertyToProxy
is the base name for the properties in the returned map.