Data types in Pattern & Practices Web Service Software Factory

  • Thread starter Henrik Skak Pedersen
  • Start date
H

Henrik Skak Pedersen

Hi,

I am trying out the Web Service Software Factory to see whether I would like
to use it, for a new web service which I am creating. The web service is
responsible for reading data from a database and passing it on to a web
application. So I have a lot of business entities and generics lists.

My problem is that I have to create all data types double both in the
BusinessEntities project and in WebService.ServiceContracts. The data types
are exactly the same in both layer. Do I really have to do everything double
or can I just delete the WebService.DataTypes and reference the
BusinessEntities project instead?

Thanks
Henrik.
 
S

Steven Cheng[MSFT]

Hello Henrik,

I've also found your another thread regarding on a custom type with Generic
List member issue. I haven't noticed that you're using the "Service
factory", now I get it here. As for the "Service Factory", it by default
provide a recommend structure of webservice solution architecture and mapp
each abstract solution layer to certain visual studio projects in a
template solution. And you're surely able to customize them as your
specific scenario.

For your scenario here, if you think duplicate the same custom class in
both busicness and service contact layer, you can directly modify the
service contract and implemention layer and use those classes used in
business layer. However, make sure those classes are well defined for using
in ASP.NET webservice since they'll need to be serialized in XML soap
message. The reason why the "service factory" will create two set of such
classes in both service contact and business layers are that the classes
used in business layer may contains many fields/methods that are specific
to busines logic rather than data/properties. And webservice layer only
need some light weight classes which concentrate on the data it will hold.


#Web Service Software Factory
http://msdn.microsoft.com/msdnmag/issues/06/12/ServiceStation/Default.aspx?l
oc=en#S3


Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Members online

No members online now.

Forum statistics

Threads
473,795
Messages
2,569,644
Members
45,357
Latest member
RuthEsteve

Latest Threads

Top