Solved

How to debug webservice method which use session?

Posted on 2014-02-22
10
379 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

707 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