views:

64

answers:

2

I have some Service class which is defined as InstanceContextMode.Single, and is well known in the hosting application. (The host creates an instance, and passes that to the WebServiceHost)

Hosting app:

WebServiceHost host = null;
SomeService serviceInstance = new SomeService("text", "more text");
host = new WebServiceHost(serviceInstance, baseUri);
Problem:
When I go to use the variables initialised when the service is created (ie, when a call is made to the service), they are either null or empty...

Am I wrong in assuming that as the instance being initialised in the hosting application is used for each request to the WebServiceHost?

Any pointers here would be great.

A: 

Bump. Any ideas or pointers would be greatly appreciated. :)

Kyle
A: 

Your assumption seems correct to me. Did you put the right code in the service constructor?

Peladao
Thanks, I did solve it but it was a while ago and I can't recall of the top of my head. Just one of those "what was i thinking" mistakes I think, but if i remember I'll write it up.
Kyle
Good to hear it is solved. Don't forget to accept the answer :)
Peladao