예제 #1
0
        /// <summary>
        /// Deserialize the object from xml.
        /// </summary>
        /// <param name="reader">The xml reader for reading the serialized xml.
        /// </param>
        public override void ReadXml(XmlReader reader)
        {
            object service = ContextStore.GetValue("SoapService");

            if (service != null)
            {
                PropertyInfo propInfo = service.GetType().GetProperty("RequestHeader");
                if (propInfo != null)
                {
                    RequestHeader reqHeader = (RequestHeader)propInfo.GetValue(service, null);
                    if (reqHeader != null)
                    {
                        // when deserializing, namespace is not relevant, just the version
                        // is.
                        this.Version = reqHeader.Version;
                    }
                }
            }
            base.ReadXml(reader);
        }
    /// <summary>
    /// Reads the headers from App.config.
    /// </summary>
    /// <param name="config">The configuration class.</param>
    protected override void ReadHeadersFromConfig(AppConfig config) {
      DfpAppConfig dfpConfig = (DfpAppConfig) config;

      this.requestHeader = new RequestHeader();
      this.requestHeader.networkCode = dfpConfig.NetworkCode;
      this.requestHeader.applicationName = dfpConfig.GetUserAgent();
    }