When doing a test map, you could get dozens or hundreds of the following error:

error btm1044: Input validation error: Could not find schema information for the element ‘http://Namespace/:ElementName.

Visual Studio Solution Explorer allows you to right-click on a .btm map and specify a property called “TestMap Input Instance”. If you specify a file that totally doesn’t match the expected schema, then you can receive the error above.

Error text:

A message sent to adapter “FILE” on send port “spGwCustomers_Caterpillar_EDI210” with URI “C:\Integrations\EDI1\Customers\xxxx\outbound\210\Test_210_%datetime_bts2000%.TXT” is suspended.
Error details: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

Solution

The file not found can refer to the map .dll. The error to me is quite misleading, because it implies the directory/filename path listed in the error is the problem.
This can happen to me when I don’t run the MSI (or other deploy process) for a map on one of the BizTalk servers (when you have multiple BizTalk servers in the same group).

It sure would be nice if the error would give the actual missing filename (i.e. the map .dll name).

Got the mysterious error “Missing attribute test”.
Finally, noticed that I had the “t” missing on the keyword “test”:

INCORRECT
<xsl:if est=”RateAndCharges/@SpecialChargeOrAllowanceCode != ‘ABC’ “>

CORRECT
<xsl:if test=”RateAndCharges/@SpecialChargeOrAllowanceCode != ‘ABC’ “>

This is a run-time error can occur when you use a map that is XSLT based. It is possible to compile and deploy the project, even when the XSLT is malformed or has errors in it.

Try to reproduce in the developer environment with one or both of the following:
1) Open your project in Visual Studio, and do a test map with some real incoming data.
2) Make sure you XSLT is well-formed XML.
3) You might also try validating the map (right-click validate)

I also saw this happen when I removed a “Logical Existence” functoid, and the an XSLT functoid was using it as follows:

			<xsl:variable name="var:v14A" select="userCSharp:LogicalExistence(boolean(L004))" />

By doing the “test map”, it gave the error:
Extension object ‘http://schemas.microsoft.com/BizTalk/2003/userCSharp’ does not contain a matching ‘LogicalExistence’ method that has 1 parameter(s).

I was evaluating what I thought was a string read from a file, then doing an .indexOf on that string. Took me over an hour to debug something so simple.

Trying to get the position of a string within a larger string is pretty basic stuff; yet I was getting the mystery result of -1.
I then printed the file to console, copied into a separate program as a string, and it worked fine.

I was also puzzling why the .LastIndexOf variable didn’t appear in the auto-complete of ISE. That should have been my clue.

When I did the following:

$templateContent = Get-Content $inputTemplate 


this creates an array in $templateContent, and arrays have a similar method called .IndexOf.

The solution was to add the “-raw tag”. I had tried “-encoding ASCII” and various encodings, and that not getting me anywhere.

$templateContent = Get-Content $inputTemplate -raw

