I have written a Web service in .Net 2008, with following Web method -
Public Function GetCurrency(ByVal ID As Guid) As Currency
Dim mCurrency As Currency = Currency.GetCurrency(ID)
WHERE 'Currency' is CSLA.net object. WHILE running web service its giving subjected error.
PLEASE guide me as I am new to this.
This is a frequently asked question. Frequent enough that it is covered in the FAQ:
It is also the subject of Chapter 21 in the Expert 2008 Business Objects book.
In short, you can't use the XmlSerializer, DataContractSerializer, JsonSerializer, or the other more limited serializers to directly convert a CSLA object into and out of a data format.
And you shouldn't want to do this anyway. It would be an architectural disaster to tightly couple your internal object design to an external interface. Especially a service interface, because they are really hard to version in any case.
Can you please explain how should I work arround in this situation.
As I said, Chapter 21 explains in detail. In summary:
There's also a lot of information (mostly architecture related) on my blog in the Service Oriented category:
Copyright (c) Marimer LLC