Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. SOAP serialization is too slow to accept

SOAP serialization is too slow to accept

Scheduled Pinned Locked Moved C#
xmlcsharpdatabasewcfjson
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    well, although i like to store my data into xml style, i find the .net's SOAP serialization is too slow to accept. To state my opinion i think it better to show you what i am doing. althouth i hate to take up too much space in codeproject. i write a simple xml schema as example a schema to describe a book ---- book.xsd ====================================================================== Comment describing your root element ====================================================================== a implementation of schema ---- book.xml ======================================================================

    first first article

    second second article

    ====================================================================== Framework provide a tool call xsd.exe to get a class from schema, I take it make book.cs ====================================================================== using System.Xml.Serialization; /// [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)] public class article { /// public string title; /// public string @abstract; /// [System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="ID")] public string id; } /// [System.Xml.Serialization.XmlRootAttr

    T S J 3 Replies Last reply
    0
    • L Lost User

      well, although i like to store my data into xml style, i find the .net's SOAP serialization is too slow to accept. To state my opinion i think it better to show you what i am doing. althouth i hate to take up too much space in codeproject. i write a simple xml schema as example a schema to describe a book ---- book.xsd ====================================================================== Comment describing your root element ====================================================================== a implementation of schema ---- book.xml ======================================================================

      first first article

      second second article

      ====================================================================== Framework provide a tool call xsd.exe to get a class from schema, I take it make book.cs ====================================================================== using System.Xml.Serialization; /// [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)] public class article { /// public string title; /// public string @abstract; /// [System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="ID")] public string id; } /// [System.Xml.Serialization.XmlRootAttr

      T Offline
      T Offline
      Tim Smith
      wrote on last edited by
      #2

      Execute the read more than just one time to get the real amount of time it takes. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?

      L 1 Reply Last reply
      0
      • L Lost User

        well, although i like to store my data into xml style, i find the .net's SOAP serialization is too slow to accept. To state my opinion i think it better to show you what i am doing. althouth i hate to take up too much space in codeproject. i write a simple xml schema as example a schema to describe a book ---- book.xsd ====================================================================== Comment describing your root element ====================================================================== a implementation of schema ---- book.xml ======================================================================

        first first article

        second second article

        ====================================================================== Framework provide a tool call xsd.exe to get a class from schema, I take it make book.cs ====================================================================== using System.Xml.Serialization; /// [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)] public class article { /// public string title; /// public string @abstract; /// [System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="ID")] public string id; } /// [System.Xml.Serialization.XmlRootAttr

        S Offline
        S Offline
        Stan Shannon
        wrote on last edited by
        #3

        Maybe you should write this up as an article. You could elaborate a bit more. I'm always interested in unique ideas like this, but you need to compare and contrast a bit more between the strengths and weaknesses of SOAP as opposed to your concept. "There's a slew of slip 'twixt cup and lip"

        1 Reply Last reply
        0
        • T Tim Smith

          Execute the read more than just one time to get the real amount of time it takes. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I have tried it many time. Only the first time cost much more almost 3 second. i think it will be caused by some dll or server be loaded or something like JIT in .net. But in the sequent runs , it cost 0.56 second around. maybe soap serializer must take so long to prepare for a procession. I still not use it on somethink like webservice. In that situation 1 second is quite unacceptable i think.

          1 Reply Last reply
          0
          • L Lost User

            well, although i like to store my data into xml style, i find the .net's SOAP serialization is too slow to accept. To state my opinion i think it better to show you what i am doing. althouth i hate to take up too much space in codeproject. i write a simple xml schema as example a schema to describe a book ---- book.xsd ====================================================================== Comment describing your root element ====================================================================== a implementation of schema ---- book.xml ======================================================================

            first first article

            second second article

            ====================================================================== Framework provide a tool call xsd.exe to get a class from schema, I take it make book.cs ====================================================================== using System.Xml.Serialization; /// [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)] public class article { /// public string title; /// public string @abstract; /// [System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="ID")] public string id; } /// [System.Xml.Serialization.XmlRootAttr

            J Offline
            J Offline
            James T Johnson
            wrote on last edited by
            #5

            What you have is not SOAP, since SOAP is a specialized version of XML; but thats a minor detail. What is happening is the .NET framework is creating a class at runtime to serialize the data. This is why after the first time you serialize the class there is a delay; it is creating and compiling code then caching it away. If speed is that incredibly important search through the DOTNET mailing list archives and see if anyone had figured out how to keep that serializer class after the program has run. I remember some people working on it, they had gotten pretty far with it too. I do not remember when the discussion about it was, but I know it has been since early February. Hope that gives you some idea what is going on :) Just out of curiosity do you see the speed problem with the SOAP formatter? IIRC the SOAP formatter just uses reflection to generate the packet rather than creating a class at runtime. James Sonork ID: 100.11138 - Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups