Solved

How to debug webservice method which use session?

Posted on 2014-02-22
10
374 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
 
LVL 16

Author Comment

by:Easwaran Paramasivam
ID: 39880950
Both services are working fine. But wanted to test the second method alone independently.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now