In a
distributed computing environment, a message gate may be the message endpoint for a
client or service to communicate with another
client or service. Devices may have a gate factory (e.g. message endpoint constructor) that is trusted code on the device for generating gates based on
XML message descriptions. The use of the gate factory may ensure that the gate it generates is also trusted code, and that the code is correct with respect to a service advertisement. A service advertisement may indicate, for a particular service, a message schema, service URI and
authentication service URI. In one embodiment, the pieces the gate factory needs to construct a gate are the
XML schema of the service and the URI of the service. In another embodiment, an
authentication credential may also be obtained and used in gate construction by running an
authentication service specified in the service advertisement. A gate factory for a device may generate gate code that may incorporate the language, security,
type safety, and / or execution environment characteristics of the local device platform. By constructing gates itself, a device has the ability to ensure that the generated gate code is relatively bug-free, produces only valid data, and provides type-safety.