472,993 Members | 2,557 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,993 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 2858
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.