Monotouch WCF Self-Hosted NetTCP Example - wcf

Can anyone point me to a WCF Self-Hosted NetTCP example that works on Monotouch? I've searched for many hours and have come up with nothing.
I need nettcp for speed reasons (I'm transferring a lot of data between an iPad and an XP machine). And I would much prefer self-hosting rather than using IIS to keep things simple.
Many thanks in advance!

MonoTouch does not support NetTcpBinding. MonoTouch supports the same bindings that are available in the Silverlight 3 Client Profile, which is limited to BasicHttpBinding.

Mono WCF implementation is open source (just like the rest of Mono itself). You can, and some people do, include their own (not the MonoTouch versions) assemblies into their applications. That allows them to use some features not available in the Silverlight subset.
However this is not a simple "add source and recompile" scenario. Honestly there are many other technologies available (and well tested/supported) that could likely fit your requirements. I would have a long look at them before investing many hours into providing your own assemblies.

Related

Handle Wcf wsHttpBinding on Linux

I'm involved in a project with many others companies. We started to develop our systems at the same time but only at the end the communication problem was taken into account.
I've developed my system on Linux with Mono (Linux is mandatory for me). I have to communicate with a Windows .Net system which is exposing a Wcf web services. Unfortunately they told me only now they are using wsHttpBinding and I've just discovered that this communication protocol is not supported by Mono.
I'm here to ask if there is a way to communicate with that web service. They are not going to change the wsHttpBinding because is used by many other companies. I cannot change my OS and my code base is too big to leave Mono now. I can only add a layer (always on Linux) between my Mono implementation and their web services.
Any suggestions?
Microsoft has recently released the .NET source code as MIT licence (open source).
This means that, if something is not supported by Mono, you can just bring the code yourself and incorporate it, so that it becomes officially supported.
Some Mono developers have actually been doing this the past weeks to incorporate things that they had not implemented yet. So you could bring the wsHttpBinding along to Mono. An example of such a change is this commit.

PerSession WCF Service with Callback for Silverlight client

We would like to develop WCF service for SL clients, which should support session management (PerSession) and callbacks. The WCF service would be hosted as a Windows service.
What would be best WCF binding choice (wsdual, pollingDuplex, any other)? Please also provide for/against points.
Regards,
There are no others. Silverlight does not support WSDualHttpBinding. You can choose PollingDuplexHttpBinding or PollingDuplexHttpBinding.
Have been working a little more in this area and it appears this is an area of constant and recent change. As of Silverlight 4, NetTcpTransport and HttpTransport are both supported using either text or binary encoding. It appears SL5 delivers further enhancements.
There is an interesting benchmark app here which allows you to profile relative performance of the two protocols. Though it was built for SL4, you can download, update the target framework to SL5 and see how it goes. It is a great way to make sure you've got everything setup properly.
Using NetTcpTransport should mean you can also use PerSession instancing on the server.

is there any way to add non silverlight assembly to a silverlight project?

I want to add non-silverlight assembly to a silverlight project,
is there any way to do this? or what will be the other option to do ?
As Andrey writes, it's impossible to add a non-Silverlight assembly to a Silverlight project. If you really need to use it, you have no option but to run it server-side. You may already have a Web project that goes with the Silverlight project, and if so, that's where you should add a reference to this assembly.
The technology used to make remote calls from Silverlight to the web project is WCF RIA Services. The page I linked to contains plenty of documentation and videos to help you learn about WCF RIA Services.
There are, however, a few situations in which this approach won't work. Perhaps none of them apply to your circumstances, but since you don't provide any details about this assembly, I can't be sure.
If, for example, your assembly contains some WPF controls and you want to add them to your Silverlight application, you're out of luck. You'll have to find Silverlight-specific equivalents.
If you'll be calling this assembly frequently, you might find your Silverlight application spending a lot of time waiting for the server to respond. This could slow your application down significantly.
If your application needs to be able to run out-of-the-browser and disconnected from the internet (a requirement of my current Silverlight project), you will also be out of luck.
There are a number of things that I can think of that should work reasonably well over WCF RIA Services:
sending email, calling web services or various other network-related activities,
talking to a database,
mathematical calculations.
It is impossible because Silverlight has different runtime from full .net framework. The common way to solve it is to create WCF service that will have access to that assembly and provide remote access for Silverlight application.

Start with remoting or with WCF

I'm just starting with distributed application development. I need to create (all by myself) an enterprise application for document management. That application will run on an intranet (within the firewall, no internet access is required now, BUT is probably that will be later).
The application needs to manage images that will be stored within MySQL Server (as blobs) and those images will be then recovered by the app and eventually one or more of them will be converted to PDF.
Performance is the most important non-functional requirement.
I have a couple of doubts.
What do you suggest to use, .NET Remoting or WCF over TCP-IP (I think second one is the best for the moment I need to expose the business logic over internet, changing the protocol).
Where do you suggest to make the transformation of the images to pdf files, I'm using iText. (I have thought to have the business logic stored within the IIS and exposed via WCF, and that business logic to be responsible of getting the images and transforming them to PDF, that because the IIS and the MySQL Server are the same physical machine). I ask about where to do the transformation because the app must be accessible from multiple devices, and for example, for mobile devices, the pdf maybe is not necessary.
Thank you very much in advance.
WCF, only consider remoting if WCF presents some issue such as performance in your use case. You have many many more scaling and customisation options available under WCF.
Depends. If sending the images over the net presents an issue then it may have to be done locally. However as in (1) your existing suggestion seems ok.
See .Net Remoting vs. WCF for a similar question.
Definitely remoting if this is an option
Transformation - same box that the service is; since the service is going to funnel the images anyway - this is the best place. I would not put it on DB server, to better distribute the load and to separate non-db load from db specific load.
In addition, look into .Net 4.0 RIA services. They allow you best combo of .Net Remoting and WCF

Why it's not possible to host an ASP.Net web service other then IIS?

I am just curious to know the reason why it's not possible to host an ASP.Net web service other then IIS ? While in WCF it's possible to host a service in IIS, WAS or any console application.
Please clear the doubt..
ASP.NET is actually not specifically bound to IIS. The .NET Framework includes an HttpRuntime which may be used to write a custom hosting platform. You could easily write a console application, like you can for WCF, that will provide the ASP.NET runtime without IIS.
Technically speaking, you could also write an Apache module that hooked into either a separate .NET process hosting the ASP.NET HttpRuntime, or possibly hook directly into a .NET assembly. I don't know much about writing extensions to Apache, however assuming you can bridge the Apache unmanage to .NET managed gap, you would be able to host ASP.NET in Apache (which should be possible, you might need a native & managed C++ library to mediate.)
Microsoft's .NET framework is amazingly extensible. You can pretty much achieve whatever you set your mind to, if you have the will and the time (and perhaps the funds.) However, the .NET platform does encapsulate an immense amount of functionality, and it is up to Microsoft to choose how they spend their money. Naturally, they have their own business to worry about, and I would not expect them to expend tremendous amounts of money giving a leading edge to their competitors (it would be bad business, and quite a disappointing competitive practice, if you ask me.)