private URTSimpleType ParseSimpleType(URTNamespace parsingNamespace, string typeName)
 {
     if (typeName == null)
     {
         typeName = this.LookupAttribute(s_nameString, null, true);
     }
     string str = this.LookupAttribute(s_enumTypeString, s_wsdlSudsNamespaceString, false);
     URTSimpleType simpleType = parsingNamespace.LookupSimpleType(typeName);
     if (simpleType == null)
     {
         simpleType = new URTSimpleType(typeName, parsingNamespace.Name, parsingNamespace.Namespace, parsingNamespace.EncodedNS, typeName != null, this);
         string left = this.LookupAttribute(s_baseString, null, false);
         if (!MatchingStrings(left, s_emptyString))
         {
             string baseTypeNS = this.ParseQName(ref left, parsingNamespace);
             simpleType.Extends(left, baseTypeNS);
         }
         parsingNamespace.AddSimpleType(simpleType);
         int depth = this._XMLReader.Depth;
         this.ReadNextXmlElement();
         while (this._XMLReader.Depth > depth)
         {
             if (MatchingStrings(this._XMLReader.LocalName, s_restrictionString))
             {
                 this.ParseRestrictionField(parsingNamespace, simpleType);
             }
             else
             {
                 this.SkipXmlElement();
             }
         }
     }
     else
     {
         this.SkipXmlElement();
     }
     if (str != null)
     {
         simpleType.EnumType = str;
     }
     return simpleType;
 }
예제 #2
0
파일: WsdlParser.cs 프로젝트: JianwenSun/cc
        // Parses simple types
        private URTSimpleType ParseSimpleType(URTNamespace parsingNamespace, String typeName)
        {
            Util.Log("WsdlParser.ParseSimpleType NS "+parsingNamespace+" typeName "+typeName);                                              
            // Lookup the name of the type and the base type from which it derives
            if (typeName == null)
                typeName = LookupAttribute(s_nameString, null, true);
            String enumType = LookupAttribute(s_enumTypeString, s_wsdlSudsNamespaceString, false);
            URTSimpleType parsingSimpleType = parsingNamespace.LookupSimpleType(typeName);
            if (parsingSimpleType == null)
            {
                parsingSimpleType = new URTSimpleType(typeName, parsingNamespace.Name, parsingNamespace.Namespace,
                                                      parsingNamespace.EncodedNS, typeName != null, this);
                String baseType = LookupAttribute(s_baseString, null, false);
                if (!MatchingStrings(baseType, s_emptyString))
                {
                    String baseNS = ParseQName(ref baseType, parsingNamespace);
                    parsingSimpleType.Extends(baseType, baseNS);
                }
                parsingNamespace.AddSimpleType(parsingSimpleType);

                int curDepth = _XMLReader.Depth;
                ReadNextXmlElement();

                //int enumFacetNum = 0;
                string elementName;
                while (_XMLReader.Depth > curDepth)
                {
                    elementName = _XMLReader.LocalName;

                    if (MatchingStrings(elementName, s_restrictionString))
                    {
                        ParseRestrictionField(parsingNamespace, parsingSimpleType);
                    }
                    /*
                    else if (MatchingStrings(elementName, s_encodingString))
                    {
                        ParseEncoding(parsingSimpleType);
                    }
                    */
                    else
                    {
                        SkipXmlElement();
                    }
                }
            }
            else
            {
                SkipXmlElement();
            }
            if (enumType != null)
                parsingSimpleType.EnumType = enumType;

            return(parsingSimpleType);
        }
예제 #3
0
        // Parses simple types
        private URTSimpleType ParseSimpleType(URTNamespace parsingNamespace, String typeName)
        {
            Util.Log("SdlParser.ParseSimpleType NS "+parsingNamespace+" typeName "+typeName);                                               
            // Lookup the name of the type and the base type from which it derives
            if(typeName == null)
                typeName = LookupAttribute(s_nameString, null, true);
            URTSimpleType parsingSimpleType = parsingNamespace.LookupSimpleType(typeName);
            if(parsingSimpleType == null)
            {
                parsingSimpleType = new URTSimpleType(typeName, parsingNamespace.Namespace,
                                                      parsingNamespace.EncodedNS, typeName != null);
                String baseType = LookupAttribute(s_baseString, null, false);
                if(!MatchingStrings(baseType, s_emptyString))
                {
                    String baseNS = ParseQName(ref baseType);
                    parsingSimpleType.Extends(baseType, baseNS);
                }
                parsingNamespace.AddSimpleType(parsingSimpleType);

                int curDepth = _XMLReader.Depth;
                ReadNextXmlElement();

                int enumFacetNum = 0;
                string elementName;
                while(_XMLReader.Depth > curDepth)
                {
                    elementName = _XMLReader.LocalName;

                    // The only facet we currently support is enumeration
                    if(MatchingStrings(elementName, s_enumerationString))
                    {
                        ParseEnumeration(parsingSimpleType, enumFacetNum);
                        ++enumFacetNum;
                    }
                    else if(MatchingStrings(elementName, s_encodingString))
                    {
                        ParseEncoding(parsingSimpleType);
                    }
                    else
                    {
                        SkipXmlElement();
                    }
                }
            }
            else
            {
                SkipXmlElement();
            }

            return(parsingSimpleType);
        }