I have a XML documents (which describes a wsdl service's interface):
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="GetDummyType">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="param1" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetDummyTypeResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetDummyTypeResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="SimplestWebService">
<s:complexType />
</s:element>
<s:element name="SimplestWebServiceResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="SimplestWebServiceResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="SignInComp">
<s:complexType />
</s:element>
<s:element name="SignInCompResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="SignInCompResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
...
Two operations I need to perform on the above xml:
- retrieve all elements names (GetDummyType, SimplestWebService etc.) Those are the methods names (they don't end with "Response").
- retrieve a method's params by it's name (param1 for GetDummyType etc.)
I've managed so far only to parse this document as an XmlDocument:
XmlDocument doc = new XmlDocument();
doc.LoadXml(result.ToString());
(I know that's not much)
I just can't figure out how that XML is mapped to something you can use linq on..
How do you do that?
Thanks.