コード例 #1
0
 private void ProcessMethods(RealSchemaType rsType)
 {
     XMLNamespace xNS = rsType.XNS;
     MethodInfo[] introducedMethods = rsType.GetIntroducedMethods();
     if (introducedMethods.Length > 0)
     {
         string name = null;
         XMLNamespace xns = null;
         if (xNS.IsInteropType)
         {
             name = xNS.Name;
             xns = xNS;
         }
         else
         {
             StringBuilder sb = new StringBuilder();
             QualifyName(sb, xNS.Name, rsType.Name);
             name = sb.ToString();
             xns = this.AddNamespace(name, xNS.Assem);
             xNS.DependsOnSchemaNS(xns, false);
         }
         for (int i = 0; i < introducedMethods.Length; i++)
         {
             MethodInfo info = introducedMethods[i];
             this.AddType(info.ReturnType, xns);
             ParameterInfo[] parameters = info.GetParameters();
             for (int j = 0; j < parameters.Length; j++)
             {
                 this.AddType(parameters[j].ParameterType, xns);
             }
         }
     }
 }
コード例 #2
0
        private void ProcessMethods(RealSchemaType rsType)
        {
            Util.Log("WsdlGenerator.ProcessMethods "+rsType);                       
            XMLNamespace xns = rsType.XNS;
            MethodInfo[] methods = rsType.GetIntroducedMethods();
            if (methods.Length > 0)
            {
                String methodNSString = null;
                XMLNamespace methodXNS = null;  

                if (xns.IsInteropType)
                {
                    methodNSString = xns.Name;
                    methodXNS = xns;
                }
                else
                {
                    StringBuilder sb = new StringBuilder();
                    WsdlGenerator.QualifyName(sb, xns.Name, rsType.Name);
                    methodNSString = sb.ToString();
                    methodXNS = AddNamespace(methodNSString, xns.Assem);
                    xns.DependsOnSchemaNS(methodXNS, false);
                }

                for (int i=0;i<methods.Length;i++)
                {
                    MethodInfo method = methods[i];
                    Util.Log("WsdlGenerator.ProcessMethods methods "+method.Name+" "+methodXNS.Name);
                    AddType(method.ReturnType, methodXNS);
                    ParameterInfo[] parameters = method.GetParameters();
                    for (int j=0;j<parameters.Length;j++)
                        AddType(parameters[j].ParameterType, methodXNS); 
                }
            }
        }
コード例 #3
0
ファイル: sdlwriter.cs プロジェクト: ArildF/masters
		// Adds types reachable from the given type
		private void EnqueueReachableTypes(RealSchemaType rsType)
		{
			Util.Log("SdlGenerator.EnqueueReachableTypes ");            
			// Get the XML namespace object
			XMLNamespace xns = rsType.XNS;

			// Process base type
			if (rsType.Type.BaseType != null)
				AddType(rsType.Type.BaseType, xns);

			// Check if this is a suds type
			bool bSUDSType = rsType.Type.IsInterface ||
							 s_marshalByRefType.IsAssignableFrom(rsType.Type) ||
							 s_delegateType.IsAssignableFrom(rsType.Type);
			if (bSUDSType)
			{
				// Process implemented interfaces
				Type[] interfaces = rsType.GetIntroducedInterfaces();
				if (interfaces.Length > 0)
				{
					for (int i=0;i<interfaces.Length;i++)
					{
						Util.Log("SdlGenerator.EnqueueReachableTypes Interfaces "+interfaces[i].Name+" "+xns.Name);                     
						AddType(interfaces[i], xns);
					}
				}

				// Process methods
				MethodInfo[] methods = rsType.GetIntroducedMethods();
				if (methods.Length > 0)
				{
					String methodNSString = null;
					XMLNamespace methodXNS = null;  

					if (xns.IsInteropType)
					{
						methodNSString = xns.Name;
						methodXNS = xns;
					}
					else
					{
						StringBuilder sb = new StringBuilder();
						sb.Append(xns.Name);
						sb.Append('.');
						sb.Append(rsType.Name);
						methodNSString = sb.ToString();
						methodXNS = AddNamespace(methodNSString, xns.Assem);
						xns.DependsOnSchemaNS(methodXNS);
					}

					for (int i=0;i<methods.Length;i++)
					{
						MethodInfo method = methods[i];
						Util.Log("SdlGenerator.EnqueueReachableTypes methods "+method.Name+" "+methodXNS.Name);
						AddType(method.ReturnType, methodXNS);
						ParameterInfo[] parameters = method.GetParameters();
						for (int j=0;j<parameters.Length;j++)
							AddType(parameters[j].ParameterType, methodXNS);
					}
				}
			}
			else
			{
				// Process fields
				FieldInfo[] fields = rsType.GetInstanceFields();
				for (int i=0;i<fields.Length;i++)
				{
					if (fields[i].FieldType == null)
						continue;
					AddType(fields[i].FieldType, xns);
				}
			}

			return;
		}