Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old February 21st, 2006, 03:35 PM
XML newbie: Urgent pls help!
Guest
 
Posts: n/a
Default VB.Net: how to carry SessionID(its value ) from 1 function to othe

If I get SessionID in 1 function how do I carry that SessionID(value of this
SessionID) to another function or another form within the same project
  #2  
Old February 21st, 2006, 05:55 PM
Onawole, Clement Oladapo
Guest
 
Posts: n/a
Default Re: VB.Net: how to carry SessionID(its value ) from 1 function to othe

Winforms or webforms?

In Winforms, u can make the SessionID a public or internal property of the
form and in WebForms use the Session object to hold this value.

"XML newbie: Urgent pls help!"
<XMLnewbieUrgentplshelp@discussions.microsoft.co m> wrote in message
news:4350B554-0144-474C-893C-2269C59F75C6@microsoft.com...[color=blue]
> If I get SessionID in 1 function how do I carry that SessionID(value of
> this
> SessionID) to another function or another form within the same project[/color]


  #3  
Old February 22nd, 2006, 07:25 PM
XML newbie: Urgent pls help!
Guest
 
Posts: n/a
Default Re: VB.Net: how to carry SessionID(its value ) from 1 function to

I am using Vb.Net windows application and I logon to the remote server. Once,
I logon, I get the SessionID.

like.....
If Not HttpWResponse Is Nothing Then
Dim strm As Stream = HttpWResponse.GetResponseStream()
Dim encode As Encoding =
System.Text.Encoding.GetEncoding("utf-8")
Dim sr As New StreamReader(strm, encode)
'Dim XmlRead = New
XmlTextReader(HttpWResponse.GetResponseStream())
'xmlDoc.Load(XmlRead)
xmlDoc.Load(sr)


Return xmlDoc
Console.WriteLine("Response: {0}", sr.ReadToEnd())

Her, sr.Read to end goes like this:Response:<?xml version = '1.0'
encoding='iso-8859-1'><LoginResponse xmlns="
blahblah><status>success></status><SessionID>.....</SessionID></LoginResponse>

In my class, I declare

Dim g_SessionID As String

Now, I want to use this Session_ID in another function like this:
Private Sub btQueryAssetList_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btQueryAssetList.Click

Dim queryAssetListXml As String
Dim queryAssetListResponse As XmlDocument

queryAssetListXml = "<?xml version='1.0' ?>" & _
"<QueryAssetList2
xmlns=""urn:schemas-tms:QueryAssetList2"">" & _
"<SessionID>" & g_SessionID & "</SessionID>" & _
"</QueryAssetList2>"

queryAssetListResponse = SendXmlRequest(queryAssetListXml)

But, when I run the pgm I notice that I don't get the value of Session_ID
read/stored in the queryAssetListXml. How should I do this

I appreciate ur quick response and thanku in advance.


"Onawole, Clement Oladapo" wrote:
[color=blue]
> Winforms or webforms?
>
> In Winforms, u can make the SessionID a public or internal property of the
> form and in WebForms use the Session object to hold this value.
>
> "XML newbie: Urgent pls help!"
> <XMLnewbieUrgentplshelp@discussions.microsoft.co m> wrote in message
> news:4350B554-0144-474C-893C-2269C59F75C6@microsoft.com...[color=green]
> > If I get SessionID in 1 function how do I carry that SessionID(value of
> > this
> > SessionID) to another function or another form within the same project[/color]
>
>
>[/color]
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles