0

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.

Kyle
  • 1,366
  • 2
  • 16
  • 28

1 Answers1

0

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

Peladao
  • 4,036
  • 1
  • 23
  • 43
  • 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 Sep 03 '10 at 01:46
  • Good to hear it is solved. Don't forget to accept the answer :) – Peladao Sep 04 '10 at 13:33