The first example is fairly easy, I just needed to get the date/time without the timezone modifier, in other words to convert this: 2016-01-29T00:00:00-08:00
to this: 2016-01-29T00:00:00.
The reason was that our web service was only coded to handle the date without the timezone. It used an Orcacle date/time conversion like this:
eValue = "TO_DATE('" + eValue.Replace("T", " ").Replace(".0000000", "") + "','YYYY-MM-DD HH24:MI:SS')";
XPath “Where” clause when using complex namespaces
Take a look at the data below. I needed to map the EventDate associated with DateType=PLN to D02, and the EventDate associated with DataType=FCT to D03.
Most of the examples on the internet show you how to do this when you don’t have namespaces involved. But when you do have namespaces, the trick is to use nested queries in your XPATH. In the sample below, you can see that the text in yellow is complete inside the other xpath brackets.
Using [local-name()=’xxx”] is like saying find me the element whose name matches ‘xxx’.
Once the where has been matched, the “xsl:value-of” statement begins with ./ to go up one level, then to find the EventDate (that is on the same level as DateType) to put in the output field.
MyMap.btm: error btm1023: Exception Caught: The ‘=’ character, hexadecimal value 0x3D, cannot be included in a name. Line 4, position 23.
This was a simple typo. I typed in “value-of-select=” instead of “value-of select=” (I erroneously included an extra dash between the “of” and the “select”). The parser saw the entire element name as “value-of-select=”, so of course, you cannot have an equal sign in an element name.
How do you test a multi-part map, i.e. a map with multiple input messages?
To test a normal map, you just take an sample XML file, click the map (in Visual Studio Solution Explorer), set the property of the filename into the value of the property “TestMap Input”, then right-click on the map and select “Test Map”. The output is shown in the Output window, and you can do a CNTL-Click on the output file to view the results.
Maps created in the normal mapper usually just have one input message; but maps created in an orchestration can easily have multiple input messages (just by selecting more than one incoming message in Transform shape). This creates a special structure, or wrapper around the messages. You can still do a test-map, but the file you input to the test map must be in the special format as follows:
So basically the root element is part of a special namespace called the “aggschema” (aggregate schema). Then, as many message as you added each are found, but each is wrapped with N) where N start with 0, and increments once per each message.
--select top 10 * from dbo.dta_DebugTrace
select COUNT(*) from dbo.dta_DebugTrace as TotalRowCount
SELECT YEAR(dtBeginTimeStamp) AS Yr,
Month(dtBeginTimeStamp) AS Mo,
COUNT(*) AS [RowCount]
FROM dbo.dta_DebugTrace nolock
The results show you by year/month how many rows. In most cases, you will find you need to purge data prior the current month. At least on a test system, I can think of any possible use of month old orchestration trace data (or even on Production for that matter). But if you have long-running dehydrated orhestrations you might need it).
Orchestrations write data to these tables each time they run (when Trace is enabled).
Go to SQL Agent on the SQL Server that supports your BizTalk server, check the job entitled: DTA Purge and Archive (BizTalkDTADb)
I take the original code that is there, and copy it to the line below, then comment out the code that is there with the T-SQL comment (two dashes).
Then change the second line to the parameters you want. Follow-that by running the job manually, or set it up to run on a scheduled basis.
0, --@nLiveHours tinyint, --Any completed instance older than the live hours +live days
1, --@nLiveDays tinyint = 0, --will be deleted along with all associated data
30, --@nHardDeleteDays tinyint = 0, --all data older than this will be deleted.
null, --@nvcFolder nvarchar(1024) = null, --folder for backup files
null, --@nvcValidatingServer sysname = null,
0 --@fForceBackup int = 0 --
I brought a Rosetta .xsd schema into a new BizTalk Project, gave it a compile and got 1524 occurences of the following error:
The Build Errors
------ Rebuild All started: Project: BTS2C7Outbound, Configuration: Debug Any CPU ------
e:\MyDir\BTS2C7Outbound\Schemas\2C7\Domain\Logistics\CodeList\RN_ResponseCode_01_00.xsd.cs(13,17): error CS0234: The type or namespace name 'NonSerializedAttribute' does not exist in the namespace 'BTS2C7Outbound.Schemas._2C7.System' (are you missing an assembly reference?)
e:\MyDir\BTS2C7Outbound\Schemas\2C7\Domain\Logistics\CodeList\RN_ResponseCode_01_00.xsd.cs(13,17): error CS0234: The type or namespace name 'NonSerializedAttributeAttribute' does not exist in the namespace 'BTS2C7Outbound.Schemas._2C7.System' (are you missing an assembly reference?)
e:\MyDir\BTS2C7Outbound\Schemas\2C7\Domain\Logistics\CodeList\RN_ContainerType_01_02.xsd.cs(201,17): error CS0234: The type or namespace name 'SerializableAttribute' does not exist in the namespace 'BTS2C7Outbound.Schemas._2C7.System' (are you missing an assembly reference?)
e:\MyDir\BTS2C7Outbound\Schemas\2C7\Domain\Logistics\CodeList\RN_ContainerType_01_02.xsd.cs(201,17): error CS0234: The type or namespace name 'SerializableAttributeAttribute' does not exist in the namespace 'BTS2C7Outbound.Schemas._2C7.System' (are you missing an assembly reference?)