Click here to Skip to main content
15,945,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi ,

I have to fetch few line from the below string in biztalk orchestration :

string :

Message             : Microsoft.XLANGs.Core.XlangSoapException: An error occurred while processing the message, refer to the details section for more information 
Message ID: {qewewqeweA-wqeF-4wewqe7-eqewq-4qweqewqeqe}
Instance ID: {Bqweqweqw-qwewqe-ewqqeqwe-wqewqeqwewq-qweqwewqeqwewqewqewqewqE}

Error Description: Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The input data for the field/parameter PersonalMobile_CountryCode is larger than that allowed on the SQL Server. Maximum length allowed is 10, length found was 12.

Server stack trace: 
   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)




expected Output : Error Description: Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The input data for the field/parameter PersonalMobile_CountryCode is larger than that allowed on the SQL Server. Maximum length allowed is 10, length found was 12.

What I have tried:

created two varibales : 
obRegularExp  of type : System.Text.RegularExpressions.Match

sNotification =System.String

obRegularExp = System.Text.RegularExpressions.Regex.Match(Ex.InnerException.Message,"Error Description:(.*)");
sNotification = obRegularExp.Value.Replace("Error Description:", "");

But i am not bale to fetch the data with this expression. 
Can anyone helpe me on this to get the expected data in a single line without new line character in it.
Posted
Updated 16-Aug-17 19:47pm

1 solution

Try this:
^Error Description:.*?$

If you are going to use regular expressions, then get a copy of Expresso[^] - it's free, and it examines, tests, and generates Regular expressions.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900