Separate Assembly for each service

Jun 3, 2009 at 8:03 PM

All,

I am creating 4 wcf services using wssf. Ideally all the code compiles and fits into Service Implementation dll (single one). I need one of the services to be generated in a separate assembly.

Is there any way to achieve this or do i need to create 2 wssf solution structures separately?

 

Thanks,

Naveen.

Developer
Jun 4, 2009 at 11:12 AM

You can update or use a separate PMT for the service model of your WS that you want to separate and redirect the code gen for the service implementation project. As I said, you may do this updating the PMT used by that model to the separate implementation project you want.

Jun 18, 2009 at 3:18 PM

I did not understand this clearly what do you meant by PMT and how to do this?

Could you please give me more details?

Did you mean to create a separate model for each service and then each service will be generating 4 dlls (data,message,fault contracts and service implmenttion etc...)

 

Thanks,

Naveen.

Developer
Jun 18, 2009 at 5:51 PM

Naveen,

The PMT or Project Mappting Table is the file that contains all the mappings between projects and roles (refers to each model element and its code generation target).

You can find further details on this here: http://servicefactory.codeplex.com/Thread/View.aspx?ThreadId=18392

I mean to create a separate model file for each service but you can reuse all your dlls with all your services. For this, you may need to update the PMT by hand so you can add new project elements by getting the project GUID from each project file and settng the role with the intellisense provided by the PMT schema.

There's also this thread that discuss about multiple service contracts: http://www.codeplex.com/servicefactory/Thread/View.aspx?ThreadId=24467

 

Jun 18, 2009 at 7:37 PM

Ok.

If i have 3 service contracts bound to 3 different implementation projects, will i be having 12 dlls? ( iam using only data,message,fault contracts along with service implementation).

Also it looks like i can map one data contract to only one implementation project. Then how can i share the same datacontract across more than one service?

 

Thanks,

Naveen Kumar.

Developer
Jun 18, 2009 at 9:15 PM

Yu can have 3 Service Contract models that use the same PMT which means that you will end up with only one project for role (1 Implementation, 1 Message Contract, 1 Fault Contract and 1 Data Contract).

If I got it right, you only need 3 different SC that will reuse the MC a DC models. After generating the code, you will end up with 3 implementation classes and 3 service contract classes (Interfaces).

Jun 19, 2009 at 1:12 PM

yes. i want to share the MC,FC and DC but i want a separate implementation project for each service.

Also, it may be required that i have 1 DC to be shared among all the 3 services and 2 individual DC's for 2 services.

How can i achieve this?

Thanks,

Naveen Kumar.

Developer
Jun 22, 2009 at 10:21 AM

As I mentioned above, you first need to have one PMT for each service and you need to point your Service IMplementation "Role" to the project you want. So basically your PMTs will be the same but the implementation role that will have a different implementation project. (you may also specify a different service contract project as well).

The way to manipulate the PMT is as I described in my second post above.

Regards,

Hernan