Best Method Question: Passing Numerous Transactions To Web Service

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eric Fortin

    Best Method Question: Passing Numerous Transactions To Web Service

    I have a disconnected handheld device that I want to send the results of the
    day to a database through a web service (on an intranet)

    What's the best method to do this?

    XML?
    Tab Delimited/Carriage Return String?
    Through a file?
    Other?

    There will usually be 150 records but could be as many as 500 per device
    (and there will be a few dozen devices). The XML structure is about 350
    bytes per record (including length of xml elements) versus about 100 bytes
    through a tab delimited string



    I don't want to send one transaction at a time... I need to send all
    transactions and have them processed "in bulk"

    TIA

    Eric


  • John Saunders

    #2
    Re: Best Method Question: Passing Numerous Transactions To Web Service

    "Eric Fortin" <emfortin@comca st.netwrote in message
    news:OHJhQhmHJH A.1160@TK2MSFTN GP04.phx.gbl...
    I have a disconnected handheld device that I want to send the results of
    the day to a database through a web service (on an intranet)
    >
    What's the best method to do this?
    >
    XML?
    Tab Delimited/Carriage Return String?
    Through a file?
    Other?
    >
    There will usually be 150 records but could be as many as 500 per device
    (and there will be a few dozen devices). The XML structure is about 350
    bytes per record (including length of xml elements) versus about 100 bytes
    through a tab delimited string
    >
    >
    >
    I don't want to send one transaction at a time... I need to send all
    transactions and have them processed "in bulk"
    What is the throughput of the connection from the handheld device? 500
    records at 350 bytes apiece is only about 30 seconds at 56kbs. If you have
    that level of speed, then I suggest you worry about correctness and
    maintainability before you worry about the performance.
    --
    John Saunders | MVP - Connected System Developer

    Comment

    • Paul Montgumdrop

      #3
      Re: Best Method Question: Passing Numerous Transactions To Web Service

      Eric Fortin wrote:
      I have a disconnected handheld device that I want to send the results of the
      day to a database through a web service (on an intranet)
      >
      What's the best method to do this?
      >
      XML?
      Tab Delimited/Carriage Return String?
      Through a file?
      Other?
      >
      There will usually be 150 records but could be as many as 500 per device
      (and there will be a few dozen devices). The XML structure is about 350
      bytes per record (including length of xml elements) versus about 100 bytes
      through a tab delimited string
      >
      >
      >
      I don't want to send one transaction at a time... I need to send all
      transactions and have them processed "in bulk"
      >
      You create a ADO.Net Dataset on the client side with a table or tables
      in it. You load the table with the data. You can XML serialize the
      Dataset object with the table or tables with data in it down to a
      serialized XML dataset.

      You send the entire serialized XML dataset over the wire. The Web
      service de-serializes the XML dataset back to a ADO.Net Dataset object.
      You know what to do from there, look it up use Google to get code examples.

      You can also compress/decompress it with some free 3rd party tool that
      you can include in your code on the Web client and Web service sides.

      Or you could just create an XML Doc file and load it all up too and send
      it doing a compress/decompress.

      What's to say you can't use text file full of tab delimited data
      records, doing a compress/decompress? Or even a Memory Stream?


      Comment

      • Eric Fortin

        #4
        Re: Best Method Question: Passing Numerous Transactions To Web Service

        What is "correct"? I'm trying to find out what is considered "best
        practice" to complete this type of job (handheld device submitting a day's
        worth of transactions) --XML or a string containing transactions or file
        upload or other...

        Thanks

        "John Saunders" <no@dont.do.tha t.comwrote in message
        news:O9C9imPIJH A.4408@TK2MSFTN GP06.phx.gbl...
        "Eric Fortin" <emfortin@comca st.netwrote in message
        news:OHJhQhmHJH A.1160@TK2MSFTN GP04.phx.gbl...
        >I have a disconnected handheld device that I want to send the results of
        >the day to a database through a web service (on an intranet)
        >>
        >What's the best method to do this?
        >>
        >XML?
        >Tab Delimited/Carriage Return String?
        >Through a file?
        >Other?
        >>
        >There will usually be 150 records but could be as many as 500 per device
        >(and there will be a few dozen devices). The XML structure is about
        >350 bytes per record (including length of xml elements) versus about 100
        >bytes through a tab delimited string
        >>
        >>
        >>
        >I don't want to send one transaction at a time... I need to send all
        >transactions and have them processed "in bulk"
        >
        What is the throughput of the connection from the handheld device? 500
        records at 350 bytes apiece is only about 30 seconds at 56kbs. If you have
        that level of speed, then I suggest you worry about correctness and
        maintainability before you worry about the performance.
        --
        John Saunders | MVP - Connected System Developer

        Comment

        • Eric Fortin

          #5
          Re: Best Method Question: Passing Numerous Transactions To Web Service

          I am currently passing a dataset and am being told that is "bad practice".
          What is the current thought for "best practice"

          "Paul Montgumdrop" <Paul@Montgumdr op.comwrote in message
          news:Oe20$TUIJH A.2208@TK2MSFTN GP02.phx.gbl...
          Eric Fortin wrote:
          >I have a disconnected handheld device that I want to send the results of
          >the day to a database through a web service (on an intranet)
          >>
          >What's the best method to do this?
          >>
          >XML?
          >Tab Delimited/Carriage Return String?
          >Through a file?
          >Other?
          >>
          >There will usually be 150 records but could be as many as 500 per device
          >(and there will be a few dozen devices). The XML structure is about
          >350 bytes per record (including length of xml elements) versus about 100
          >bytes through a tab delimited string
          >>
          >>
          >>
          >I don't want to send one transaction at a time... I need to send all
          >transactions and have them processed "in bulk"
          >>
          >
          You create a ADO.Net Dataset on the client side with a table or tables in
          it. You load the table with the data. You can XML serialize the Dataset
          object with the table or tables with data in it down to a serialized XML
          dataset.
          >
          You send the entire serialized XML dataset over the wire. The Web service
          de-serializes the XML dataset back to a ADO.Net Dataset object. You know
          what to do from there, look it up use Google to get code examples.
          >
          You can also compress/decompress it with some free 3rd party tool that you
          can include in your code on the Web client and Web service sides.
          >
          Or you could just create an XML Doc file and load it all up too and send
          it doing a compress/decompress.
          >
          What's to say you can't use text file full of tab delimited data records,
          doing a compress/decompress? Or even a Memory Stream?
          >
          >

          Comment

          • John Saunders

            #6
            Re: Best Method Question: Passing Numerous Transactions To Web Service

            "Eric Fortin" <emfortin@comca st.netwrote in message
            news:exgq9vZIJH A.728@TK2MSFTNG P03.phx.gbl...
            I am currently passing a dataset and am being told that is "bad practice".
            What is the current thought for "best practice"
            DataSets or any other .NET-specific types are bad practice in the sense that
            they are not interoperable. Instead, follow the Data Transfer Object pattern
            by returning simple types, arrays, structs, etc. For instance, to emulate a
            multiple-table DataSet:

            public struct Table1Row {
            public int ID {get;set;;}
            public string Column {get;set;}
            }

            public struct Table2Row {
            public int ID {get;set;;}
            public string Column {get;set;}
            public Table1Row RelatedRow {get;set;}
            }

            public class Table1 : List<Table1Row>
            {
            }

            public class Table2 : List<Table2Row>
            {
            }

            public class DataSet {
            public Table1 Table1 {get;set;}
            public Table2 Table2 {get;set;}
            }

            OTOH, if you don't now, nor ever will, care about interoperabilit y, then go
            ahead and use a DataSet.
            --
            John Saunders | MVP - Connected System Developer

            Comment

            Working...