I want to ask if i built my server-client application using WCF technique can i connect java client application and objective-c client application with this server technique . because i want to build cross-platform application but i want the server to be c# server
Can I connect them together or not ?
is there another technique for the server application using c# ?
Yes you should be using RESTful service in order to create cross platform service. this way you can access your wcf service methods using
http://yourdomain.com//service.svc/users/{username}/bookmarks?tag={tag}
But there is a problem with consuming restful service you need to implement authentication in order to secure them properly to avoid DOS attack and other malicious use. Best approach to secure restful service is to use Hashing paramters in every service call. hash param could be derived from a secretkey,datetime, message salt etc.. for more info check this.
WCF, RESTful Web Services and custom authentication
I would suggest you should be creating restful service in JSON format so that it will be light weight and cause less overhead on data package.
http://www.codeproject.com/Articles/327420/WCF-REST-Service-with-JSON
Regards.
Related
I have website build using python and I want to connect with point of sell in the client side
there is any way to send data and get result from windows service or any other way ?
You can create and send an HTTP/HTTPS request according to the configuration and specification of the WCF of the service you want to use.
WCF and Python
How to post complex type to WCF using Python's requests?
However, it may not be possible.
WCF with netTcpBinding + cPython
Please start with obtaining service specifications.
I need to write a client-server application. First of all, I'm going to write an application server. Also my app server should connect to database(MS Sql Server) and give data from it to client app. So, as I know, I should use WCF. Is it a good idea? Maybe I need to take a look for something else?
Lets start with client-server architecture.
Assuming you have finalized that you need client and server, but have you decided carefully the architecture? I mean what type of server and what type of client you are going to create?
Let's see the options here:
Server
1. What type of hosting you are going to use?
2. What type and how much load your server needs to handle?
Client
1. Type of consumer of your service
2. Do client need to be deployed on local machine or it should be web based?
There are obviously more concerns than above. Initial design should be as flexible as possible.
So, now lets look at some solutions regarding architecture.
Server:
1. Application Hosted WCF server: Each time you need to manage the server lifecycle. Also, this is not scalable. So if you are looking for scalable architecture, you need to look more.
2. IIS hosted WCF server: This might be a good idea along with some architecture concerns as per your need.
3. Web Method: Obviously this came after WCF, but WCF is still in its place. So the main difference is at What is the difference between an asp.net web method and a wcf service?
Now Client:
1. ASP.NET: This will enable to use a single client app for every platform obviously because of HTML
2. WPF/WinForms: This is going to bit tricky to use as client as you need to deploy the client app on user machine and here comes the data security problem. In former you can directly use SSL or some other way to send data to browser. While in this if you are not using WCF with HTTPS and there are some proprietary data going over wires, it may be concerns.
If you are looking for cross platform usage of your server you can use HTML.
Conclusion:
You can use Server as WCF hosted service (either in IIS or in self contained application) and client as ASP.NET.
-----------------------------If it is not big enough requirement then you can use ASP.NET as server and then browser as client (No need to create client).----------------------------
You can create server either as WCF as web methods and deploy the client on user machine.
----------------------------
WCF is nice enough and it can handle your proprietary data types as well.
WCF is a nice thing, but i would use ASP.Net Self-Hosted Web-API. It's more modern. And you have a full rest interface, which is much more popular.
Here is a comparison: WCF and ASP.NET Web API
Here is a good starting point: Self-Host ASP.NET Web API 1 (C#)
I am developing a smart device application, which is going to communicate with a wcf service over wi-fi. As there is no option to add a service reference into a smart device project I decided to use the NetCFSvcUtil.exe. Everything works great!
But...
In the end I understood that the application must interact with the service in the background.
Having read this article Microsoft .NET Compact Framework Background Processing Techniques. I decided to use the Asynchronous Web Service Call. There http://msdn.microsoft.com/ru-ru/library/aa347733.aspx I found the /async parameter, but it appeared to not work for the NetCFSvcUtil.exe.
What can I do to get the async proxy for my smart device application? Is there a way to generate it or I'm expected to add async methods to the interface with my own hands? Maybe it would be suitable for .Net CF to use SvcUtil.exe to generate the async proxy in my case?
A further more information like which platform you are using to build your Smart phone application would be helpful.
I have done Blackberry development and consumed web services. There are two ways you could build your web services
RestFul Service - Consumption of web services would be pretty easy. Posting data could be a little pain as multipart form data is posted as stream in Wcf - Rest Starter Kit
Soap Service - If you decide to use SOAP, then for blackberry and Android you have to use preverified KSOAP -2 to send and receive soap messages between your app and the web service. If you decide to use KSOAP -2 , go back ASMX services. Somehow WCF services does not communicate with KSOAP -2 (due to change in SOAP version or something) where as a simple ASMX service works pretty smoothly. There are dozens of article which you could use to learn how to use KSOAP
he original idea was to host it in a windows service...
Windows Services could never be web facing. If you want any thing to be web facing, you need a Web Server !
In the end it worked. The "Add web reference" tool created a proxy with Begin/End async methods and the proxy interacted with the wcf service hosted by a simple console application (later a windows service) through the URL property of the proxy.
This question is a Follow up to This
In the project I am currently working on, I have a windows service which is actually a TCP/IP server which is connected to some set of hardware.. The windows service collects data from the hardware and stores into a database and may also send some configuration commands to the hardware.. There is an asp.net website through which the user may ask the windows service for some data or even send some configuration commands for hardware through windows service..
As of now I am considering to host WCF inside the windows service and make asp.net to consume this service.. So, I want the WCF to invoke some of the procedures in my windows service when the user requests through the website.. is it possible? if it is please explain..I have searched a lot for this type of communication but all in vain.. if it is not possible suggest me some alternative approach to WCF... Please help, will be grateful.
If you make your WCF service a singleton you can create an instance to it and pass that to the ServiceHost. You can pass constructor an interface implemented in the windows service which the WCF service can use to talk to the Windows service - this interface implementation can act as a broker for the communication between the WCF service and the windows service
I have a WCF webservice that acts as a proxy between a WCF windows service and a client interface. This is done so that our program can have a central "state" server, while the webservices can be distributed.
Ideally i would like to cut out the middle IIS hosted WCF webservice serialization and feed the bytes sent by the client directly to the windows service via IIS. Is this possible?
Why not using NLB directly? I think that a cluster will do a better job distributing requests than a proxy WCF service.
It's possible but you'll want to not use WCF in the middle. The level of difficulty depends on the technology you're using for your transport. For example, if you're using BasicHttp (good ol' SOAP) you can write a proxy in ASP.NET that routes the bytes from the client to the server via an HttpWebRequest.
You also could consider installing a reverse proxy on your web boxes to route your WCF requests through to your central web service.