How to pass CSV file contents as parameter to web service in python.Now i am passing only 5 values to web service and inserting it to mongodb database. I am using soaplib web service and mongodb database,using soaplib load data to database. How to pass CSV file contents to web service and insert it to mongodb database?
Thanks
Try out the following steps:
path
Go through this link, read the file similar to the example quoted in the linked article.
Example:
Open Connection to MongoDB with your mongo-python-driver
Example:
Then ultimately pass the content of the file, which you read in step
Example:
db.my_collection.save({"CSV_FileContent": Obj_CSV_File})
To pass your file content from your python program to a web service, you may try following:
XML is ok, but not the best way at all (because if unnecessary metadata that is included in XML) Large XML Data in Web Services.
Message Transmission Optimization Mechanism is the best to consider.