Deserialize XML objects

Dears,
I am quiet new to UIPath. I have the following XML and I want to deserialize it. Can someone please explain me how to do it?

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Response xmlns="http://tempuri.org/">
         <Result>
            <getExtended xmlns="">
               <BasicInvestmentLicenseDetails xmlns="http://yefi.gov.sa/ECA/InvestmentLicense/xml/schemas/version3.0">
                  <Number>010450466</Number>
	<IssueDate>
                     <EnDate xmlns="http://abc.com/Types/xml/schemas/version2.0">2016-01-29</EnDate>          
                  </IssueDate>
     	</getExtended>
         </Result>
      </Response>
   </s:Body>
</s:Envelope>


Tried many options and some are mentioned below
ResultXML.Root.Descendants(Tempuri + “Response”).First().Descendants(Version + “Number”).First().Value.ToString
ResultXML.Root.Descendants(Tempuri + “Response”).ElementAt(0).Descendants(Version + “EnDate”).ElementAt(0).Value;

Getting different responses different times
Following are some of the responses I got

System.XML.Extensions + d_21’1[System.Xml.Linq.XElement]
xnsVersionECA1
Assign: The ’ ’ character, hexadecimal value 0x20, cannot be included in a name.

Assign: The ‘:’ character, hexadecimal value 0x3A, cannot be included in a name.

Your request looks similar to your other topic:

what in detail is different /special within this topic?

looks like a usage of namspacename:elementname access which will not work. We do use the namespace avariable as done on other solved topic


Kindly note: give XML snippet is invalid as element is not propely closed. Check yeelow mark on the corrected one:

With the correct XML we can access
Variables:


Access
grafik

In case of we are uncertain on the used namespace we can allways check within immediate panel e.g. like this
grafik

1 Like

Thank you so much for letting me know the importance of Immediate Window. I did so much of Trial & Error and I made it work.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.