locked
Pipeline failed with error 0xC0C01627 RRS feed

  • Question

  • Hi

    can any body tell me the issue with the below pipeline component Executes method--I am placing this below pipeline in Validate stage

    While executing the pipeline there are no errors but tracked message events pipeline execution has not completed

    Duration: 00:00:00 
    Exit Code: 0xC0C01627 
    Error Info:

    -----------------------------Code is below  -----

    IBaseMessageContext inContext = pInMsg.Context;
                IBaseMessage inMsg = pInMsg;
                ReadOnlySeekableStream stream = new ReadOnlySeekableStream(inMsg.BodyPart.GetOriginalDataStream());
                Stream sourceStream = inMsg.BodyPart.GetOriginalDataStream();
                if (!sourceStream.CanSeek)
                {
                    ReadOnlySeekableStream seekableStream = new ReadOnlySeekableStream(sourceStream);

                    pInMsg.BodyPart.Data = seekableStream;

                    sourceStream = pInMsg.BodyPart.Data;
                } 
                
                string requestId = null;
                string messageId = null;
                string chainId = null;
                string consumerId = null;
                StreamReader sr = new StreamReader(sourceStream);
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(sr);
                XmlNodeList requestHeader = xmlDoc.GetElementsByTagName("requestHeader");
                foreach (XmlNode node in requestHeader)
                {
                     requestId = node["requestId"].InnerText;
                     messageId = node["messageId"].InnerText;
                    chainId = node["chainId"].InnerText;
                    consumerId = node["consumerId"].InnerText;  
                }
                if (string.IsNullOrEmpty(requestId))
                {
                    requestId =  System.Convert.ToString(Guid.NewGuid());
                }
                if (string.IsNullOrEmpty(messageId))
                {
                    messageId = System.Convert.ToString(Guid.NewGuid());
                }
                if (string.IsNullOrEmpty(chainId))
                {
                    chainId = System.Convert.ToString(Guid.NewGuid());
                }
                if (string.IsNullOrEmpty(consumerId))
                {
                    consumerId = System.Convert.ToString(Guid.NewGuid());
                }
                inContext.Promote("requestId", "https://Dummy.Account_Property", requestId);
                inContext.Promote("messageId", "https://Dummy.Account_Property", messageId);
                inContext.Promote("chainId", "https://Dummy.Account_Property", chainId);
                inContext.Promote("consumerId", "https://Dummy.Account_Property", consumerId);
                sourceStream.Position = 0;
                inMsg.Context = inContext;
                inMsg.BodyPart.Data = sourceStream;
               return pInMsg;

    Monday, October 26, 2015 3:25 AM

Answers

  • Hi ,

    The only purpose I could seewith above code , is that you want to promote certain fields in the context of the message like  requestId, messageId,chain Id etc .

    It can be done in single line of code .

    pInmsg.Context.Promote("consumerId", "https://Mydemoservicenamesapce", consumerId);
     

    I don't think creating a new IBaseMessage and assigning incoming message body and context would add any value to it . I would suggest to refactor your code to implement the right logic.

    Thanks

    Abhishek



    • Proposed as answer by Angie Xu Wednesday, November 4, 2015 1:24 AM
    • Marked as answer by Angie Xu Friday, November 6, 2015 1:58 AM
    Monday, October 26, 2015 6:38 AM

All replies

  • You have some serious issues with the number of times you've read and reassigned the data stream. (Why do you have "stream" ?!?!? and when you've not modified "sourceStream" why are you assigning it back to "inMsg" ?!?!?!?)

    I do not understand why are you constructing another instance of IBaseMessage.

    I do not understand why you have a loop to read four distinct values and overwrite the variables without assigning them anywhere.

    I do not understand why you're converting strings to GUID when they are more efficient as strings as promoted properties. Promoted Properties may have problems being of type GUID (maybe the reason for your error)

    If you're doing all this just to promote some properties from the MessageHeader then IMHO it is a waste of programming effort because the XML Receive pipeline does that for you too....

    Regards.

    Monday, October 26, 2015 4:48 AM
  • Hi ,

    The only purpose I could seewith above code , is that you want to promote certain fields in the context of the message like  requestId, messageId,chain Id etc .

    It can be done in single line of code .

    pInmsg.Context.Promote("consumerId", "https://Mydemoservicenamesapce", consumerId);
     

    I don't think creating a new IBaseMessage and assigning incoming message body and context would add any value to it . I would suggest to refactor your code to implement the right logic.

    Thanks

    Abhishek



    • Proposed as answer by Angie Xu Wednesday, November 4, 2015 1:24 AM
    • Marked as answer by Angie Xu Friday, November 6, 2015 1:58 AM
    Monday, October 26, 2015 6:38 AM