public WfServiceOperationDefinition(WfServiceAddressDefinition address,
                                     string operationName, WfServiceOperationParameterCollection parameters,
                                     string xmlStoreParaName)
 {
     this._AddressDef          = address;
     this.OperationName        = operationName;
     this.Params               = parameters;
     this.RtnXmlStoreParamName = xmlStoreParaName;
 }
        public static WfServiceOperationDefinition CreateFromAction <TChannel>(WfServiceAddressDefinition addressDef, Action <TChannel> action, string xmlStoreParaName = "")
        {
            WfServiceOperationDefinition opDefine = new WfServiceOperationDefinition();

            opDefine.RtnXmlStoreParamName = xmlStoreParaName;
            opDefine.SetAddress(addressDef);
            FillFromChannel(opDefine, action);

            return(opDefine);
        }
        /// <summary>
        /// 从配置信息项初始化
        /// </summary>
        /// <param name="element"></param>
        public void FromConfigurationElement(WfServiceOperationDefinitionConfigurationElement element)
        {
            element.NullCheck("element");

            this._AddressDef = new WfServiceAddressDefinition(element.AddressKey);

            this.OperationName        = element.OperationName;
            this.Params               = new WfServiceOperationParameterCollection(element.Parameters);
            this.RtnXmlStoreParamName = element.ReturnParamName;
            this.Timeout              = element.Timeout;
            this.InvokeWhenPersist    = element.InvokeWhenPersist;
        }
        public WfServiceOperationDefinition(string addressKey,
                                            string operationName,
                                            WfServiceOperationParameterCollection parameters,
                                            string xmlStoreParaName)
        {
            if (WfGlobalParameters.Default.ServiceAddressDefs[addressKey] == null)
            {
                throw new ArgumentException(string.Format("无法找到Key为{0}的服务地址定义", addressKey));
            }

            this._AddressDef          = WfGlobalParameters.Default.ServiceAddressDefs[addressKey];
            this.OperationName        = operationName;
            this.Params               = parameters;
            this.RtnXmlStoreParamName = xmlStoreParaName;
        }
Example #5
0
        public override IDictionary <string, object> Serialize(object obj, JavaScriptSerializer serializer)
        {
            IDictionary <string, object> dictionary = new Dictionary <string, object>();

            WfServiceAddressDefinition svcAddressDef = (WfServiceAddressDefinition)obj;

            DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "Key", svcAddressDef.Key);
            DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "Address", svcAddressDef.Address);
            DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "ServiceNS", svcAddressDef.ServiceNS);
            DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "RequestMethod", svcAddressDef.RequestMethod);
            DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "ContentType", svcAddressDef.ContentType);

            dictionary.Add("Credential", svcAddressDef.Credential);

            return(dictionary);
        }
Example #6
0
        public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            WfServiceAddressDefinition svcAddressDef = new WfServiceAddressDefinition();

            svcAddressDef.Key           = DictionaryHelper.GetValue(dictionary, "Key", string.Empty);
            svcAddressDef.Address       = DictionaryHelper.GetValue(dictionary, "Address", string.Empty);
            svcAddressDef.ServiceNS     = DictionaryHelper.GetValue(dictionary, "ServiceNS", string.Empty);
            svcAddressDef.RequestMethod = DictionaryHelper.GetValue(dictionary, "RequestMethod", WfServiceRequestMethod.Get);
            svcAddressDef.ContentType   = DictionaryHelper.GetValue(dictionary, "ContentType", WfServiceContentType.Form);

            if (dictionary.ContainsKey("Credential"))
            {
                svcAddressDef.Credential = JSONSerializerExecute.Deserialize <WfNetworkCredential>(dictionary["Credential"]);
            }

            return(svcAddressDef);
        }
 public WfServiceOperationDefinition(WfServiceAddressDefinition address,
                                     string operationName)
 {
     this._AddressDef   = address;
     this.OperationName = operationName;
 }
        public WfServiceOperationDefinition SetAddress(WfServiceAddressDefinition addressDef)
        {
            this.AddressDef = addressDef;

            return(this);
        }