Ying_Zhu
(Ying Zhu)
October 11, 2023, 3:04pm
1
Hey guys, i have touble extract data under , i use
xmlrez.Element(soapenv+“Envelope”).Element(soapenv+“Body”).Element(“CallBranchOut”).Element(“DataFromTFS”).Value and give the data below without error,
but when i try to move on to the data, i keep receiving error like ‘Assign: Object reference not set to an instance of an object.’
xmlrez.Element(soapenv+“Envelope”).Element(soapenv+“Body”).Element(“CallBranchOut”).Element(“DataFromTFS”).Elements(“Documents”).Elements(“Document_Record”).Elements(“Available”).Value.ToString
not sure which part goes wrong that con’t return the details
Ying_Zhu
(Ying Zhu)
October 11, 2023, 3:07pm
3
hi, i’ve checked but not sure what goes wrong in my code
ppr
(Peter Preuss)
October 11, 2023, 3:15pm
5
From your input
we would assume, that a SOAP xml with typically defined XML Namespaces is to handle
The details / XML Namespace definitions we cannot derrive form your snippet. Also the xml snippet and the code snippet are not matching (Element Structures)
So we recommened:
Prototypings:
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum
feel free to share with us the XML as Textfile and let us know your detailed extraction needs
Ying_Zhu
(Ying Zhu)
October 11, 2023, 3:46pm
6
soap_xml.txt (1.6 KB)
Hi ppr, thanks for your help, txt file of xml from UiPath is attached, the detail data i need to extract is Status, DOCDATE1, DOCNUMBER1, DOCNUMBER2
<SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/ ” xmlns:SOAP-ENC=“http://schemas.xmlsoap.org/soap/encoding/ ”>
SOAP-ENV:Body
list
R55U03B501_PXPKG
SUCCESS
YES
pdf
14-81847883-1
2021-09-30 00:00:00
A OK SMOG REPAIR & REGISTRATION
46590 CALHOUN ST
CUSTOMER FINANCIAL SERVICES
38729845
71277470
70018
R55U03B501_PXPKG
]]>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
ppr
(Peter Preuss)
October 11, 2023, 3:49pm
7
Please confirm that the shared XML is of this format:
escaped XML as values. If so, then we would first decode the value, parsing and Xml processing it.
Ying_Zhu
(Ying Zhu)
October 11, 2023, 3:57pm
8
Yeah the request is html encoded, but the result format within SoapUI looks fine, not sure why in UiPath the format changed.
ppr
(Peter Preuss)
October 11, 2023, 4:01pm
9
Going ahead:
Name/ Namespace Check
So we can do a Quick Access:
Crosscheck returned Value
So when again Parsing the XML we can access:
ppr
(Peter Preuss)
October 11, 2023, 4:02pm
10
It is about the handling the CDATA Part
But with a second Deserialize XML it can be handled as show cased above
Ying_Zhu
(Ying Zhu)
October 11, 2023, 4:16pm
11
hi thanks, but i’m not sure i fully understand, how do we do the second deserial xml here? sorry i’m pretty new to this
ppr
(Peter Preuss)
October 11, 2023, 4:21pm
12
as shown we can do it on codel
Assign Activity:
xDoc2 | DataType: XDocument = xDocument.Parse(xDoc.Descendants("DataFromTFS").First().Value)
Or you are using a second Deserialize XML Activity
xDoc is the outcome from the first Deserialize XML
Ying_Zhu
(Ying Zhu)
October 11, 2023, 5:16pm
13
got it, thank you so much
system
(system)
Closed
October 14, 2023, 5:16pm
14
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.