Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to debug webservice method which use session?

Posted on 2014-02-22
10
377 Views
Last Modified: 2014-02-28
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
Comment
Question by:Easwaran Paramasivam
  • 4
  • 2
  • 2
  • +1
10 Comments
 
LVL 16

Expert Comment

by:Kamal Khaleefa
ID: 39880289
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
 
LVL 16

Author Comment

by:Easwaran Paramasivam
ID: 39880442
My problem is that the session variable set in one method how to retain in another method?
0
 
LVL 16

Expert Comment

by:Kamal Khaleefa
ID: 39880613
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
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
LVL 16

Author Comment

by:Easwaran Paramasivam
ID: 39880950
Both services are working fine. But wanted to test the second method alone independently.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39882825
Pass EmpID as a parameter to the method?
0
 
LVL 16

Author Comment

by:Easwaran Paramasivam
ID: 39885337
No.. It is set in Session by another method.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39885364
That was a suggestion actually.
0
 
LVL 25

Accepted Solution

by:
apeter earned 500 total points
ID: 39893260
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
 
LVL 16

Author Closing Comment

by:Easwaran Paramasivam
ID: 39895251
Thanks.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question