title: POX SVCUtil Generated Class Casting
body: <p>I used the SVCUTIL to generate a class form an XSD. I'm having difficulties figuring out how to take the incoming request object and retrieving the "MsgType" value from the object. </p>
  
  <p>I thought by doing this I would be able to access the data simply using:</p>
  
  <pre><code>request.Request.MsgType
  </code></pre>
  
  <p>However, it isn't this simple. The only options 'request' gives me is:
  Equals
  GetHashCode
  GetSchema
  GetType
  Nodes
  ReadXML
  ToString
  WriteXML</p>
  
  <p>Is there some sort of casting I need to do to the serialized object in order to access MsgType?</p>
  
  <pre><code>public ServiceProviderTic callRequestFunc(ServiceProviderTic request) {
        //How do I get request.Request.MsgType Value?
  }
  </code></pre>
  
  <p>Root Element in generated class:</p>
  
  <pre><code>using System.Runtime.Serialization;
  
  [assembly: System.Runtime.Serialization.ContractNamespaceAttribute("", ClrNamespace="")]
  
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]
  [System.Runtime.Serialization.DataContractAttribute(Name="RequestType", Namespace="")]
  [System.Runtime.Serialization.KnownTypeAttribute(typeof(ResponseType))]
  [System.Runtime.Serialization.KnownTypeAttribute(typeof(DateTimeInfoType))]
  [System.Runtime.Serialization.KnownTypeAttribute(typeof(OriginType))]
  [System.Runtime.Serialization.KnownTypeAttribute(typeof(LocaleInfoType))]
  [System.Runtime.Serialization.KnownTypeAttribute(typeof(ProductType))]
  [System.Runtime.Serialization.KnownTypeAttribute(typeof(ValueType))]
  [System.Runtime.Serialization.KnownTypeAttribute(typeof(AuthInfoType))]
  public partial class RequestType : object, System.Runtime.Serialization.IExtensibleDataObject
  {
  
  private RequestType.MsgTypeType MsgTypeField;
  
  [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)]
  public RequestType.MsgTypeType MsgType
  {
      get
      {
          return this.MsgTypeField;
      }
      set
      {
          this.MsgTypeField = value;
      }
  }
  
   [System.Runtime.Serialization.DataContractAttribute(Name="RequestType.MsgTypeType", Namespace="")]
  public enum MsgTypeType : int
  {
      [System.Runtime.Serialization.EnumMemberAttribute()]
      act = 0
  }
  }
  
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]
  [System.Xml.Serialization.XmlSchemaProviderAttribute("ExportSchema")]
  [System.Xml.Serialization.XmlRootAttribute(IsNullable=false)]
  public partial class ServiceProviderTic : object, System.Xml.Serialization.IXmlSerializable
  {
  
  private System.Xml.XmlNode[] nodesField;
  
  private static System.Xml.XmlQualifiedName typeName = new System.Xml.XmlQualifiedName("ServiceProviderTic", "");
  
  public System.Xml.XmlNode[] Nodes
  {
      get
      {
          return this.nodesField;
      }
      set
      {
          this.nodesField = value;
      }
  }
  
  public void ReadXml(System.Xml.XmlReader reader)
  {
      this.nodesField = System.Runtime.Serialization.XmlSerializableServices.ReadNodes(reader);
  }
  
  public void WriteXml(System.Xml.XmlWriter writer)
  {
      System.Runtime.Serialization.XmlSerializableServices.WriteNodes(writer, this.Nodes);
  }
  
  public System.Xml.Schema.XmlSchema GetSchema()
  {
      return null;
  }
  
  public static System.Xml.XmlQualifiedName ExportSchema(System.Xml.Schema.XmlSchemaSet schemas)
  {
      System.Runtime.Serialization.XmlSerializableServices.AddDefaultSchema(schemas, typeName);
      return typeName;
  }
  </code></pre>
  
  <p>XML:</p>
  
  <pre><code>&lt;ServiceProviderTic&gt;
  &lt;Request&gt;
  &lt;MsgType&gt;act&lt;/MsgType&gt;
  </code></pre>
  
  <p>XSD Schema</p>
  
  <pre><code>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"&gt;
  &lt;xs:element name="ServiceProvideTic" nillable="false"&gt;
  &lt;xs:annotation&gt;
  &lt;xs:documentation&gt;&lt;/xs:documentation&gt;
  &lt;/xs:annotation&gt;
  &lt;xs:complexType&gt;
  &lt;xs:sequence&gt;
  &lt;xs:element name="Version" type="xs:string" nillable="false"/&gt;
  &lt;xs:choice&gt;
  &lt;xs:element name="Request" type="RequestType" nillable="false"/&gt;
  &lt;xs:element name="Response" type="ResponseType" nillable="false"/&gt;
  &lt;/xs:choice&gt;
  &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:complexType name="RequestType"&gt;
  &lt;xs:annotation&gt;
  &lt;xs:documentation&gt; Request Information&lt;/xs:documentation&gt;
  &lt;/xs:annotation&gt;
  &lt;xs:sequence&gt;
  &lt;xs:element name="MsgType" nillable="false"&gt;
  &lt;xs:simpleType&gt;
  &lt;xs:restriction base="xs:string"&gt;
  &lt;xs:enumeration value="act"/&gt;
  </code></pre>