XML exchange between service and client [closed]

1

I'm studying WCF and all the starting material I find all comes down to very basic things, exposing methods that get some parameters and return some value.

I need to create a web service that will be the interface between the database and external applications. External applications can do insertions, deletions, and changes to records.

I think this should be done via XML file exchange, ie for the external application to insert a record of a new client for example, it should send to the Web Service an XML with all the data needed to register the aforementioned customer.

How do I implement this?

    
asked by anonymous 15.01.2017 / 20:44

1 answer

1

The short answer is: you do not implement. The framework does all this for you.

This "simplification", which makes it look like you're calling local methods, is called RPC (remote procedure call) - which, in my opinion, is one of the most interesting points of WCF and ASMX.

By "down the drain" 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 a WSDL file, all webservices developed in WFC, by default they will have this file.

WSDL is also responsible for bringing the types (classes) created in webservice to the client application. So, if there is a Cliente class in webservice , the moment you create the reference to it (this is usually done by Visual Studio) exist in the client project.

From there, just send the object to the remote method that the framework will do all the "dirty work" for you. Obviously you can set everything up, 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 Differences Web Service types: SOAP, REST, XML .

    
16.01.2017 / 11:19