How to read SVCLOG files in C#











up vote
1
down vote

favorite












I need to find the tag <ns2:Response>400 or 200 etc</n2:Response> using service trace viewer it look something like this!!



<SOAP-ENV:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-14799">
<ns2:SendInvoice xmlns:ns2="http://www.zadrwan.com/services/" xmlns:ns3="http://www.zadrwan.com/services/DocumentSendTo" xmlns:ns4="http://www.zadrwan.com/services/VersionRequest">
<ns2:Response>200</ns2:Response>
<ns2:Comments>Success!.</ns2:Comments>
</ns2:SendInvoice>
</SOAP-ENV:Body>


Or is there another way to get a variable without using an XML reader (to read all the document) or, in this case, a text reader (I'm redesigning a VB project that used a StreamReader)?










share|improve this question




























    up vote
    1
    down vote

    favorite












    I need to find the tag <ns2:Response>400 or 200 etc</n2:Response> using service trace viewer it look something like this!!



    <SOAP-ENV:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-14799">
    <ns2:SendInvoice xmlns:ns2="http://www.zadrwan.com/services/" xmlns:ns3="http://www.zadrwan.com/services/DocumentSendTo" xmlns:ns4="http://www.zadrwan.com/services/VersionRequest">
    <ns2:Response>200</ns2:Response>
    <ns2:Comments>Success!.</ns2:Comments>
    </ns2:SendInvoice>
    </SOAP-ENV:Body>


    Or is there another way to get a variable without using an XML reader (to read all the document) or, in this case, a text reader (I'm redesigning a VB project that used a StreamReader)?










    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I need to find the tag <ns2:Response>400 or 200 etc</n2:Response> using service trace viewer it look something like this!!



      <SOAP-ENV:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-14799">
      <ns2:SendInvoice xmlns:ns2="http://www.zadrwan.com/services/" xmlns:ns3="http://www.zadrwan.com/services/DocumentSendTo" xmlns:ns4="http://www.zadrwan.com/services/VersionRequest">
      <ns2:Response>200</ns2:Response>
      <ns2:Comments>Success!.</ns2:Comments>
      </ns2:SendInvoice>
      </SOAP-ENV:Body>


      Or is there another way to get a variable without using an XML reader (to read all the document) or, in this case, a text reader (I'm redesigning a VB project that used a StreamReader)?










      share|improve this question















      I need to find the tag <ns2:Response>400 or 200 etc</n2:Response> using service trace viewer it look something like this!!



      <SOAP-ENV:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-14799">
      <ns2:SendInvoice xmlns:ns2="http://www.zadrwan.com/services/" xmlns:ns3="http://www.zadrwan.com/services/DocumentSendTo" xmlns:ns4="http://www.zadrwan.com/services/VersionRequest">
      <ns2:Response>200</ns2:Response>
      <ns2:Comments>Success!.</ns2:Comments>
      </ns2:SendInvoice>
      </SOAP-ENV:Body>


      Or is there another way to get a variable without using an XML reader (to read all the document) or, in this case, a text reader (I'm redesigning a VB project that used a StreamReader)?







      c# xml wcf streamreader






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 8 at 17:14









      zx485

      13k122845




      13k122845










      asked Nov 8 at 17:13









      ger

      228212




      228212
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          There are plenty of ways. Since there is a schema and you can use the xsd.exe tool to get classes I would use code below



          using System;
          using System.Collections.Generic;
          using System.Linq;
          using System.Text;
          using System.Xml;
          using System.Xml.Serialization;
          namespace ConsoleApplication1
          {
          class Program
          {
          const string FILENAME = @"c:temptest.xml";
          static void Main(string args)
          {

          XmlReader reader = XmlReader.Create(FILENAME);

          XmlSerializer serializer = new XmlSerializer(typeof(TimestampType));
          TimestampType timeStamp = (TimestampType)serializer.Deserialize(reader);
          }
          }
          //------------------------------------------------------------------------------
          // <auto-generated>
          // This code was generated by a tool.
          // Runtime Version:2.0.50727.6421
          //
          // Changes to this file may cause incorrect behavior and will be lost if
          // the code is regenerated.
          // </auto-generated>
          //------------------------------------------------------------------------------

          //
          // This source code was auto-generated by xsd, Version=2.0.50727.3038.
          //


          /// <remarks/>
          [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
          [System.SerializableAttribute()]
          [System.Diagnostics.DebuggerStepThroughAttribute()]
          [System.ComponentModel.DesignerCategoryAttribute("code")]
          [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
          "d")]
          [System.Xml.Serialization.XmlRootAttribute("Timestamp", Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
          "d", IsNullable=false)]
          public partial class TimestampType {

          private AttributedDateTime createdField;

          private AttributedDateTime expiresField;

          private System.Xml.XmlElement itemsField;

          private string idField;

          private System.Xml.XmlAttribute anyAttrField;

          /// <remarks/>
          public AttributedDateTime Created {
          get {
          return this.createdField;
          }
          set {
          this.createdField = value;
          }
          }

          /// <remarks/>
          public AttributedDateTime Expires {
          get {
          return this.expiresField;
          }
          set {
          this.expiresField = value;
          }
          }

          /// <remarks/>
          [System.Xml.Serialization.XmlAnyElementAttribute()]
          public System.Xml.XmlElement Items {
          get {
          return this.itemsField;
          }
          set {
          this.itemsField = value;
          }
          }

          /// <remarks/>
          [System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Qualified, DataType="ID")]
          public string Id {
          get {
          return this.idField;
          }
          set {
          this.idField = value;
          }
          }

          /// <remarks/>
          [System.Xml.Serialization.XmlAnyAttributeAttribute()]
          public System.Xml.XmlAttribute AnyAttr {
          get {
          return this.anyAttrField;
          }
          set {
          this.anyAttrField = value;
          }
          }
          }

          /// <remarks/>
          [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
          [System.SerializableAttribute()]
          [System.Diagnostics.DebuggerStepThroughAttribute()]
          [System.ComponentModel.DesignerCategoryAttribute("code")]
          [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
          "d")]
          [System.Xml.Serialization.XmlRootAttribute("Expires", Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
          "d", IsNullable=false)]
          public partial class AttributedDateTime {

          private string idField;

          private System.Xml.XmlAttribute anyAttrField;

          private string valueField;

          /// <remarks/>
          [System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Qualified, DataType="ID")]
          public string Id {
          get {
          return this.idField;
          }
          set {
          this.idField = value;
          }
          }

          /// <remarks/>
          [System.Xml.Serialization.XmlAnyAttributeAttribute()]
          public System.Xml.XmlAttribute AnyAttr {
          get {
          return this.anyAttrField;
          }
          set {
          this.anyAttrField = value;
          }
          }

          /// <remarks/>
          [System.Xml.Serialization.XmlTextAttribute()]
          public string Value {
          get {
          return this.valueField;
          }
          set {
          this.valueField = value;
          }
          }
          }


          }





          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53212884%2fhow-to-read-svclog-files-in-c-sharp%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote



            accepted










            There are plenty of ways. Since there is a schema and you can use the xsd.exe tool to get classes I would use code below



            using System;
            using System.Collections.Generic;
            using System.Linq;
            using System.Text;
            using System.Xml;
            using System.Xml.Serialization;
            namespace ConsoleApplication1
            {
            class Program
            {
            const string FILENAME = @"c:temptest.xml";
            static void Main(string args)
            {

            XmlReader reader = XmlReader.Create(FILENAME);

            XmlSerializer serializer = new XmlSerializer(typeof(TimestampType));
            TimestampType timeStamp = (TimestampType)serializer.Deserialize(reader);
            }
            }
            //------------------------------------------------------------------------------
            // <auto-generated>
            // This code was generated by a tool.
            // Runtime Version:2.0.50727.6421
            //
            // Changes to this file may cause incorrect behavior and will be lost if
            // the code is regenerated.
            // </auto-generated>
            //------------------------------------------------------------------------------

            //
            // This source code was auto-generated by xsd, Version=2.0.50727.3038.
            //


            /// <remarks/>
            [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
            [System.SerializableAttribute()]
            [System.Diagnostics.DebuggerStepThroughAttribute()]
            [System.ComponentModel.DesignerCategoryAttribute("code")]
            [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
            "d")]
            [System.Xml.Serialization.XmlRootAttribute("Timestamp", Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
            "d", IsNullable=false)]
            public partial class TimestampType {

            private AttributedDateTime createdField;

            private AttributedDateTime expiresField;

            private System.Xml.XmlElement itemsField;

            private string idField;

            private System.Xml.XmlAttribute anyAttrField;

            /// <remarks/>
            public AttributedDateTime Created {
            get {
            return this.createdField;
            }
            set {
            this.createdField = value;
            }
            }

            /// <remarks/>
            public AttributedDateTime Expires {
            get {
            return this.expiresField;
            }
            set {
            this.expiresField = value;
            }
            }

            /// <remarks/>
            [System.Xml.Serialization.XmlAnyElementAttribute()]
            public System.Xml.XmlElement Items {
            get {
            return this.itemsField;
            }
            set {
            this.itemsField = value;
            }
            }

            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Qualified, DataType="ID")]
            public string Id {
            get {
            return this.idField;
            }
            set {
            this.idField = value;
            }
            }

            /// <remarks/>
            [System.Xml.Serialization.XmlAnyAttributeAttribute()]
            public System.Xml.XmlAttribute AnyAttr {
            get {
            return this.anyAttrField;
            }
            set {
            this.anyAttrField = value;
            }
            }
            }

            /// <remarks/>
            [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
            [System.SerializableAttribute()]
            [System.Diagnostics.DebuggerStepThroughAttribute()]
            [System.ComponentModel.DesignerCategoryAttribute("code")]
            [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
            "d")]
            [System.Xml.Serialization.XmlRootAttribute("Expires", Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
            "d", IsNullable=false)]
            public partial class AttributedDateTime {

            private string idField;

            private System.Xml.XmlAttribute anyAttrField;

            private string valueField;

            /// <remarks/>
            [System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Qualified, DataType="ID")]
            public string Id {
            get {
            return this.idField;
            }
            set {
            this.idField = value;
            }
            }

            /// <remarks/>
            [System.Xml.Serialization.XmlAnyAttributeAttribute()]
            public System.Xml.XmlAttribute AnyAttr {
            get {
            return this.anyAttrField;
            }
            set {
            this.anyAttrField = value;
            }
            }

            /// <remarks/>
            [System.Xml.Serialization.XmlTextAttribute()]
            public string Value {
            get {
            return this.valueField;
            }
            set {
            this.valueField = value;
            }
            }
            }


            }





            share|improve this answer

























              up vote
              1
              down vote



              accepted










              There are plenty of ways. Since there is a schema and you can use the xsd.exe tool to get classes I would use code below



              using System;
              using System.Collections.Generic;
              using System.Linq;
              using System.Text;
              using System.Xml;
              using System.Xml.Serialization;
              namespace ConsoleApplication1
              {
              class Program
              {
              const string FILENAME = @"c:temptest.xml";
              static void Main(string args)
              {

              XmlReader reader = XmlReader.Create(FILENAME);

              XmlSerializer serializer = new XmlSerializer(typeof(TimestampType));
              TimestampType timeStamp = (TimestampType)serializer.Deserialize(reader);
              }
              }
              //------------------------------------------------------------------------------
              // <auto-generated>
              // This code was generated by a tool.
              // Runtime Version:2.0.50727.6421
              //
              // Changes to this file may cause incorrect behavior and will be lost if
              // the code is regenerated.
              // </auto-generated>
              //------------------------------------------------------------------------------

              //
              // This source code was auto-generated by xsd, Version=2.0.50727.3038.
              //


              /// <remarks/>
              [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
              [System.SerializableAttribute()]
              [System.Diagnostics.DebuggerStepThroughAttribute()]
              [System.ComponentModel.DesignerCategoryAttribute("code")]
              [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
              "d")]
              [System.Xml.Serialization.XmlRootAttribute("Timestamp", Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
              "d", IsNullable=false)]
              public partial class TimestampType {

              private AttributedDateTime createdField;

              private AttributedDateTime expiresField;

              private System.Xml.XmlElement itemsField;

              private string idField;

              private System.Xml.XmlAttribute anyAttrField;

              /// <remarks/>
              public AttributedDateTime Created {
              get {
              return this.createdField;
              }
              set {
              this.createdField = value;
              }
              }

              /// <remarks/>
              public AttributedDateTime Expires {
              get {
              return this.expiresField;
              }
              set {
              this.expiresField = value;
              }
              }

              /// <remarks/>
              [System.Xml.Serialization.XmlAnyElementAttribute()]
              public System.Xml.XmlElement Items {
              get {
              return this.itemsField;
              }
              set {
              this.itemsField = value;
              }
              }

              /// <remarks/>
              [System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Qualified, DataType="ID")]
              public string Id {
              get {
              return this.idField;
              }
              set {
              this.idField = value;
              }
              }

              /// <remarks/>
              [System.Xml.Serialization.XmlAnyAttributeAttribute()]
              public System.Xml.XmlAttribute AnyAttr {
              get {
              return this.anyAttrField;
              }
              set {
              this.anyAttrField = value;
              }
              }
              }

              /// <remarks/>
              [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
              [System.SerializableAttribute()]
              [System.Diagnostics.DebuggerStepThroughAttribute()]
              [System.ComponentModel.DesignerCategoryAttribute("code")]
              [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
              "d")]
              [System.Xml.Serialization.XmlRootAttribute("Expires", Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
              "d", IsNullable=false)]
              public partial class AttributedDateTime {

              private string idField;

              private System.Xml.XmlAttribute anyAttrField;

              private string valueField;

              /// <remarks/>
              [System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Qualified, DataType="ID")]
              public string Id {
              get {
              return this.idField;
              }
              set {
              this.idField = value;
              }
              }

              /// <remarks/>
              [System.Xml.Serialization.XmlAnyAttributeAttribute()]
              public System.Xml.XmlAttribute AnyAttr {
              get {
              return this.anyAttrField;
              }
              set {
              this.anyAttrField = value;
              }
              }

              /// <remarks/>
              [System.Xml.Serialization.XmlTextAttribute()]
              public string Value {
              get {
              return this.valueField;
              }
              set {
              this.valueField = value;
              }
              }
              }


              }





              share|improve this answer























                up vote
                1
                down vote



                accepted







                up vote
                1
                down vote



                accepted






                There are plenty of ways. Since there is a schema and you can use the xsd.exe tool to get classes I would use code below



                using System;
                using System.Collections.Generic;
                using System.Linq;
                using System.Text;
                using System.Xml;
                using System.Xml.Serialization;
                namespace ConsoleApplication1
                {
                class Program
                {
                const string FILENAME = @"c:temptest.xml";
                static void Main(string args)
                {

                XmlReader reader = XmlReader.Create(FILENAME);

                XmlSerializer serializer = new XmlSerializer(typeof(TimestampType));
                TimestampType timeStamp = (TimestampType)serializer.Deserialize(reader);
                }
                }
                //------------------------------------------------------------------------------
                // <auto-generated>
                // This code was generated by a tool.
                // Runtime Version:2.0.50727.6421
                //
                // Changes to this file may cause incorrect behavior and will be lost if
                // the code is regenerated.
                // </auto-generated>
                //------------------------------------------------------------------------------

                //
                // This source code was auto-generated by xsd, Version=2.0.50727.3038.
                //


                /// <remarks/>
                [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
                [System.SerializableAttribute()]
                [System.Diagnostics.DebuggerStepThroughAttribute()]
                [System.ComponentModel.DesignerCategoryAttribute("code")]
                [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
                "d")]
                [System.Xml.Serialization.XmlRootAttribute("Timestamp", Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
                "d", IsNullable=false)]
                public partial class TimestampType {

                private AttributedDateTime createdField;

                private AttributedDateTime expiresField;

                private System.Xml.XmlElement itemsField;

                private string idField;

                private System.Xml.XmlAttribute anyAttrField;

                /// <remarks/>
                public AttributedDateTime Created {
                get {
                return this.createdField;
                }
                set {
                this.createdField = value;
                }
                }

                /// <remarks/>
                public AttributedDateTime Expires {
                get {
                return this.expiresField;
                }
                set {
                this.expiresField = value;
                }
                }

                /// <remarks/>
                [System.Xml.Serialization.XmlAnyElementAttribute()]
                public System.Xml.XmlElement Items {
                get {
                return this.itemsField;
                }
                set {
                this.itemsField = value;
                }
                }

                /// <remarks/>
                [System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Qualified, DataType="ID")]
                public string Id {
                get {
                return this.idField;
                }
                set {
                this.idField = value;
                }
                }

                /// <remarks/>
                [System.Xml.Serialization.XmlAnyAttributeAttribute()]
                public System.Xml.XmlAttribute AnyAttr {
                get {
                return this.anyAttrField;
                }
                set {
                this.anyAttrField = value;
                }
                }
                }

                /// <remarks/>
                [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
                [System.SerializableAttribute()]
                [System.Diagnostics.DebuggerStepThroughAttribute()]
                [System.ComponentModel.DesignerCategoryAttribute("code")]
                [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
                "d")]
                [System.Xml.Serialization.XmlRootAttribute("Expires", Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
                "d", IsNullable=false)]
                public partial class AttributedDateTime {

                private string idField;

                private System.Xml.XmlAttribute anyAttrField;

                private string valueField;

                /// <remarks/>
                [System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Qualified, DataType="ID")]
                public string Id {
                get {
                return this.idField;
                }
                set {
                this.idField = value;
                }
                }

                /// <remarks/>
                [System.Xml.Serialization.XmlAnyAttributeAttribute()]
                public System.Xml.XmlAttribute AnyAttr {
                get {
                return this.anyAttrField;
                }
                set {
                this.anyAttrField = value;
                }
                }

                /// <remarks/>
                [System.Xml.Serialization.XmlTextAttribute()]
                public string Value {
                get {
                return this.valueField;
                }
                set {
                this.valueField = value;
                }
                }
                }


                }





                share|improve this answer












                There are plenty of ways. Since there is a schema and you can use the xsd.exe tool to get classes I would use code below



                using System;
                using System.Collections.Generic;
                using System.Linq;
                using System.Text;
                using System.Xml;
                using System.Xml.Serialization;
                namespace ConsoleApplication1
                {
                class Program
                {
                const string FILENAME = @"c:temptest.xml";
                static void Main(string args)
                {

                XmlReader reader = XmlReader.Create(FILENAME);

                XmlSerializer serializer = new XmlSerializer(typeof(TimestampType));
                TimestampType timeStamp = (TimestampType)serializer.Deserialize(reader);
                }
                }
                //------------------------------------------------------------------------------
                // <auto-generated>
                // This code was generated by a tool.
                // Runtime Version:2.0.50727.6421
                //
                // Changes to this file may cause incorrect behavior and will be lost if
                // the code is regenerated.
                // </auto-generated>
                //------------------------------------------------------------------------------

                //
                // This source code was auto-generated by xsd, Version=2.0.50727.3038.
                //


                /// <remarks/>
                [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
                [System.SerializableAttribute()]
                [System.Diagnostics.DebuggerStepThroughAttribute()]
                [System.ComponentModel.DesignerCategoryAttribute("code")]
                [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
                "d")]
                [System.Xml.Serialization.XmlRootAttribute("Timestamp", Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
                "d", IsNullable=false)]
                public partial class TimestampType {

                private AttributedDateTime createdField;

                private AttributedDateTime expiresField;

                private System.Xml.XmlElement itemsField;

                private string idField;

                private System.Xml.XmlAttribute anyAttrField;

                /// <remarks/>
                public AttributedDateTime Created {
                get {
                return this.createdField;
                }
                set {
                this.createdField = value;
                }
                }

                /// <remarks/>
                public AttributedDateTime Expires {
                get {
                return this.expiresField;
                }
                set {
                this.expiresField = value;
                }
                }

                /// <remarks/>
                [System.Xml.Serialization.XmlAnyElementAttribute()]
                public System.Xml.XmlElement Items {
                get {
                return this.itemsField;
                }
                set {
                this.itemsField = value;
                }
                }

                /// <remarks/>
                [System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Qualified, DataType="ID")]
                public string Id {
                get {
                return this.idField;
                }
                set {
                this.idField = value;
                }
                }

                /// <remarks/>
                [System.Xml.Serialization.XmlAnyAttributeAttribute()]
                public System.Xml.XmlAttribute AnyAttr {
                get {
                return this.anyAttrField;
                }
                set {
                this.anyAttrField = value;
                }
                }
                }

                /// <remarks/>
                [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
                [System.SerializableAttribute()]
                [System.Diagnostics.DebuggerStepThroughAttribute()]
                [System.ComponentModel.DesignerCategoryAttribute("code")]
                [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
                "d")]
                [System.Xml.Serialization.XmlRootAttribute("Expires", Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" +
                "d", IsNullable=false)]
                public partial class AttributedDateTime {

                private string idField;

                private System.Xml.XmlAttribute anyAttrField;

                private string valueField;

                /// <remarks/>
                [System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Qualified, DataType="ID")]
                public string Id {
                get {
                return this.idField;
                }
                set {
                this.idField = value;
                }
                }

                /// <remarks/>
                [System.Xml.Serialization.XmlAnyAttributeAttribute()]
                public System.Xml.XmlAttribute AnyAttr {
                get {
                return this.anyAttrField;
                }
                set {
                this.anyAttrField = value;
                }
                }

                /// <remarks/>
                [System.Xml.Serialization.XmlTextAttribute()]
                public string Value {
                get {
                return this.valueField;
                }
                set {
                this.valueField = value;
                }
                }
                }


                }






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 8 at 23:26









                jdweng

                16.5k2717




                16.5k2717






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53212884%2fhow-to-read-svclog-files-in-c-sharp%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    Academy of Television Arts & Sciences

                    L'Équipe

                    1995 France bombings