How to use deserialize xml in uipath

Hello,
I want to extract the faturaNo information with Deserialize from the sample XML code below, but I cannot do this. Can you help me?

<soapenvEnvelope
    xmlnssoapenv="http//schemas.xmlsoap.org/soap/envelope/"
    xmlnstem="http//tempuri.org/">
    <soapenvHeader/>
    <soapenvBody>
     <OdemeOncesiFaturaSorgulamaResponse xmlnsns3="**">
  <s606mesajTipi xmlnss606="**">210</s606mesajTipi>
  <s607islemKodu xmlnss607="**">91</s607islemKodu>
  <s608stan xmlnss608="***</s608stan>
  <s609kurumKodu xmlnss609="***">2111</s609kurumKodu>
  <islemYapan xmlns="**">
    <sehirKodu>34</sehirKodu>
    <subeKodu>**</subeKodu>
    <giseKodu>**</giseKodu>
    <kullaniciKodu>**</kullaniciKodu>
  </islemYapan>
  <s610sirketKodu xmlnss610="**">510</s610sirketKodu>
  <s611paraKodu xmlnss611="**">949</s611paraKodu>
  <s612islemKaynagi xmlnss612="**">8</s612islemKaynagi>
  <s613islemTarihi xmlnss613="**">20210823</s613islemTarihi>
  <s614islemSaati xmlnss614="**">234429</s614islemSaati>
  <ozetCevapMesaj xmlns="**">
    <hataMesaji>Başarılı işlem</hataMesaji>
    <islemSonucKodu>00</islemSonucKodu>
  </ozetCevapMesaj>
  <kayitSayisi>1</kayitSayisi>
  <erisimBilgi>
    <erisimTipi>1</erisimTipi>
    <erisimNo>Test01</erisimNo>
  </erisimBilgi>
  <faturaBilgiDizi>
    <faturaBilgi xmlnsxsi="http//www.w3.org/2001/XMLSchema-instance" xsitype="OdemeOncesiFaturaBilgi">
      <hesapNo>TestHesapNo</hesapNo>
      <toplamBorcTutari>5085</toplamBorcTutari>
      <referansNo>123456789</referansNo>
      <faturaNo>159753159753159753000000</faturaNo>
      <faturaTaksitNo>0</faturaTaksitNo>
      <odemeDonemi>202107</odemeDonemi>
      <hesapId>987654321</hesapId>
      <faturaEsnekAlan>
        <anahtarDegerCifti>
          <ns1anahtar xmlnsns1="**">komisyonKodu</ns1anahtar>
          <ns1deger xmlnsns1="**">0</ns1deger>
        </anahtarDegerCifti>
      </faturaEsnekAlan>
      <referansBilgi xsinil="1" />
      <adsoyadUnvan>Test </adsoyadUnvan>
      <faturaTipi>0</faturaTipi>
      <sonOdemeTarihi>20221231</sonOdemeTarihi>
      <maliyetFaturaID>A9999999999999</maliyetFaturaID>
    </faturaBilgi>
  </faturaBilgiDizi>
</OdemeOncesiFaturaSorgulamaResponse>
    </soapenvBody>
</soapenvEnvelope>

Hi

Welcome back to UiPath forum

  1. Use deserialise xml activity and get the output create a variable called “out_XML” of XDocument type.

Note: If you don’t find the “Deserialize XML” activity in the activities panel, then you have to install UiPath.Web.Activities  package

  1. Now use a writeline activity like this

out_XML.Element(“soapenvEnvelope”).Element(“soapenvBody”).Element(“OdemeOncesiFaturaSorgulamaResponse“).Element(“faturaBilgiDizi”).Element(“faturaBilgiDizi”).Element(“faturaNo”).Value.ToString

Cheers @ridvanucok

2 Likes

Thank you very much for your information and help but it is getting error even though the variable type is XDocument.


image

Edit: Problem fixed.

xd_XmlCode.Element(“soapenvEnvelope”).Element(“soapenvBody”).Element(“OdemeOncesiFaturaSorgulamaResponse“).Element(“faturaBilgiDizi”).Element(“faturaBilgi”).Element(“faturaNo”).Value.ToString

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