internal void WriteTo(DiscoveryVersion discoveryVersion, XmlWriter writer) { if (discoveryVersion == null) { throw FxTrace.Exception.ArgumentNull("discoveryVersion"); } if (writer == null) { throw FxTrace.Exception.ArgumentNull("writer"); } SerializationUtility.WriteEndPointAddress(discoveryVersion, this.endpointAddress, writer); if (this.duration != TimeSpan.MaxValue) { writer.WriteElementString( ProtocolStrings.SchemaNames.DurationElement, ProtocolStrings.VersionInternal.Namespace, XmlConvert.ToString(this.duration)); } if (this.extensions != null) { foreach (XElement xElement in Extensions) { xElement.WriteTo(writer); } } }
internal void WriteTo(DiscoveryVersion discoveryVersion, XmlWriter writer) { if (discoveryVersion == null) { throw FxTrace.Exception.ArgumentNull("discoveryVersion"); } if (writer == null) { throw FxTrace.Exception.ArgumentNull("writer"); } SerializationUtility.WriteEndPointAddress(discoveryVersion, this.endpointAddress, writer); SerializationUtility.WriteContractTypeNames(discoveryVersion, this.contractTypeNames, writer); SerializationUtility.WriteScopes(discoveryVersion, this.scopes, null, writer); SerializationUtility.WriteListenUris(discoveryVersion, this.listenUris, writer); SerializationUtility.WriteMetadataVersion(discoveryVersion, this.metadataVersion, writer); if (this.extensions != null) { foreach (XElement xElement in Extensions) { xElement.WriteTo(writer); } } }