how do I pass value from one WCF to another WCF

0 votes
I am creating WCF using .net. I have one WCF named login and another WCF named as addCandidate. So when I call login, it will take username, password and applicaiton URL as login information and generate Userdata and cookie out of it. In the next requrest I need to send userdata with cookie and also I need to add candidate information which requires to be added.


I want to create WCF in such a way that I will not have to resend data I just received such as cookie and userdata. Is there anyway to create object and share it with next WCF call?

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Answer

answered by (171 points)
0 votes
You can not really do that. As per the WCF specification, every WCF is independent. So, you can not pass data from your first WCF to another. All you have to do it, get response from the first WCF. Create request from the first response and pass on that.

In your scenario, you first enter login and get cookie as you are logged in. After getting cookies, you can either store the session in the memory or db of the server and generate GUID. With second request pass the GUID, retrive the session data where ever it stored and use it.

Hope that answered your question.