Error:
The Identity check failed for the outgoing message. The remote endpoint did not provide a domain name system (DNS) claim and therefore did not satisfied DNS identity 'user.name@domain'. This may be caused by lack of DNS or CN name in the remote endpoint X.509 certificate's distinguished name.Resolution:
Modify the parameter passed in the EndpointIdentity.CreateDnsIdentity() method call.
Update the following
EndpointIdentity.CreateDnsIdentity(string.Format("{0}@{1}", UserName, Domain)
to
EndpointIdentity.CreateDnsIdentity("xyz")