473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Cannot retrieve attribute value

An application I'm helping develop transmits XML to an ERP and receives an
XML statement showing the result of the transmittal to the ERP. I've pasted
a copy of one of the response XML statements. I have no trouble retrieving
the statement "Environment 'DEV' could not be initialized for user; check
user, pwd and environment attribute values", which we're storing in our SQL
Server. However, I also need to retrieve the value for the code attribute,
which is 12 in this case, to pass back up to the user; retrieving that value
is the sticking point. How do I go about accomplishing that?

<?xml version='1.0'?>
<jdeResponse type='callmethod' user='JWRIGHT' pwd='JWRIGHT'
environment='DEV' session=''>
<returnCode code='12'>Environment 'DEV' could not be initialized for user,
check user, pwd and environment attribute values</returnCode>
</jdeResponse>
Nov 12 '05 #1
2 2880
One of the ways is -

XmlDocument doc = new XmlDocument ();

doc.LoadXml

(

@"

<jdeResponse type='callmethod' user='JWRIGHT' pwd='JWRIGHT' environment='DEV' session=''>

<returnCode code='12'>

Environment 'DEV' could not be initialized for user, check user, pwd

and environment attribute values

</returnCode>

</jdeResponse>"

);

Console.WriteLine (doc.DocumentElement.FirstChild.Attributes [0].Value);

In case you are using XmlReader:

XmlDocument doc
"AlBruAn" <al*****@hotmail.com.(donotspam)> wrote in message news:8A**********************************@microsof t.com...
An application I'm helping develop transmits XML to an ERP and receives an
XML statement showing the result of the transmittal to the ERP. I've pasted
a copy of one of the response XML statements. I have no trouble retrieving
the statement "Environment 'DEV' could not be initialized for user; check
user, pwd and environment attribute values", which we're storing in our SQL
Server. However, I also need to retrieve the value for the code attribute,
which is 12 in this case, to pass back up to the user; retrieving that value
is the sticking point. How do I go about accomplishing that?

<?xml version='1.0'?>
<jdeResponse type='callmethod' user='JWRIGHT' pwd='JWRIGHT'
environment='DEV' session=''>
<returnCode code='12'>Environment 'DEV' could not be initialized for user,
check user, pwd and environment attribute values</returnCode>
</jdeResponse>

Nov 12 '05 #2
Thanks, that's the answer...I'd tried nearly everything BUT that!

"Mujtaba Syed" wrote:
One of the ways is -

XmlDocument doc = new XmlDocument ();

doc.LoadXml

(

@"

<jdeResponse type='callmethod' user='JWRIGHT' pwd='JWRIGHT' environment='DEV' session=''>

<returnCode code='12'>

Environment 'DEV' could not be initialized for user, check user, pwd

and environment attribute values

</returnCode>

</jdeResponse>"

);

Console.WriteLine (doc.DocumentElement.FirstChild.Attributes [0].Value);

In case you are using XmlReader:

XmlDocument doc
"AlBruAn" <al*****@hotmail.com.(donotspam)> wrote in message news:8A**********************************@microsof t.com...
An application I'm helping develop transmits XML to an ERP and receives an
XML statement showing the result of the transmittal to the ERP. I've pasted
a copy of one of the response XML statements. I have no trouble retrieving
the statement "Environment 'DEV' could not be initialized for user; check
user, pwd and environment attribute values", which we're storing in our SQL
Server. However, I also need to retrieve the value for the code attribute,
which is 12 in this case, to pass back up to the user; retrieving that value
is the sticking point. How do I go about accomplishing that?

<?xml version='1.0'?>
<jdeResponse type='callmethod' user='JWRIGHT' pwd='JWRIGHT'
environment='DEV' session=''>
<returnCode code='12'>Environment 'DEV' could not be initialized for user,
check user, pwd and environment attribute values</returnCode>
</jdeResponse>

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Prasad Karunakaran | last post by:
I am using the C# DirectoryEntry class to retrieve the Properties of an user object in the Active Directory. I need to get the First Name and Last Name as properties. I know it is not supported...
2
by: js | last post by:
I have a table rendered with XSLT. The first column has a radio button controls for user to make a selection for a particular row. All the values in the remaining columns are all concated with a...
1
by: David C. allen | last post by:
I have created a simple Client-side SOAP Extension for a webclass that I have. When I apply the extension attribute to the the calling function in the proxy class I get an error 'Value cannot be...
2
by: Jay Bienvenu | last post by:
I cannot create new Web applications in Visual Studio .NET 2003. I get this error message: "Visual Studio .NET cannot create or open the application. The likeliest problem is that required...
2
by: epigram | last post by:
I'm responding to a button click event on an asp.net web form. I then need to retrieve the value from a TextBox control and I want to compare it against the control's previous value to see if it...
0
by: zipzap | last post by:
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:fp="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fp"> ...
1
maxamis4
by: maxamis4 | last post by:
Hello folks, Here is the backgroup. I am creating an agent that can find a user in LDAP and return the last logon date. Now i am not sure if with active directory you can user the...
1
by: gudipati | last post by:
hi,i have one problem.actually we can retrieve data from access. what is my requirement is when i retrieve data from access i want to store in text areas. finely,we can store if they r textboxes...
2
by: mlb5000 | last post by:
I seem to be having issues validating an XML document using my schema. Both are below: The Schema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.