System.Xml.Serialization.SoapReflectionImporter.IncludeTypes C# (CSharp) Method

IncludeTypes() public method

public IncludeTypes ( ICustomAttributeProvider provider ) : void
provider ICustomAttributeProvider
return void
        public void IncludeTypes(ICustomAttributeProvider provider) {
            object[] attrs = provider.GetCustomAttributes(typeof(SoapIncludeAttribute), false);
            for (int i = 0; i < attrs.Length; i++) {
                IncludeType(((SoapIncludeAttribute)attrs[i]).Type);
            }
        }

Usage Example

Example #1
0
		public SoapTypeStubInfo (LogicalTypeInfo logicalTypeInfo)
		: base (logicalTypeInfo)
		{
			xmlImporter = new XmlReflectionImporter ();
			soapImporter = new SoapReflectionImporter ();
				
			if (typeof (SoapHttpClientProtocol).IsAssignableFrom (Type))
			{
				if (Bindings.Count == 0 || ((BindingInfo)Bindings[0]).WebServiceBindingAttribute == null)
					throw new InvalidOperationException ("WebServiceBindingAttribute is required on proxy class '" + Type + "'.");
				if (Bindings.Count > 1)
					throw new InvalidOperationException ("Only one WebServiceBinding attribute may be specified on type '" + Type + "'.");
			}

			object [] o = Type.GetCustomAttributes (typeof (SoapDocumentServiceAttribute), false);
			if (o.Length == 1){
				SoapDocumentServiceAttribute a = (SoapDocumentServiceAttribute) o [0];

				ParameterStyle = a.ParameterStyle;
				SoapBindingStyle = SoapBindingStyle.Document;
			} else {
				o = Type.GetCustomAttributes (typeof (SoapRpcServiceAttribute), false);
				if (o.Length == 1){
					ParameterStyle = SoapParameterStyle.Wrapped;
					SoapBindingStyle = SoapBindingStyle.Rpc;
				} else {
					ParameterStyle = SoapParameterStyle.Wrapped;
					SoapBindingStyle = SoapBindingStyle.Document;
				}
			}
			
			if (ParameterStyle == SoapParameterStyle.Default) ParameterStyle = SoapParameterStyle.Wrapped;
			
			xmlImporter.IncludeTypes (Type);
			soapImporter.IncludeTypes (Type);

#if MOBILE || XAMMAC_4_5
			SoapExtensions = new SoapExtensionRuntimeConfig [2][];
#else
			SoapExtensions = SoapExtension.GetTypeExtensions (Type);
#endif
		}
All Usage Examples Of System.Xml.Serialization.SoapReflectionImporter::IncludeTypes