예제 #1
0
파일: WsdlParser.cs 프로젝트: JianwenSun/cc
        private void ParseWsdlMessage()
        {
            Util.Log("WsdlParser.ParseWsdlMessage");
            WsdlMessage message = new WsdlMessage();
            message.name = LookupAttribute(s_nameString, null, true);
            message.nameNs = _parsingInput.TargetNS;
            int curDepth = _XMLReader.Depth; 
            ReadNextXmlElement();               
            while (_XMLReader.Depth > curDepth)
            {
                String elementName = _XMLReader.LocalName;

                if (MatchingStrings(elementName, s_partString))
                {
                    WsdlMessagePart part = new WsdlMessagePart();
                    part.name = LookupAttribute(s_nameString, null, true); 
                    part.nameNs = _parsingInput.TargetNS;
                    //AddToNamespace(part.nameNs);//temp
                    part.element = LookupAttribute(s_elementString, null, false);
                    part.typeName = LookupAttribute(s_typeString, null, false);
                    if (part.element != null)
                    {
                        part.elementNs = ParseQName(ref part.element);
                    }
                    if (part.typeName != null)
                    {
                        part.typeNameNs = ParseQName(ref part.typeName); 
                    }

                    message.parts.Add(part);
                    ReadNextXmlElement();
                    continue;
                }

                // Ignore others elements such as annotations
                SkipXmlElement();
            }
            wsdlMessages[message.name] = message;
        }
 private void ParseWsdlMessage()
 {
     WsdlMessage message = new WsdlMessage {
         name = this.LookupAttribute(s_nameString, null, true),
         nameNs = this._parsingInput.TargetNS
     };
     int depth = this._XMLReader.Depth;
     this.ReadNextXmlElement();
     while (this._XMLReader.Depth > depth)
     {
         if (MatchingStrings(this._XMLReader.LocalName, s_partString))
         {
             WsdlMessagePart part = new WsdlMessagePart {
                 name = this.LookupAttribute(s_nameString, null, true),
                 nameNs = this._parsingInput.TargetNS,
                 element = this.LookupAttribute(s_elementString, null, false),
                 typeName = this.LookupAttribute(s_typeString, null, false)
             };
             if (part.element != null)
             {
                 part.elementNs = this.ParseQName(ref part.element);
             }
             if (part.typeName != null)
             {
                 part.typeNameNs = this.ParseQName(ref part.typeName);
             }
             message.parts.Add(part);
             this.ReadNextXmlElement();
         }
         else
         {
             this.SkipXmlElement();
         }
     }
     this.wsdlMessages[message.name] = message;
 }