The shortest answer is: you don’t implement. The framework does all this for you.
This "simplification", which makes it look like you are calling local methods, is called RPC (remote Procedure call) - which, in my opinion, is one of the most interesting points of WCF and ASMX.
For "under the table" what happens is a sending and receiving of XML’s. However, all this is extremely regulated, with typing, and all the other advantages of making a local call. This "rule" is defined by means of a WSDL file, all webservices developed in WFC, by default you will have this file.
The WSDL also takes care of taking the types (classes) created in the webservice for client application. So, if there is a class Cliente
in the webservice, at the moment you create the reference for the same (this is usually done by Visual Studio) this type also happens to exist in the client project.
From there it is only send the object to the remote method that the framework will do all the "dirty work" for you. Obviously you can configure everything, change some things, even choose the data format (JSON, XML, etc.).
WCF is a framework for building service-oriented applications (SOA), you can read some very interesting things in Web Service Type Differences: SOAP, REST, XML.
I couldn’t understand your question.
– Leonardo Ramos Duarte
But if you are interested in creating webservices that work with you can search for topics like SOAP, WSDL and REST.
– Leonardo Ramos Duarte
I only find foolish examples such as a web servisse that exposes a method called
soma
which takes two integers and returns the result. Thus an application that consumes the service calls the method, passes the two integers and receives the result of the sum. What would be the method responsible for inserting a client, whose registration contains 30 fields? Create a method with 30 parameters one for each field?– Matheus Saraiva
Just to clarify. This procedure is done with sending and receiving XML under the table. This simplification, if I’m not mistaken, is called RPC (Remote Procedure call), it seems that you are consuming a local method, but in fact, a call is made to your webservice sending this data and weaving the result via XML.
– Jéf Bueno