Hi,
I'm looking at a Silverlight application written using CSLA and I was wondering if there are any utilities available to deserialize data as seen in Fiddler, to show it in an ASCII/readable sense?
At the moment I can see requests with XML elements but as all the data is serialized, it's kind of hard to debug.
Thanks
Rory
IMHO, you should instead log on the server or the client. Stream could be quite large, and Fiddler will likely truncate it anyway. On both server and client you can implement custom proxy/server class and log from that class. You could de-serialize the data there and look for whatever information you are looking for.
thanks for the response :)
At the moment I only have access to the client and not the server so I guess I'll need to work from that end. Do you know are there is there any sample code I could look at for deserializing dataportal requests?
Thanks
Rory
if you download samples for version 4.3.1 http://www.cslanet.com/Download.html you will find InventoryDemo under Samples\Silverlight\cs. It has proxy class and host class, both doing compression of the stream. Instead of compression you can do logging. Without access to the server I think you will struggle though.
Thanks, I'll go look at them.
You're likely right about it being tricky without the server ..
I wonder what issues do you actually have in debugging.
If you have no access to the server side AND you also must have the same business objects assembly on the client side - then what is the issues you have to debug?
The problem with a custom Proxy is that this intercepts the data BEFORE it is deserialized - so you will only get the data, as- is, on the wire.
You should rather look into the IInterceptDataPortal interface as this hooks into the dataportal BEFORE or AFTER the data has been serialized/deserialized. This is a better place to do some custom logging.
/// <summary> /// Implement this interface to create a data /// portal interceptor that is notified each /// time the data portal is invoked and /// completes processing. /// </summary> public interface IInterceptDataPortal { /// <summary> /// Invoked at the start of each server-side /// data portal invocation, immediately after /// the context has been set, and before /// authorization. /// </summary> /// <param name="e"></param> void Initialize(InterceptArgs e); /// <summary> /// Invoked at the end of each server-side /// data portal invocation for success /// and exception scenarios. /// </summary> /// <param name="e"></param> void Complete(InterceptArgs e); }
This interface is introduced in CSLA 4.5.
Read more about it here: http://www.lhotka.net/weblog/MoreDataPortalEnhancementsForCSLA45.aspx
Hi,
Thanks for the information. In terms of the debugging, I'm doing a black-box security review of an app based on silverlight and CSLA, so it would be useful for that to be able to look at the content of messages as they go over the network, beyond just seeing the serialized data.
cheers
Rory
Copyright (c) Marimer LLC