private WsdlBindingOperationSection ParseWsdlBindingOperationSection(WsdlBindingOperation op, String inputElementName, ref bool bSoapEncoded) { Util.Log("WsdlParser.ParseWsdlBindingOperationSections"); bool breturn = false; WsdlBindingOperationSection opSec = new WsdlBindingOperationSection(); op.sections.Add(opSec); opSec.name = LookupAttribute(s_nameString, null, false); if (MatchingStrings(opSec.name, s_emptyString)) { if (MatchingStrings(inputElementName, s_inputString)) { breturn = true; opSec.name = Atomize(op.name+"Request"); } else if (MatchingStrings(inputElementName, s_outputString)) opSec.name = Atomize(op.name+"Response"); } opSec.elementName = inputElementName; int curDepth = _XMLReader.Depth; ReadNextXmlElement(); while (_XMLReader.Depth > curDepth) { String elementName = _XMLReader.LocalName; if (MatchingNamespace(s_wsdlSoapNamespaceString)) { if (MatchingStrings(elementName, s_bodyString)) { WsdlBindingSoapBody soapBody = new WsdlBindingSoapBody(); opSec.extensions.Add(soapBody); soapBody.parts = LookupAttribute(s_partsString, null, false); soapBody.use = LookupAttribute(s_useString, null, true); if (soapBody.use == "encoded") bSoapEncoded = true; soapBody.encodingStyle = LookupAttribute(s_encodingStyleString, null, false); soapBody.namespaceUri = LookupAttribute(s_namespaceString, null, false); ReadNextXmlElement(); continue; } else if (MatchingStrings(elementName, s_headerString)) { WsdlBindingSoapHeader soapHeader = new WsdlBindingSoapHeader(); opSec.extensions.Add(soapHeader); soapHeader.message = LookupAttribute(s_messageString, null, true); soapHeader.messageNs = ParseQName(ref soapHeader.message); soapHeader.part = LookupAttribute(s_partString, null, true); soapHeader.use = LookupAttribute(s_useString, null, true); soapHeader.encodingStyle = LookupAttribute(s_encodingStyleString, null, false); soapHeader.namespaceUri = LookupAttribute(s_namespaceString, null, false); ReadNextXmlElement(); continue; } else if (MatchingStrings(elementName, s_faultString)) { WsdlBindingSoapFault soapFault = new WsdlBindingSoapFault(); opSec.extensions.Add(soapFault); soapFault.name = LookupAttribute(s_nameString, null, true); soapFault.use = LookupAttribute(s_useString, null, true); soapFault.encodingStyle = LookupAttribute(s_encodingStyleString, null, false); soapFault.namespaceUri = LookupAttribute(s_namespaceString, null, false); ReadNextXmlElement(); continue; } } // Ignore others elements such as annotations // headerFault currently ignored SkipXmlElement(); } // returning opSec only if a fixup might be necessary, this is the case of an input section with an empty input name // it will be fixed up later if there is no output section if (breturn) return opSec; else return null; }
private WsdlBindingOperationSection ParseWsdlBindingOperationSection(WsdlBindingOperation op, string inputElementName, ref bool bSoapEncoded) { bool flag = false; WsdlBindingOperationSection section = new WsdlBindingOperationSection(); op.sections.Add(section); section.name = this.LookupAttribute(s_nameString, null, false); if (MatchingStrings(section.name, s_emptyString)) { if (MatchingStrings(inputElementName, s_inputString)) { flag = true; section.name = this.Atomize(op.name + "Request"); } else if (MatchingStrings(inputElementName, s_outputString)) { section.name = this.Atomize(op.name + "Response"); } } section.elementName = inputElementName; int depth = this._XMLReader.Depth; this.ReadNextXmlElement(); while (this._XMLReader.Depth > depth) { string localName = this._XMLReader.LocalName; if (this.MatchingNamespace(s_wsdlSoapNamespaceString)) { if (MatchingStrings(localName, s_bodyString)) { WsdlBindingSoapBody body = new WsdlBindingSoapBody(); section.extensions.Add(body); body.parts = this.LookupAttribute(s_partsString, null, false); body.use = this.LookupAttribute(s_useString, null, true); if (body.use == "encoded") { bSoapEncoded = true; } body.encodingStyle = this.LookupAttribute(s_encodingStyleString, null, false); body.namespaceUri = this.LookupAttribute(s_namespaceString, null, false); this.ReadNextXmlElement(); continue; } if (MatchingStrings(localName, s_headerString)) { WsdlBindingSoapHeader header = new WsdlBindingSoapHeader(); section.extensions.Add(header); header.message = this.LookupAttribute(s_messageString, null, true); header.messageNs = this.ParseQName(ref header.message); header.part = this.LookupAttribute(s_partString, null, true); header.use = this.LookupAttribute(s_useString, null, true); header.encodingStyle = this.LookupAttribute(s_encodingStyleString, null, false); header.namespaceUri = this.LookupAttribute(s_namespaceString, null, false); this.ReadNextXmlElement(); continue; } if (MatchingStrings(localName, s_faultString)) { WsdlBindingSoapFault fault = new WsdlBindingSoapFault(); section.extensions.Add(fault); fault.name = this.LookupAttribute(s_nameString, null, true); fault.use = this.LookupAttribute(s_useString, null, true); fault.encodingStyle = this.LookupAttribute(s_encodingStyleString, null, false); fault.namespaceUri = this.LookupAttribute(s_namespaceString, null, false); this.ReadNextXmlElement(); continue; } } this.SkipXmlElement(); } if (flag) { return section; } return null; }