REST in WCF for clients without .NET dots

I read a lot of articles about the differences between REST and SOAP. I just summarize a few lines, please let me know if this is not the case.

  • SOAP is a protocol that uses HTTP, TCP, etc. to send messages, but REST uses only HTTP to send messages.

  • SOAP only sends messages in XML format, but REST uses JSON or XML.

  • REST does not include the same traffic costs as SOAP (because SOAP involves complex WSDL XML generation).

I read that WCF was designed to provide interoperability. I developed REST services on .net and the client was a mobile device (not a .net client). This one I experienced and went live.

Having said that, my question is ...

Has anyone developed a basic WCF service service and provided this to a .net client like Java, mobile devices, etc. to make it compatible? Is it possible for non.net clients to consume WCF besides REST ?

+7
soap rest web-services wcf wcf-binding
source share
4 answers

Yes, you can use the WCF service with any SOAP or REST client.

SOAP is a protocol that uses HTTP, TCP, etc. to send messages, but REST uses only HTTP to send messages.

It is too broad to answer either yes or no. Strictly related to your question, we have these characteristics for SOAP:

  • SOAP is a protocol;
  • SOAP messages can be sent via HTTP, TCP, SMTP, etc. (in fact on any protocol). SOAP is a messaging protocol used on top of another transport protocol;
  • The most commonly used protocols for SOAP are HTTP and HTTPS;

Now the specifications for REST:

  • REST is an architectural style of building applications;
  • REST is not actually connected with the HTTP protocol; it can use any transport protocol;
  • Everyone does REST with HTTP and HTTPS;

SOAP only sends messages in XML format, but REST uses JSON or XML.

SOAP can only send XML messages, this is part of the protocol. In fact, you need to use a specific format for XML with envelope, header, and body tags.

REST is a representation of resources. A view can have any structure and can be in any format, not just XML or JSON (although the most common are XML and JSON);

REST does not include the same traffic overhead as SOAP (because SOAP involves complex WSDL XML generation).

WSDL is not involved in the actual invocation of operations; it is something separate to describe the SOAP web service. REST has something similar (albeit not very usable) called WADL . You need to output / unmount your data using SOAP and REST, so overhead in most cases is not a problem (the SOAP envelope is not so big).

Has anyone developed a basichttpbinding WCF service and provided this to a non.net client such as Java, mobile devices, etc. to make it compatible? Is it possible for non.net clients to consume WCF besides REST?

That an idea with web services (SOAP or RESTful) should be called from any clients. This is a communication method between two machines. The implementation of the machines does not matter (Java, C #, PHP, Python, etc.).

WCF is a web service framework that can provide a service as a SOAP or REST API. It can be called from any client.

+4
source share

I think you misunderstood some key points.

  • Both REST and SOAP are web service protocols that play over HTTP. I think you do not need to care about HTTP, TCP or UDP because they are lower level protocols ...

  • SOAP wraps everything inside an XML envelope, which imposes some overhead. This is why SOAP is considered worse in performance, but more formal and therefore more suitable for certain purposes.

  • Both SOAP and REST are independent of the platform on which they are implemented.

Therefore, yes, you could use the REST or SOAP service implemented in .NET with any REST or SOAP client . You should also know that you can implement your web service functions using WCF and change the endpoint between SOAP and REST by simply changing some configuration parameters.

I hope I helped!

+4
source share

Yes, you can use WCF services, except Rest for clients without .net. WCF basically allows you to create web services. The goal of a web service is that it provides cross-platform functionality.

Rest and Soap are web services, but for different purposes. It depends on your requirement that you want to use. Rest works only with the http protocol and can be easily called through a URI and can also perform CRUD operations through a URL. It can also be called from web browsers.

However, soap also supports cross-platform communication, but a client who wants to use soap must have the support of soap tools. It cannot be called from the browser. Almost every language currently supports SOAP api.

The service that you open with basichttpbinding is a soap service, and yes, it can also be called from non.net clients.

+3
source share

Go with web apis instead of wcf services for relaxation.

0
source share

All Articles