Then the code to do the .IndexOf was straight forward. At first, I thought my issue was within the quotes in quotes, so I simplified to something like basic like the word “xml”.

               $valueCustId = "Value=`"%CUSTID%`""; 
               $valueCustId = "xml"; 
               $posValueCustId = $updatedTemplateContent.IndexOf($valueCustId) 
               Write-Host "posValueCustId = $posValueCustId" 

https://stackoverflow.com/questions/49333243/powershell-indexof-is-not-working

Have you ever wanted to make a new Visual Studio solution (even a BizTalk one) as a copy of another, except just change the program names? And it would automatically rename everything, including the solutions, project files, assembly files and so on? I’ve needed this program for years, and finally wrote it!

Remember that the project name is often the Assembly name and the Default Namespace (in the AssemblInfo.cs file). This program renames the files, the folders, and updates the .sln and .csproj/.btproj files (and any other file). The “-exclude” parm on the Get-ChildItem is used to avoid binaries and other files that you do not want to change.

In BizTalk, the project name can also become your “TargetNamespace” for schemas.
Another trick with BizTalk is that some of the files are Unicode and some aren’t. So the rename program has to be conscious of that, and preserve the file type. I’m doing this by testing if the first tow characters of a file are are Byte Order Mark.

NOTE: Use with caution. Make a backup of your project before letting any program rip through and rename and change files!
Make sure your old/string new string are quite unique, so as not to change other random parts of your code. For example, if you use a 20-40 character project name like I have in $oldstring below, you are generally safe.

cls 
$path = "d:\Git_Dev\MyProject" 
cd $path 
$oldstring = "MyCompany.BizTalk.System.OriginalName"
$newstring = "MyCompany.BizTalk.System.NewName"

$files = Get-ChildItem -Path $path *.* -rec -file -exclude obj,debug,bin,*.msi,*.exe,*.dll,*.snk 

$loopCounter = 1 

foreach ($file in $files) 
{
    ##(-join [char[]](Get-Content $file.PSPath -Encoding Byte -TotalCount 2)) -eq 'ÿþ'
    Write-Host "FileName: $($file.Fullname)" 
    $fileContents = Get-Content $file.FullName 
    $fileContentsUpdated = $fileContents -replace $oldstring, $newstring 

    if ($filecontents -ne $null) 
    {
        #Write-Host "---BEFORE----" 
        #Write-Host $fileContents 
        #Write-Host "---AFTER----" 
        #Write-Host $fileContentsUpdated 

        if ($fileContents -ne $fileContentsUpdated) 
        {
            if ($fileContents[0..2] -eq 'ÿþ') 
            {
                Write-Host "Updating File $($file.Name) [Unicode] "
                Set-Content -path $file.FullName -value $fileContentsUpdated -Encoding Unicode 
            }
            else 
            {
                Write-Host "Updating File $($file.Name) [NOT-Unicode] "
                Set-Content -path $file.FullName -value $fileContentsUpdated ## not Unicode 
            }
        }

        $fileNameUpdate = $file.Name -replace $oldstring, $newstring 
        if ($file.Name -ne $fileNameUpdate) 
        {
           Write-Host "Rename $($file.FullName) to $fileNameUpdate" 
           Rename-Item -Path $file.FullName -NewName $fileNameUpdate 
        }

        $loopCounter = $loopCounter + 1 
        if ($loopCounter -gt 2) 
          {
             #exit 
          }

   }
}

// Repeat again, to rename folders 
$files = Get-ChildItem -Path $path *.* -rec -directory -exclude obj,debug,bin

foreach ($file in $files) 
{


        $fileNameUpdate = $file.Name -replace $oldstring, $newstring 
        if ($file.Name -ne $fileNameUpdate) 
        {
           Write-Host "Rename $($file.FullName) to $fileNameUpdate" 
           Rename-Item -Path $file.FullName -NewName $fileNameUpdate 
        }

}


BTDF (BizTalk Deployment Facility) gave this error during a deploy in Visual Studio to the local machine:

Error: Domain accounts must include the domain name. Local accounts must not include a domain or computer name.

Other people mention that you are using computer or domain account when the other is needed.
In my case, my setting file had “BTS Application Users”, but my computer was set up according to the client’s instructions, and it should have been “BizTalk Application Users”.

So the solution is just to type in the correct value in the “Default Values” or “Local” column of the SettingsFileGenerator.xml file. Usually, it opens in Excel (if you have Excel installed on the machine), and change the value, then save it.

You might open a file like this:

ISA*00* *00* *ZZ*123000013 *ZZ*ABC3001 *160719*1600*U*00401*201160030*0*P*;~

and then want to know what is company with ID=123000013? I don’t know of any any way in the BizTalk Admin console to do a reverse lookup like this.


select 
       P.PartnerId as 'ParterID', 
       P.Name as 'PartyName', 
       BP.Name as 'ProfileName', 
	   BP.ProfileID,
	   BI.Qualifier, 
	   BI.Description, 
	   BI.Value, 
       P2.PartnerId as 'PartnerID', 
	   P2.Name as 'OtherPartyName', 
	   BP2.Name as 'OtherProfileName' ,
	   BP2.ProfileID,
	   BI2.Qualifier, 
	   BI2.Description, 
	   BI2.Value, 
	   * 
from tpm.BusinessIdentity  BI 
inner join tpm.BusinessProfile BP   on BI.ProfileId = BP.ProfileId
inner join tpm.Partner P            on P.PartnerID = BP.PartnerID 
inner join tpm.Partnership ps       on P.PartnerID = ps.PartnerAId 
inner join tpm.Partner P2           on P2.PartnerID = ps.PartnerBId
inner join tpm.BusinessProfile BP2  on P2.PartnerID = BP2.PartnerID 
inner join tpm.BusinessIdentity BI2 on BI2.ProfileId = BP2.ProfileId
where BI.Value = '123000013' 
-- and BI2.Value = 'xxxxxxx'
order by P.Name, BP.Name 

We are using GitLab, an open source way to store source code on your own servers. I wanted to get all my branches into a clean directory, then recompile them to make sure everything had been checked-in properly. THe first step is to download all the branches into a directory.

NOTE: Apparently the –single-branch option did not exist in previous versions of Git.

d:
cd \GitRecompile
git clone --single-branch -b myBranchName http://git.Site.com/Site.BizTalk/Site.BizTalk.Application1
git clone --single-branch -b myBranchName http://git.Site.com/Site.BizTalk/Site.BizTalk.Application2 
git clone --single-branch -b myBranchName http://git.Site.com/Site.BizTalk/Site.BizTalk.Application3

This is an updated version of “InsertGenerator” from CodePlex. This tools works great when you want to create a few insert statements from a table, and save them in a file; or to transfer a few rows from one system to another. It’s great for lookup/code tables

I referred to this “how to build sql insert statements from a table” utility in an earlier blog.

This fix below is to allow support of a schema, because in some database you need to specify both the schema name and the tablename.

To run it:

exec InsertGenerator2 'YourSchema', 'YourTable'

Specify DBO for YourSchema if you that to use the default schema.

It will give you a list of insert statements that you can copy/paste to another system.

If your table has an identity column, add these statemetns before/after your inserts:

SET IDENTITY_INSERT YourSchema.YourTable ON
SET IDENTITY_INSERT YourSchema.YourTable OFF

USE [EchoOptimizer]
GO
/****** Object:  StoredProcedure [dbo].[InsertGenerator2]    Script Date: 7/11/2018 12:55:30 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROC [dbo].[InsertGenerator2]
(@schemaName varchar(100), 
 @tableName varchar(100)) as

--Declare a cursor to retrieve column specific information for the specified table
DECLARE cursCol CURSOR FAST_FORWARD FOR 
SELECT column_name,data_type FROM information_schema.columns WHERE table_name = @tableName and TABLE_SCHEMA = @schemaName
OPEN cursCol
DECLARE @string nvarchar(3000) --for storing the first half of INSERT statement
DECLARE @stringData nvarchar(3000) --for storing the data (VALUES) related statement
DECLARE @dataType nvarchar(1000) --data types returned for respective columns
SET @string='INSERT '+ @schemaName + '.' + @tableName+'('
SET @stringData=''

DECLARE @colName nvarchar(50)

FETCH NEXT FROM cursCol INTO @colName,@dataType

IF @@fetch_status&lt;&gt;0
	begin
	print 'Table '+@tableName+' not found, processing skipped.'
	close curscol
	deallocate curscol
	return
END

WHILE @@FETCH_STATUS=0
BEGIN
IF @dataType in ('varchar','char','nchar','nvarchar')
BEGIN
	--SET @stringData=@stringData+'''''''''+isnull('+@colName+','''')+'''''',''+'
	SET @stringData=@stringData+''''+'''+isnull('''''+'''''+'+@colName+'+'''''+''''',''NULL'')+'',''+'
END
ELSE
if @dataType in ('text','ntext') --if the datatype is text or something else 
BEGIN
	SET @stringData=@stringData+'''''''''+isnull(cast('+@colName+' as varchar(2000)),'''')+'''''',''+'
END
ELSE
IF @dataType = 'money' --because money doesn't get converted from varchar implicitly
BEGIN
	SET @stringData=@stringData+'''convert(money,''''''+isnull(cast('+@colName+' as varchar(200)),''0.0000'')+''''''),''+'
END
ELSE 
IF @dataType='datetime'
BEGIN
	--SET @stringData=@stringData+'''convert(datetime,''''''+isnull(cast('+@colName+' as varchar(200)),''0'')+''''''),''+'
	--SELECT 'INSERT Authorizations(StatusDate) VALUES('+'convert(datetime,'+isnull(''''+convert(varchar(200),StatusDate,121)+'''','NULL')+',121),)' FROM Authorizations
	--SET @stringData=@stringData+'''convert(money,''''''+isnull(cast('+@colName+' as varchar(200)),''0.0000'')+''''''),''+'
	SET @stringData=@stringData+'''convert(datetime,'+'''+isnull('''''+'''''+convert(varchar(200),'+@colName+',121)+'''''+''''',''NULL'')+'',121),''+'
  --                             'convert(datetime,'+isnull(''''+convert(varchar(200),StatusDate,121)+'''','NULL')+',121),)' FROM Authorizations
END
ELSE 
IF @dataType='image' 
BEGIN
	SET @stringData=@stringData+'''''''''+isnull(cast(convert(varbinary,'+@colName+') as varchar(6)),''0'')+'''''',''+'
END
ELSE --presuming the data type is int,bit,numeric,decimal 
BEGIN
	--SET @stringData=@stringData+'''''''''+isnull(cast('+@colName+' as varchar(200)),''0'')+'''''',''+'
	--SET @stringData=@stringData+'''convert(datetime,'+'''+isnull('''''+'''''+convert(varchar(200),'+@colName+',121)+'''''+''''',''NULL'')+'',121),''+'
	SET @stringData=@stringData+''''+'''+isnull('''''+'''''+convert(varchar(200),'+@colName+')+'''''+''''',''NULL'')+'',''+'
END

SET @string=@string+@colName+','

FETCH NEXT FROM cursCol INTO @colName,@dataType
END
DECLARE @Query nvarchar(4000)

SET @query ='SELECT '''+substring(@string,0,len(@string)) + ') VALUES(''+ ' + substring(@stringData,0,len(@stringData)-2)+'''+'')'' FROM '+ @schemaName +'.' + @tableName
print @query 
exec sp_executesql @query
--select @query

CLOSE cursCol
DEALLOCATE cursCol