Adding a parameter to the SOAP Header?

S

Savij

Hello,

I need some advice on how to implement a solution. I have a webservice
that gets request from both a Windows UI and a WebUI. I have setup my
business logic in such a way that a request from the Windows UI gets
run by a Windows UI specific business logic class and the Web UI
requests get handled by a Web UI specific business logic class (there
is inheritance going on, but it's not relevant to this question).

Right now I am passing in a string as a parameter to the method calls
in my web service that says "WIN" or "WEB" depending on where it came
from (this is a proof of concept project).

I would like to somehow add a parameter to the webservice context (or
SOAP Header, or some mechanism) so that I could do something like the
following:

Dim serviceProxy As New localhost.FooServiceWse
serviceProxy.RequestSoapContext.Add("UIType", "WIN")
serviceProxy.Bar(someparam)

Then in the WebService I would like to read out the UIType param from
the header. That way I would not have to pass the param to each web
method. I would rather include them in some collection.

I know this sample code is wrong (at least I can't seem to find the
value in the web service), but how should I go about doing this? Or am
I stuck passing the argument to every method in the web service class?

Thanks in advance!

-Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top