Add modeling edition to an existing solution

Topics: Service Factory Modeling Edition Forum
Jan 18, 2008 at 9:52 AM
Is it possible to add Service factory Modeling Edition to an existing solution in VS2008 or do you have to create a new solution with modeling edition and copy your old files to the new solution?
Jan 18, 2008 at 11:33 AM
You can use your existing solution and add WSSF:ME. You can follow these steps:
  1. Enable the 'Service Factory:Modeling Edition' guidance package in your solution
  2. Open Add New Project and select 'Other Project Types', and there select 'Service Factory : Modeling Edition'.
  3. Right click on a solution folder that contains your projects that will get all the generated code from the factory (If you don't have your projects grouped under a solution folder you may not see the recipe that creates and populate the 'Project Mapping Table' required to maps projects, roles and model elements).
  4. After running this recipe 'Populate Project Mapping Table' you will get the PMT file (\Solution Items\ProjectMapping.xml). Notice that the recipe will try to infer the role name from each project prefix name (XXX.DataContracts or XXXDataContracts), otherwise it won't add the project entry and you may have to add it by hand. The same goes to projects that may have more than one role assigned, in case you want to group into one project different roles like DataContracs, ServiceContracts, MessageContracts, etc.
  5. Now you may add new models to the model project added in step #2.
Jan 18, 2008 at 11:36 AM
What I've done is to create a new modeling solution and then copy the new model project into your existing solution directory. Then, choose Add Existing Project from the Project menu to add the model project to your existing solution. You also need to enable the guidance package using Tools->Guidance Package Manager. And finally, you may need to copy the ProjectMapping.xml from the new solution to the existing solution.
Mar 9, 2008 at 9:14 PM
I really find this very unclear. I hope there will come some tools or something that can make this migration from WSSF 2006 to WSSF ME less painfull. Could anybody give me to zip files, one with a WSSF 2006 project and one with the converted WSSF ME?
Mar 10, 2008 at 7:36 AM
Edited Mar 10, 2008 at 7:37 AM
Hi RightCoder,

The suggestions made by charlyfriend did not work in the Visual Studio 2005 version of the WSSF:ME, but I've just tried it again with the 2008 CTP, and it works!
Some notes though:
  • The model project must be located in the root of your solution (although the physical path can be different).
  • You may have to manually enable the guidance packages. Go to Tools->Guidance Package Manager->Enable/Disable Packages and then choose Service Factory : Modeling Edition.
  • The factory needs to know where to generate the artifacts to. The easiest approach is to select the root node of your solution and then choose Add->WCF Implementation Projects from the context menu. This will create a new set of projects for the appropriate layers of the architecture and configure the ProjectMappings.xml. If you already have projects like these, you must manually supply the GUIDs of the projects to the ProjectMappings.xml file.
Mar 10, 2008 at 11:23 AM
Thanks Dennis, but what about projects in VS 2005 created under WSSF 2006? Can I use the same approach here?
Mar 10, 2008 at 1:14 PM
You can, if you want, let the new factory generate its code into your old projects. But obviously, the newly generated code may be different from the code generated with the 2006 factory.
Mar 10, 2008 at 4:14 PM
Yes, the newly generated code is very different and I may just stick to the old version when it comes to this service? My WCF service is pretty much a finished product that only will need to be maintained in the future. I cant see that I will win alot by using a lot of time to make my WCF service work under VS 2008 and WSSF ME. Or am I wrong here?

It may come one day when I install a new version of GAX that is not compatible with WSSF (December 2006). So in the long run I may be better off using the latest version of WSSF?

If so, what should I really do? How do the three models in ME refer to the projects under source (Business Logic, Resource Access, Service Interface)? Do the models in ME only refer to the projects under Service Interface (DataContracts, FaultContracts, ServiceContracts, ServiceImplementation)?

Is it best to just open the VS2005-solution of my WCF/WSSF in VS2008 and let it be converted or should I create a new WCF/WSSF-solution in VS2008 and make all the Service Interfaces and Data Contracts by hand in the designer and then copy over the cs-files afterwords? Sorry that I'm so stupid and clueless, I have not had the time to understand the concepts and models in the ME version. Please help!
Mar 10, 2008 at 10:59 PM
You can open your VS2005 solution and convert it to 2008 version. You will also find some notes about this in the documentation.
Regarding the rest of the comments, check out this thread:

Mar 11, 2008 at 3:23 PM
Ok. I'll be your pain in the ass now. Because I still have problems with my migration. I have opened my VS2005 (december 2006 version) solution in VS2008.
And I now have a ProjectMapping.xml file in a solution folder called Solution Items. My solution structure looks like this:

MyService (root folder)
-- Source
---- BusinessLogic (here I have copied over projects like Entities and other business logic from my old version of WSSF)
---- Resource Access (here I have projects that gives me access to datasources, COM servers etc.)
---- Service Interface (Here I have projects like DataContracts, FaultContracts, ServiceContracts and ServiceImplementation and Translators)
-- Tests
----- Host
----- Client

I have added a new project to the solution, a new Model Project, from there I added a new Service Contract Model this gave me a blank Service Contract Diagram. I want this to be filled with my Service Contracts already created in form of C# classes from my old version of WSSF. Do I have to design from scratch???!!

My WCF Service is pretty big and it generates a proxy with about 17000 lines of code that defines my service and contracts. I dont want to design all my contracts by hand, but do I have to? I would like to give the designer a reference to the ServiceContracts project and all my ServiceContracts and their operations is visualized in the designer, right?
Mar 11, 2008 at 7:58 PM
Regarding your first question, there Service Contract should be defined from scratch. There's no "Import From..." recipe that populates your SC model (read thread: No option to import from WSDL in designer).
The same goes to the Data Contract model but in this case, you can use an XML Schema file with all your contract types (you can get it from your WSDL file generated out of your old service) and use those types in your operations using XsdMessage elements in your Service Contract.
Mar 12, 2008 at 3:06 AM

charlyfriend wrote:
The same goes to the Data Contract model but in this case, you can use an XML Schema file with all your contract types (you can get it from your WSDL file generated out of your old service) and use those types in your operations using XsdMessage elements in your Service Contract.

Aren't there limitations on the XML Schemas used in an XSD Message Part? I thought they were limited to the sort of XML that the DataContractSerializer can handle. In particular, no attributes.
Mar 12, 2008 at 10:06 AM
You can use the XmlSerializer instead od DataContractSerializer and you will broaden the scope of valid schemas.
Mar 12, 2008 at 10:11 AM
Edited Mar 12, 2008 at 1:03 PM
Ok Charly, I have come to the conclusion that I dont need the models and diagrams given by the ME because I'm using an UML model that auto-generates my contracts anyway. I dont do this by hand. So if I still can use Visual Studio 2008, GAX 1.4 and WSSF ME and only use the functionality that in the old version of WSSF gave, like something like "Expose Service" I'll be happy (and I guess the "Add service reference" is now included in VS 2008 now?). I thought I could use the diagram-design-functionality more for visualizing my service but that seems not possible before it can be imported from WSDL in a simple manner.

So, to sum it up: Can you confirm this: I can install WSSF ME with Visual Studio 2008 and be able to just make use of the "Expose Service" so that my code or DLLs get moved to the Host-project so I can debug my service-code in VS 2008.

Right now I'm not able to run the host project because my service-code has not been published/exposed here yet. Is there a way to make the receipt "Expose service" available for me? Is this receipt available in the ME release too?

If not I'll have to stick with the VS 2005 and WSSF December 2006 release, but that will surely be a problem some day, when new versions comes etc. What do you think?

By the way is GAX 1.4 compatible with the WSSF December 2006 release? If not I'm not able to run it on the same machine as the Web Client Software Factory 2.0 that runs with GAX 1.4 and Visual Studio 2008.