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); }
public void SetMessagePartCharSet(MessagePartIdentifierType identifierType, string identifier, string charSet) { identifier = GetPartName(identifierType, identifier); SetMessagePartDetailsPipelineInstruction instruction = new SetMessagePartDetailsPipelineInstruction(charSet, PartDetailTypeEnum.CharSet, identifier); base.AddInstruction(instruction); }
public string GetMessagePartCharSet(MessagePartIdentifierType identifierType, string identifier) { identifier = GetPartName(identifierType, identifier); return(InMsg.GetPart(identifier).Charset); }
public string GetMessagePartContentType(MessagePartIdentifierType identifierType, string identifier) { identifier = GetPartName(identifierType, identifier); return(InMsg.GetPart(identifier).ContentType); }
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); }
public void SetMIMEFileNameMessagePartProperty(MessagePartIdentifierType identifierType, string identifier, string value) { SetCustomMessagePartProperty(BizTalkMIMEPropertySchemaEnum.FileName.ToString(), ContextPropertyNamespaces._MIMEPropertyNamespace, identifierType, identifier, value, TypeEnum.String); }
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); }