Extract Element Values from SOAP XML (VB.Net / C#)

I am trying to make it work. Is it because i am using c#?

This could be a reason on syntax, but not on api statements. So correct the syntax if needed.

Just do a quick break, take a breath and continue after this fresh and concentrated. I am sure you will get it working :+1:

give a try on:

xDoc.Root.Descendants(xnsTempuri + "Result").First().Descendants(xnsVersion + "IDNumber").First().Value;
OR
xDoc.Root.Descendants(xnsTempuri + "Result").ElementAt(0).Descendants(xnsVersion + "Code").ElementAt(0).Value;

Unfortunately my service is down. So I am unable to test it now. As soon as the service is up and running, I will let you know the result.

I tried putting the below in a message box and it is not showing any error message.
xDoc.Root.Descendants(xnsTempuri + “Result”).First().Descendants(xnsVersion + “IDNumber”).First().Value;

Thanks
Deepak

Sorry for the late reply , I am getting a message like this
“Sequence contains no Elements”.
Since day before I tried different options but I am unable to get what I want. So can you please help me?

thanks
Deepak

Can you please Share some Details on what you have implemented so far( Screenshots, xaml, XML if it is a changed one). Thanks

<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>
            <DetailObject xmlns="">
	<IDNumber xmlns="http://abc.com/xml/schemas/version5.0">1234567890</IDNumber >
 	<List xmlns="http://abc.com/xml/schemas/version5.0">
                  <Details>
                     <Code>1111111</Code>                     
                  </Details
	</List>
	</DetailObject>
         </Result>
      </Response>
   </s:Body>
</s:Envelope>

xDoc.Root.Descendants(xnsTempuri + “Result”).First().Descendants(xnsVersion + “IDNumber”).First().Value;

Since day before, I tried so many options but unfortunately the above one came closer.

Maybe I am new to UIPath that’s the reason why I am not getting the expected result.

Sorry to trouble you and Thanks in advance
Deepak

tried the below also
xDoc.Root.Descendants(xnsTempuri + “Response”) and the response is

System.Xml.Linq.XContainer +d_39

Thank you so much. I have one more doubt can I raise a new post?

We would suggest that you will open a new topic for your next case question. It is easier for researchers to have 1 Topic = 1 Case to find the silutions. Thanks for support

2 Likes

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