internal static XmlQualifiedName GetContractName(Type contractType, string name, string ns)
 {
     System.ServiceModel.Description.XmlName name2 = new System.ServiceModel.Description.XmlName(name ?? TypeName(contractType));
     if (ns == null)
     {
         ns = "http://tempuri.org/";
     }
     return new XmlQualifiedName(name2.EncodedName, ns);
 }
 public MessagePartDescription(string name, string ns)
 {
     if (name == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("name", System.ServiceModel.SR.GetString("SFxParameterNameCannotBeNull"));
     }
     this.name = new System.ServiceModel.Description.XmlName(name, true);
     if (!string.IsNullOrEmpty(ns))
     {
         NamingHelper.CheckUriParameter(ns, "ns");
     }
     this.ns = ns;
 }
 internal MessagePartDescription(MessagePartDescription other)
 {
     this.name = other.name;
     this.ns = other.ns;
     this.index = other.index;
     this.type = other.type;
     this.serializationPosition = other.serializationPosition;
     this.hasProtectionLevel = other.hasProtectionLevel;
     this.protectionLevel = other.protectionLevel;
     this.memberInfo = other.memberInfo;
     this.multiple = other.multiple;
     this.additionalAttributesProvider = other.additionalAttributesProvider;
     this.baseType = other.baseType;
     this.uniquePartName = other.uniquePartName;
 }
 public OperationDescription(string name, ContractDescription declaringContract)
 {
     this.validateRpcWrapperName = true;
     if (name == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("name");
     }
     if (name.Length == 0)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("name", System.ServiceModel.SR.GetString("SFxOperationDescriptionNameCannotBeEmpty")));
     }
     this.name = new System.ServiceModel.Description.XmlName(name, true);
     if (declaringContract == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("declaringContract");
     }
     this.declaringContract = declaringContract;
     this.isInitiating = true;
     this.isTerminating = false;
     this.faults = new FaultDescriptionCollection();
     this.messages = new MessageDescriptionCollection();
     this.behaviors = new KeyedByTypeCollection<IOperationBehavior>();
     this.knownTypes = new Collection<Type>();
 }
 internal XmlMembersMapping ImportFaultElement(FaultDescription fault, out XmlQualifiedName elementName)
 {
     XmlReflectionMember[] members = new XmlReflectionMember[1];
     System.ServiceModel.Description.XmlName name = fault.ElementName;
     string ns = fault.Namespace;
     if (name == null)
     {
         XmlTypeMapping mapping = this.parent.importer.ImportTypeMapping(fault.DetailType, this.IsEncoded);
         name = new System.ServiceModel.Description.XmlName(mapping.ElementName, this.IsEncoded);
         ns = mapping.Namespace;
         if (name == null)
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("SFxFaultTypeAnonymous", new object[] { this.Operation.Name, fault.DetailType.FullName })));
         }
     }
     elementName = new XmlQualifiedName(name.DecodedName, ns);
     members[0] = XmlSerializerHelper.GetXmlReflectionMember(null, name, ns, fault.DetailType, null, false, this.IsEncoded, false);
     string mappingKey = "fault:" + name.DecodedName + ":" + ns;
     return this.ImportMembersMapping(name.EncodedName, ns, members, false, this.IsRpc, mappingKey);
 }
 private MessagePartDescriptionCollection GetWrappedParts(MessagePartDescription bodyPart)
 {
     System.Type type = bodyPart.Type;
     MessagePartDescriptionCollection descriptions = new MessagePartDescriptionCollection();
     foreach (MemberInfo info in type.GetMembers(BindingFlags.Public | BindingFlags.Instance))
     {
         if (((info.MemberType & (MemberTypes.Property | MemberTypes.Field)) != 0) && !info.IsDefined(typeof(SoapIgnoreAttribute), false))
         {
             MessagePartDescription description;
             System.ServiceModel.Description.XmlName name = new System.ServiceModel.Description.XmlName(info.Name);
             description = new MessagePartDescription(name.EncodedName, string.Empty) {
                 AdditionalAttributesProvider = description.MemberInfo = info,
                 Index = description.SerializationPosition = descriptions.Count,
                 Type = (info.MemberType == MemberTypes.Property) ? ((PropertyInfo) info).PropertyType : ((FieldInfo) info).FieldType
             };
             if (bodyPart.HasProtectionLevel)
             {
                 description.ProtectionLevel = bodyPart.ProtectionLevel;
             }
             descriptions.Add(description);
         }
     }
     return descriptions;
 }