public static ContractDescription GetContract(
     Type contractType)
 {
     if (contractType == null)
     {
         throw new ArgumentNullException("contractType");
     }
     return(ContractDescriptionGenerator.GetContract(contractType));
 }
 public static ContractDescription GetContract(
     Type contractType, object serviceImplementation)
 {
     if (contractType == null)
     {
         throw new ArgumentNullException("contractType");
     }
     if (serviceImplementation == null)
     {
         throw new ArgumentNullException("serviceImplementation");
     }
     return(ContractDescriptionGenerator.GetContract(contractType, serviceImplementation));
 }
Exemple #3
0
        public Collection <ContractDescription> GetInheritedContracts()
        {
            var ret = new Collection <ContractDescription> ();

            foreach (var it in ContractType.GetInterfaces())
            {
                var icd = ContractDescriptionGenerator.GetContractInternal(it, null, null);
                if (icd != null)
                {
                    ret.Add(icd);
                }
            }
            return(ret);
        }
Exemple #4
0
        static MessageDescriptionCollection MessageContractToMessagesDescription(
            Type src, string defaultNamespace, string action)
        {
            MessageContractAttribute mca =
                ContractDescriptionGenerator.GetMessageContractAttribute(src);

            if (mca == null)
            {
                throw new ArgumentException(String.Format("Type {0} and its ancestor types do not have MessageContract attribute.", src));
            }

            MessageDescriptionCollection messages = new MessageDescriptionCollection();

            messages.Add(ContractDescriptionGenerator.CreateMessageDescription(src, defaultNamespace, action, true, mca));
            messages.Add(ContractDescriptionGenerator.CreateMessageDescription(src, defaultNamespace, action, false, mca));
            return(messages);
        }
Exemple #5
0
 public static ContractDescription GetContract(
     Type contractType, Type serviceType)
 {
     return(ContractDescriptionGenerator.GetContract(contractType, serviceType));
 }
Exemple #6
0
 public static ContractDescription GetContract(
     Type contractType, object serviceImplementation)
 {
     return(ContractDescriptionGenerator.GetContract(contractType, serviceImplementation));
 }