/// <summary> /// Generates a ContractDescription that can be used for generating the help page. /// </summary> /// <param name="originalContract"><see cref="ContractDescription"/> of the Service endpoint for which the help page contract desciption is generated.</param> /// <returns><see cref="ContractDescription"/> that should be used for the HelpPage generation.</returns> internal static ContractDescription GenerateClientContractDescription(ContractDescription originalContract) { if (originalContract == null) { return(null); } ContractDescription contract = new ContractDescription(originalContract.Name, originalContract.Namespace) { ProtectionLevel = originalContract.ProtectionLevel, SessionMode = originalContract.SessionMode, CallbackContractType = originalContract.CallbackContractType, ConfigurationName = originalContract.ConfigurationName, ContractType = originalContract.ContractType, // this will point to the original contract }; // add contract behaviors foreach (IContractBehavior behavior in originalContract.Behaviors) { contract.Behaviors.Add(behavior); } // add operations foreach (OperationDescription operationDescription in originalContract.Operations) { contract.Operations.Add(ClientContractDescriptionHelper.GetEquivalentOperationDescription(operationDescription)); } return(contract); }
private static OperationDescription CreateEmptyOperationDescription(OperationDescription other) { OperationDescription copy = ClientContractDescriptionHelper.GetCopyOfOperationDescription(other); HttpOperationDescription description = copy.ToHttpOperationDescription(); // delete all parameters description.InputParameters.Clear(); description.OutputParameters.Clear(); return(copy); }