0

I have C# webservice webmethods hosted on a server and accessed by different applications(web,winforms etc).

Is there any way i can detect that these parameters are sent from winforms, these are from webservices on a webservice?

All they do is adding a web reference and passing parameters, i wish to see in my end what parameters they pass (to test some use cases).

Any thoughts?

Thanks.

Sharpeye500
  • 8,775
  • 25
  • 95
  • 143
  • What exactly is preventing you from doing that on the webservice end? I am assuming that's what you mean by "my end". – Oded Aug 12 '10 at 20:20
  • For ex. if they add a web reference in winforms and webforms and starting passing paramters to web methods like winforms - 100,200 is passed webforms - 300,400 is passed I wish to somehow get it for testing, i mean is there any way via webservice to detect that these parameters come from winform, these come from webform. – Sharpeye500 Aug 12 '10 at 20:24
  • Why not just check in the [WebMethod]? – John Saunders Aug 12 '10 at 20:38
  • @John Saunders - AFAIK, `[WebMethod]` in and of itself does not provide a way to tell what kind of client called it. How would you do that within the `[WebMethod]`? – Oded Aug 12 '10 at 21:03
  • @Oded: he said, "i wish to see in my end what parameters they pass". That can be done in the `[WebMethod]` – John Saunders Aug 12 '10 at 22:32

1 Answers1

1

If you want to differentiate calls from a webform vs a winform, you will need to build that into the method calls themselves.

For example, you could add a parameter to each method that maps to type of client and find out that way.

The whole point of web services is that they are client agnostic - so long as the call is correct, it doesn't matter what kind of application called the web service.

Oded
  • 489,969
  • 99
  • 883
  • 1,009
  • I want to get the parameters that is passed and check manually in db, as when i run the webservice via my test application it works, but when the same application when referenced, it doesn't work. In other words when i pass the same params directly as parameter and test webservice it works, but when it is referenced, parameters passed it does not work. – Sharpeye500 Aug 12 '10 at 20:34
  • @Sharpeye - I don't understand what you mean when you say "when it is referenced". Can you edit your question and post the relevant code? – Oded Aug 12 '10 at 20:36
  • I have edited, does it makes sense now, thanks for the inputs Oded. – Sharpeye500 Aug 12 '10 at 20:56
  • @Sharpeye - not really. In your comment to my answre, you are saying you have a problem. You don't even mention it in your question! – Oded Aug 12 '10 at 21:13