ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker SupportRetrieving environment variables in a .NET Compute Node

Post new topicReply to topic
Retrieving environment variables in a .NET Compute Node View previous topic :: View next topic
Author Message
sahilsaid
PostPosted: Tue Jun 19, 2018 6:39 am Post subject: Retrieving environment variables in a .NET Compute Node Reply with quote

Newbie

Joined: 21 May 2018
Posts: 5

I am trying to retrieve a string value from Local Environment Variable within IIB using .net compute node. I can retrieve it using java node but because of the requirement I need to use .net node.

With Java I was doing following to retrieve the value.

Code:
//in java
String firstName = rootElement.getFirstElementByPath("Variables").getFirstElementByPath("UserDetails").getFirstElementByPath("FirstName").getValueAsString();


With .net node, I have tried following in C# but haven't had a success yet.

Code:
 firstname = inputRoot["Variables"]["UserDetails"]["FirstName"].GetString();


Code:
IEnumerable<NBElement> variables = inLE.Children("Variables");


This environment is stored with eSQL like this.
Code:
Environment.Variables.UserDetails.FirstName = "somename"


I also looked at following document which was suggested on similar topic on this forum.
https://www.ibm.com/developerworks/websphere/tutorials/1112_thompson/1112_thompson-pdf.pdf

Any help or direction would be appreciated.
Back to top
View user's profile Send private message
sahilsaid
PostPosted: Tue Jun 19, 2018 7:46 am Post subject: Re: Retrieving environment variables in a .NET Compute Node Reply with quote

Newbie

Joined: 21 May 2018
Posts: 5

sahilsaid wrote:
I am trying to retrieve a string value from Local Environment Variable within IIB using .net compute node. I can retrieve it using java node but because of the requirement I need to use .net node.


I have manged to figure out what was the problem. I was storing them in the Global environment and trying to fetch it from local environment.

I had to do following to fetch first name from environment.

Code:
NBElement rootElement = inputAssembly.Environment.RootElement;
String firstname = rootElement["Variables"]["UserDetails"]["FirstName"].GetString();
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportRetrieving environment variables in a .NET Compute Node
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.