When creating a stream of metadata about an STSendpoing, its easy to formulate the address component of the reference. There is lots of sample code on that.
But how does one - in WIF 3.5 Microsoft.identity library - attach the Metadata component?
Its relevant to the world of dotNet.45 I&A tool and svcutil, which produce better bindings for clients/services when the metadata for the reference exposed. One sees this done in practice in ACS's metadata document, for example.
<fed:SecurityTokenServiceEndpoint>
-<EndpointReference xmlns="http://www.w3.org/2005/08/addressing">
<Address>https://homepw2.accesscontrol.windows.net/v2/wstrust/13/username</Address>
-<Metadata>
-<Metadata xmlns="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
-<wsx:MetadataSection Dialect="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns="">
-<wsx:MetadataReference>
<Address xmlns="http://www.w3.org/2005/08/addressing">https://homepw2.accesscontrol.windows.net/v2/wstrust/mex</Address>
</wsx:MetadataReference>
</wsx:MetadataSection>
</Metadata>
</Metadata>
</EndpointReference>
</fed:SecurityTokenServiceEndpoint>