---
title: "Converting Proxies to Strings"
url: https://docs.zeroc.com/ice/3.8/runtime/invocation/converting-proxies-to-strings
language: cpp
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# Converting Proxies to Strings

Programming language: C++. Other languages: [C#](https://docs.zeroc.com/ice/3.8/runtime/invocation/converting-proxies-to-strings/csharp.md), [Java](https://docs.zeroc.com/ice/3.8/runtime/invocation/converting-proxies-to-strings/java.md), [JavaScript](https://docs.zeroc.com/ice/3.8/runtime/invocation/converting-proxies-to-strings/js.md), [MATLAB](https://docs.zeroc.com/ice/3.8/runtime/invocation/converting-proxies-to-strings/matlab.md), [PHP](https://docs.zeroc.com/ice/3.8/runtime/invocation/converting-proxies-to-strings/php.md), [Python](https://docs.zeroc.com/ice/3.8/runtime/invocation/converting-proxies-to-strings/python.md), [Ruby](https://docs.zeroc.com/ice/3.8/runtime/invocation/converting-proxies-to-strings/ruby.md), [Swift](https://docs.zeroc.com/ice/3.8/runtime/invocation/converting-proxies-to-strings/swift.md).

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 `ice_toString` on this proxy. For example:

```cpp
GreeterPrx greeter{communicator, "greeter:tcp -h localhost -p 4061"};
std::string s = greeter.ice_toString();
```

`ice_toString` stringifies non-printable ASCII characters and non-ASCII characters in the proxy's identity, facet and adapter ID as specified through the [Ice.ToStringMode](https://docs.zeroc.com/ice/3.8/property-reference/ice-properties/cpp.md#ice.tostringmode) property.

## Proxy to Property

You can also perform a deeper proxy stringification by calling `proxyToProperty` on your communicator. For example:

```cpp
GreeterPrx greeter{communicator, "greeter:tcp -h localhost -p 4061"};
Ice::PropertyDict propertyMap =
    communicator->proxyToProperty(greeter, "Greeter");
```

The resulting map or dictionary holds all the [proxy properties](https://docs.zeroc.com/ice/3.8/property-reference/proxy-properties/cpp.md) for the supplied proxy, except its [Context](https://docs.zeroc.com/ice/3.8/property-reference/proxy-properties/cpp.md#name.context.key) properties. The second parameter of `proxyToProperty` is the base name for the [properties](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-overview/cpp.md) in the returned map.

## See Also

- [Obtaining Proxies](https://docs.zeroc.com/ice/3.8/runtime/invocation/creating-proxies/cpp.md)
- [Proxy and Endpoint Syntax](https://docs.zeroc.com/ice/3.8/runtime/endpoint-syntax/cpp.md)
- [Proxy Properties](https://docs.zeroc.com/ice/3.8/property-reference/proxy-properties/cpp.md)
