Error message: "Unable to retrieve nodes using SelectSingleNod e."
Can anyone tell me correct way of implementing this?
The following code always returns null:
(XML I am working with)
Here is the code I have return to retrieve node with profilenum='01' :
(C# code)
Can anyone tell me correct way of implementing this?
The following code always returns null:
(XML I am working with)
Code:
<?xml version="1.0" encoding="UTF-8"?>
<WdprAccountProfileResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://Broadridge.com/Ascendis/Services/PhaseIV/Entities/">
<Details i:nil="true" />
<RawData>
<ADP_MESSAGE Client_Number="0096" Message_id="WDPR/WDPR_ACCTPROFILES" Version="1.0" Session_Pool_id="mqpool096">
<RESPONSE>
<Turnaround/>
<RequestReturn>N</RequestReturn>
<Error_Response>
<Error_Number>9022</Error_Number>
<Error_Message>User not authorized for service</Error_Message>
</Error_Response>
</RESPONSE>
</ADP_MESSAGE>
</RawData>
<StatusCode>SUCCESS</StatusCode>
<AccountProfilesList>
<AccountProfileEntity>
<AccountName>TAIFOOK SECURITIES LIMITED</AccountName>
<AddDate>03/29/2010</AddDate>
<AdditionalInformation i:nil="true" />
<ProfileNum>01</ProfileNum>
</AccountPortFolioEntity>
(C# code)
Code:
XmlDocument xdoc = new XmlDocument();
xdoc.Load("C:\\Documents and Settings\\My Documents\\Visual Studio 2008\\Projects\\ConsoleApplication5\\WireProfile.xml");
string profileno = "01";
XmlNode root = xdoc.DocumentElement;
XmlNode node = xdoc.SelectSingleNode("./AccountProfilesList[AccountProfileEntity/ProfileNum = '" + profileno + "']");
Console.WriteLine(node["RecBankLocation"].InnerText);
Console.WriteLine(node["ReceivingBankName"].InnerText);