Exemple #1
0
        private string GetPartName(MessagePartIdentifierType identifierType, string identifier)
        {
            if (identifierType == MessagePartIdentifierType.ByPartIndex)
            {
                int  partId;
                bool validPartId = int.TryParse(identifier, out partId);

                if (!validPartId)
                {
                    base.SetException(new Exception("Invalid part index of " + identifier));
                }

                if (InMsg.PartCount <= partId)
                {
                    base.SetException(new Exception(string.Format("Part index {0} is greater than the part count", identifier)));
                }

                identifier = PartNames[partId];

                InMsg.GetPartByIndex(partId, out identifier);
            }
            else if (identifierType == MessagePartIdentifierType.ByPartName)
            {
                //Do Nothing
            }
            else
            {
                base.SetException(new Exception("Invalid MesssagePartIdentifierType of " + identifierType.ToString()));
            }
            return(identifier);
        }
Exemple #2
0
        public void SetMessagePartCharSet(MessagePartIdentifierType identifierType, string identifier, string charSet)
        {
            identifier = GetPartName(identifierType, identifier);
            SetMessagePartDetailsPipelineInstruction instruction = new SetMessagePartDetailsPipelineInstruction(charSet, PartDetailTypeEnum.CharSet, identifier);

            base.AddInstruction(instruction);
        }
Exemple #3
0
 public string GetMessagePartCharSet(MessagePartIdentifierType identifierType, string identifier)
 {
     identifier = GetPartName(identifierType, identifier);
     return(InMsg.GetPart(identifier).Charset);
 }
Exemple #4
0
 public string GetMessagePartContentType(MessagePartIdentifierType identifierType, string identifier)
 {
     identifier = GetPartName(identifierType, identifier);
     return(InMsg.GetPart(identifier).ContentType);
 }
Exemple #5
0
        public string GetCustomMessagePartProperty(string propertyName, string propertyNamespace, MessagePartIdentifierType identifierType, string identifier, FailureActionEnum failureAction)
        {
            identifier = GetPartName(identifierType, identifier);

            object property      = base.InMsg.GetPart(identifier).PartProperties.Read(propertyName, propertyNamespace);
            string propertyValue = null;

            if (property != null)
            {
                propertyValue = property.ToString();
            }
            else
            {
                if (failureAction == FailureActionEnum.Exception)
                {
                    Exception exc = new Exception("Unable to get part property " + propertyName + " in namespace " + propertyNamespace + " on part named " + identifier + ".");
                    base.SetException(exc);
                }
                else if (failureAction == FailureActionEnum.BlankOrDefaultValue)
                {
                    propertyValue = string.Empty;
                }
                else if (failureAction == FailureActionEnum.Null)
                {
                    // Do nothing, leave as null
                }
            }

            return(propertyValue);
        }
Exemple #6
0
 public void SetMIMEFileNameMessagePartProperty(MessagePartIdentifierType identifierType, string identifier, string value)
 {
     SetCustomMessagePartProperty(BizTalkMIMEPropertySchemaEnum.FileName.ToString(), ContextPropertyNamespaces._MIMEPropertyNamespace, identifierType, identifier, value, TypeEnum.String);
 }
Exemple #7
0
        public void SetCustomMessagePartProperty(string propertyName, string propertyNamespace, MessagePartIdentifierType identifierType, string identifier, object value, TypeEnum type)
        {
            identifier = GetPartName(identifierType, identifier);
            SetMessagePartPropertyPipelineInstruction instruction = new SetMessagePartPropertyPipelineInstruction(propertyName, propertyNamespace, identifier, value, type);

            base.AddInstruction(instruction);
        }