How does Service.svc change in WCF when you start adding classes to the project?

  • Thread starter Thread starter Ronald S. Cook
  • Start date Start date
R

Ronald S. Cook

I was able to do my first Windows Communication Foundation test project and
all worked well.

But now I want to add a second class to my service.

There is that Service.svc file that has only the following in it:
<%@ServiceHost Language="VB" Service="MyService.clsCountry %>

But now I've added a class clsState to my service. What now, am I do do in
Service.svc?

Does each class need it's own Service.svc file? I.e. Country.svc,
State.svc? If so, that will mean running svcutil for every class I'll
have.. yuk.

Any guidance would be appreciated.

Thanks,
Ron
 
Ronald,

You are right. You will have to generate a new service (svc) file for
each class that you wish to expose, and subsequently, a new run of
svcutil.exe on the client side.

You could just have one class that you expose, which is an amalgam of
every class that you wish to expose. This way, you only have to expose one
svc file. However, that will lead to an incredibly unwieldy class, and I
dont think you want that.

Hope this helps.
 

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

Back
Top