I have the following architecture for my project:
UI -> Web Server -> App Server -> Database
I am using SOA architecture for my project. My Web Service is residing on AppServer having BL (Business Layer) / BO (Business Object) / DAL (Data Access Layer). I am exposing the BL using Web Service. I am getting the service reference to this Web Service at WebServer by creating the proxy using WSDL.exe. Now my question is:
Do i need to have attribute to my BO (Business Object) to expose this to WebServer as below ?
<Serializable()>
Public Class MyClass
End Class
or we do NOT need this attribute at all ? I am in little bit confusion. BTW: My Web Server is a different machine and AppServer is a different machine.
No, you do not need this attribute on classes that are serialized by the XMLSerializer, which is what is used for web services.
As a point of clarification, the Serializable attribute is generally only needed when the object is serialized by an IFormatter implementer, such as BinaryFormatter or SoapFormatter, both of which are used in .Net Remoting.
This MSDN article was created for .Net 1.1, but still has a lot of good information.