locked
Best Practice for collection in WCF RRS feed

  • Question

  • User-574293449 posted

    hi,

      I am going to develop my first wcf service to the client for getting the data. The following is my scenario

    My application collects real time data from the shop floor using our harddevice and load the data to my applciation. Now third party ERP system need to get this transactional data from my system. Also they send master releated data to my application.

    Actually they gave web service to get thier master data. So My plan is to create windows service and periodically check the data using the webservice and save the data into my table. Same like i need to create a web service for them to receive our transactional data. They gave the data as array.

    I am thinking to pass xml to the database for inserting multiple data at once

    Here how can i proceed? What is best practice. Can i  gave them any generic collections? or sing dataset / data table or array? Can anyone guide me as this is my first wcf service

     

    Tuesday, December 17, 2013 4:36 AM

Answers

  • User-488622176 posted

    If you remain in the .NET world, there is no issue with generic lists. If you need compatibility with other technical infrastructures (such as J2EE), Arrays are better towards compatibility.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 18, 2013 6:08 AM

All replies

  • User-742633084 posted

    Hi akhilrajau,

    For transfering collection type data, you can use whatever types you want in your webservice or WCF service as long as they can be properly serialized by .NET Framework. However, for your scenario, if your service will be consumed by various (maybe non-.NET platform), I'd recommend you define them as array or List type so that they can be serialized into interopable collection patterns in XML payload. For those .NET specific types like DataSet or DataTable, they might not work well for non-.NET clients.

    Wednesday, December 18, 2013 1:46 AM
  • User-574293449 posted

    Hi Steven,

      Thanks. I will not go with dataset or datatable. But may i use List<myClass> or Array just like gave to me

    Wednesday, December 18, 2013 2:38 AM
  • User-488622176 posted

    If you remain in the .NET world, there is no issue with generic lists. If you need compatibility with other technical infrastructures (such as J2EE), Arrays are better towards compatibility.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 18, 2013 6:08 AM
  • User-574293449 posted

    ya i got it illeris nice

    Wednesday, December 18, 2013 11:11 PM