473,666 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 "Environmen t '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='callmetho d' user='JWRIGHT' pwd='JWRIGHT'
environment='DE V' session=''>
<returnCode code='12'>Envir onment 'DEV' could not be initialized for user,
check user, pwd and environment attribute values</returnCode>
</jdeResponse>
Nov 12 '05 #1
2 2900
One of the ways is -

XmlDocument doc = new XmlDocument ();

doc.LoadXml

(

@"

<jdeResponse type='callmetho d' user='JWRIGHT' pwd='JWRIGHT' environment='DE V' session=''>

<returnCode code='12'>

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

and environment attribute values

</returnCode>

</jdeResponse>"

);

Console.WriteLi ne (doc.DocumentEl ement.FirstChil d.Attributes [0].Value);

In case you are using XmlReader:

XmlDocument doc
"AlBruAn" <al*****@hotmai l.com.(donotspa m)> wrote in message news:8A******** *************** ***********@mic rosoft.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 "Environmen t '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='callmetho d' user='JWRIGHT' pwd='JWRIGHT'
environment='DE V' session=''>
<returnCode code='12'>Envir onment '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='callmetho d' user='JWRIGHT' pwd='JWRIGHT' environment='DE V' session=''>

<returnCode code='12'>

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

and environment attribute values

</returnCode>

</jdeResponse>"

);

Console.WriteLi ne (doc.DocumentEl ement.FirstChil d.Attributes [0].Value);

In case you are using XmlReader:

XmlDocument doc
"AlBruAn" <al*****@hotmai l.com.(donotspa m)> wrote in message news:8A******** *************** ***********@mic rosoft.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 "Environmen t '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='callmetho d' user='JWRIGHT' pwd='JWRIGHT'
environment='DE V' session=''>
<returnCode code='12'>Envir onment '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
29204
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 with the ADSI NT Provider and only supported in the LDAP Provider. So given an UserId (UID) how can I read the First Name and Last Name using LDAP Provider. If anybody can help me with a C# sample code it would of great help. Thanks in advance.
2
11206
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 &#xA0; (blank). I need to retieve the text in each cell of that row if the radio button on that row is clicked. Each <TD> has a numeric ID so that I can use it with document.getElementById().innerText method. I use Javascript to assign some...
1
5721
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 null'. When the extension attribute is not applied it runs fine. The wierd thing is that it does not appear to be an error within the SOAP extension because I break-pointed it and when the proxy function gets called the SOAP extension runs fine....
2
9773
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 components are not installed on the local Web server. Run Visual Studio .NET setup and add the Web Development commponent." So I ran the Visual Studio .NET setup and added the Web Development component...and get the same problem. The thing is that...
2
3946
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 has changed. How can I retrieve a control's previous value from the ViewState? I know that I could save the control's previous value in a session variable, reretrieve it's value from the db, etc. But it would appear the control's previous value...
0
1756
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"> <xsl:template match="/"> <xsl:choose> <xsl:when test="local-name(fp:AC_FlightPassesRS/fp:Success)='Success'">
1
4097
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 SAMAccountName to retrieve the last computer the users logged on to. But i am looking for a place where i can learn this information. I was hoping someone out there could point me in the right direction. Below is my code which i have been working on. It can...
1
3932
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 using "value" attribute.see for sample <input type="text" name="lastName" maxlength="50" size="20" value="<% If (Request("visitationID") <> "") Then response.Write(rstvalues("lastName")) End If %> "></td> but in TextArea we have no option...
2
18139
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 xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Receivers" > <xs:complexType> <xs:choice maxOccurs="unbounded"> <xs:element ref="MulticastReceiver"/>
0
8440
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8863
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8780
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8636
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7378
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4358
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2005
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.