Solved

How to debug webservice method which use session?

Posted on 2014-02-22
10
378 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
[X]
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
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

749 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