asp.net - Accept Data With A Webservice C# .NET 3.5 -


I was curious to know how I would complete with the following webservices:

  1. < / Li>
  2. Accept a CSV or XML file.
  3. Process the file and place it in a SQL database.

Post should let me use a webservice I can not seem to find any resources that explain how to start something like this in all simple examples It is important to show how you can serve XML through a query.

I want to know how to accept the stuff and also how it will differ from upload control on a certified webpage. I do not think I really understand webservices and their benefits.

How is the user sending XML file interface with my webservice?

A web service is not really suitable to send an arbitrary file But if this is the only reason for creating a web service, then you can also stay with the HTTPS.

If you want to create a web service for that specific format or specific content in the file, the purpose of the ASMX or WCF web service is to Finding qualifications and strong typing (except for other things, but I'm sticking to the basics for this moment). Instead of trying to create some ugly XML or CSV Blob from the client's perspective and try to chuck it on HTTP, you use the actual service proxy with POCO classes:

  MyService service = New MyService (); Myadata Data = New Myadata () {id = 3, name = "test", date = date time.Now}; Service.Save (data);  

The Visual Studio (and equivalent tools in Java and some other platforms) will take care of creating a proxy for you, so in reality what you have to do is write the code above.

>

But if you are just trying to send any data, then you will not find it anywhere, because you can not generate a proxy for raw XML. Well, you can, but it will be just a XmlDocument and it will not achieve anything in terms of applicability, type security or searchability.

"XML" "XML Web Service" This tool is not meant to send vanilla XML, instead, XML refers to the message's format , because it is transmitted on the wire , As the POST string ( id = 3 & amp; name = test & date = 2010-01-24 ) or form of a binary RPC call In .NET Remoting is used.

In the case of authentication, if you decide to use WCF, then you just have to use the correct binding to use a WCF proxy usually wsHttpBinding By default, which uses integrated Windows authentication to secure messages, then, assuming you use Visual Studio, all this is done much more automatically for you unless you default Do not decide to change.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -