Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 391
  • Last Modified:

How to debug webservice method which use session?

I've 100 webservice methods. I'm using Webservicestudio to test the methods. I would like to test method called UpdateEmployee which uses Session variable Session["EmpID"].

The session variable Session["EmpID"] is set in another method called Login. I would like to debug the method UpdateEmployee.

They are two different methods but need one session variable set in another method should be present.

How to achieve it? Kindly suggest.
0
Easwaran Paramasivam
Asked:
Easwaran Paramasivam
  • 4
  • 2
  • 2
  • +1
1 Solution
 
Kamal KhaleefaInformation Security SpecialistCommented:
hi

you can add a piece of code to insert the data into data base after each line of your code

for example

my functionWebServuce()
InsertToDB("Enter WebService")

code 1
code 2
code 3
InsertToDB("Execute Code 3")



end function
0
 
Easwaran ParamasivamAuthor Commented:
My problem is that the session variable set in one method how to retain in another method?
0
 
Kamal KhaleefaInformation Security SpecialistCommented:
Try to pass it as a parameter to the other webservice
Or store it in the database and let the other webservice
Read it from data base
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Easwaran ParamasivamAuthor Commented:
Both services are working fine. But wanted to test the second method alone independently.
0
 
CodeCruiserCommented:
Pass EmpID as a parameter to the method?
0
 
Easwaran ParamasivamAuthor Commented:
No.. It is set in Session by another method.
0
 
CodeCruiserCommented:
That was a suggestion actually.
0
 
apeterCommented:
split the method into two. Where one method just has session code and call another method by passing the data. In this way, you test the logic by testing the second method. Hope this helps.
0
 
Easwaran ParamasivamAuthor Commented:
Thanks.
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now