NetDataContractSerializer equivalent for Silverlight? - wcf

Has anyone developed or know of a place where I could find a Silverlight implementation of NetDataContractSerializer?
This WCF and Silverlight Comparison states that Silverlight does not ship with an implementation of NetDataContractSerializer.
I'm hoping to avoid developing one myself.
Thanks!

I might be wrong, but I think the Silverlight version of CSLA includes some form of binary serializer. It's not compatible with NetDataContractSerializer I think, so you'll need to use it on both the server and client (CSLA comes in a Windows flavour too). You can get the full framework (with source) for free at http://www.lhotka.net/cslalight/

Related

Can F# TypeProviders be used in a Windows Store app?

I can't seem to figure out how to get F# TypeProviders to work in a Windows Store (C#) app.
As far as I can tell, TypeProviders can only be used in an assembly targeting the full .NET Framework, whereas Windows Store apps must target .NET Portable.
I have created an F# assembly and referenced the F# TypeProviders library, however when attempting to reference this assembly from my Windows Store app, I receive an error stating that the library could not be referenced.
Is there any way around this? I want to use F# TypeProviders to reference various data sources and then use the generated code/types in my Windows Store app. Anyone have experience with this?
UPDATE:
Just to be clear, I am asking if there is a way to use the standard F# TypeProviders (such as WsdlService) in a Windows Store App?
Looking at the other assemblies FSharp.Data.TypeProviders.dll is referencing, I don't think there is a way around this. Since most type providers are used for accessing a database in one way or another (ADO.NET, LINQ to SQL, EF), it references System.Data.dll which is not available in WinRT.
The only data sources supported by built-in type providers that can be used in WinRT are web services and OData services. Their type providers maybe could be supported in a WinRT project if they were implemented in a separate library, but not in their current implementation.
Type providers are design/compile time facility. It should work in Portable library profile. It is maybe dependent on how is type provider library implemented, but in general, it should work.
For more info see F# type providers with Portable Library

Windows Phone 8 and REST

I need to use REST web services under Windows Phone 8, but there is no System.ServiceModel.Web namespace in WP framework so I cannot use WebGet and WebInvoke annotations.
How am I supposed to do HTTP GET calls using WCF? Is WCF supported in Windows Phone 8?
EDIT
The only approach that I can think off now is to use direct approach using HttpWebRequest and handle everything by hand. I wanted to avoid this since this approach brings too much boilerplate code inside the production code. This is why WCF is here. I can't even use RealProxy to implement some basic facilities myself since it's not supported either. The only solution that brings some automation and removes boilerplate code is to use dynamic and DLR features with DynamicObject, that will resolve the calls in runtime, but this will strip me of from static compiler checking.
Why did Microsoft remove crucial parts of framework from WP8? I don't get it.
Why did Microsoft remove crucial parts of framework from WP8?
They were never present. Such APIs would be considered features. And with frameworks like RestSharp there's little need to trouble yourself with writing anything by hand.

NET Remoting and MarshalByRefObject is really dead?

I'm working on a project requiring inter-AppDomain-intra-process and inter-process-intra-machine communication. Yes... I know... NET Remoting is widely considered a legacy technology but I'm facing with two very special problems and maybe in these scenario WCF is not a full replacement of NET Remoting.
1) inter-AppDomain-intra-process communication
The application I'm working on start and need to search and load one on more addins. I wish to load each addin in a separate AppDomain. I need a way to create the each Addin instance in his AppDomain and call some interface methods of this instance at some point. Here NET Remoting is the only way, right? Moreover if we wish to apply the System.Addins paradigm, apparently based only NET Remoting and not marked as obsolete...
2) inter-process-intra-machine communication
Here I can for sure expose from my application a WCF service and call this service from my client using Named Pipes.
What I really want to do is to expose an object model from my application, so that my application can be automated from some NET client, much like the OLE/COM Automation object model exposed by Excel. Any COM Client can get an object reference to Excel.Application and query open documents, open some new documents and so on.
I think WCF is good to communicate in a platform independent way. But in this case I need only to communicate from Net client to Net application on the same machine. WCF service phylosophy don't allow, I think, to expose a rich object model with objects, collection, field, static member, method overloading... Or I'm wrong?
Please excuse my bad english and my perhaps newbie question.
You can read answers to a similar question here: Is .NET Remoting really deprecated?
I can add that I used .NET Remoting recently for relatively simple bi-directional inter-process communication, and all went almost seamlessly, so I can say it is still very usable after all the years of not being actively supported by Microsoft.
As for COM, if you have strong requirements for your product to be accessible by COM-clients, I would suggest to implement COM interfaces explicitly, via COM interop. Also, there is an interesting article about using COM and .NET Remoting together that might be of interest: http://msdn.microsoft.com/en-us/magazine/cc164085.aspx

System.Data.DataTable in Silverlight 4?

Does anyone know if System.Data.DataTable is now supported in Silverlight 4 beta? In the past I’ve used this for databinding in ASP.NET and WinForm projects where the UI and objects needs to be constructed at runtime. If not, is it in the road map?
No this is not in SL4 and is unlikely to ever make it into later versions either. It represents an older approach to data access. In SL you would be expected to integrate with Entity Framework via WCF for this sort of functionality.
Codeplex here have developed a lightweight datatable that can get you by in some situations
There is an implementation for DataTable in Mono . I tried to port it to Silverlight once but it has a lot of dependencies in Xml so I couldn't port the whole things.
Yes. It would be great if we can get light-version of it.
ComponentOne have an implementation of the DataTable

Adding comments to a WSDL output from WCF/.Net

based on the WSDL spec from W3 there is the possibility to add "wsdl:document" tags to the WSDL output so that people using that webservice have a better explanation/documentation about this webservice.
Does anybody know how to make WCF use these comments/descriptions, or how to write the code in C# that those comments are exported as part of the wsdl?
Thanks, Michael
It seems that the community project WCFExtras on GitHub provides a work-around the limitations of .NET 3.5.
If you're doing your design / coding in C# classes, adorned with [ServiceContract] and [OperationContract], then I don't know of any way to export documentation you might have on those classes and methods into the WSDL, unfortunately.
I was appalled by that too - I expected any /// comments on my classes and methods to show up in the WSDL - no luck :-(
Our solution now is this:
1) we create a basic "mockup" of our service interface with all operations in C#
2) we compile that into an assembly
3) we extract the metadata (WSDL, XSD) from that assembly and then throw away the C# "prototype"
4) we manually add comments (xs:annotation/xs:documentation) to the WSDL and XSD
5) from now on, the WSDL/XSD are the master - and we generate our interface from those descriptions
Cumbersome and annoying, but it works fairly ok for us.
I sure hope VS2010 / WCF 4.0 will bring us a bit more support in this area !!
Marc
http://msdn.microsoft.com/en-us/library/aa717040.aspx
I think this will do what you want but it only will work for .NET clients.
WCF won't do it on it's own unfortunately. There are extensibility points for WSDL generation that you can use to accomplish this at least partially: Look up the IWSDLExportExtension interface.
I have a small example on how to implement a simple WSDL export extension up on my website which might help you get started.
[WebService(Namespace = "XXXXXXXXXXXXX", **Description**="V0.2.42")]
Description put whatever you want in the .NET 4.0, not sure which versions... Probably a little late in answering, but answers seem more complex than required to add a blurb to WSDL only devs see.