Friday, 3 October 2014

BizTalk Send port wont enlist

Leaving some white-space in the binding file of a send port filter will make the port unable to enlist. Opening the send port from the admin console will reveal a disabled filter section.





Incorrect:

<Filter>
        &lt;?xml version="1.0" encoding="utf-16"?&gt;
        &lt;Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
        &lt;Group&gt;
        &lt;Statement Property="BTS.ReceivePortName" Operator="0" Value="GetContacts" /&gt;
        &lt;/Group&gt;
        &lt;/Filter&gt;
   </Filter>

Correct:

<Filter>&lt;?xml version="1.0" encoding="utf-16"?&gt;
        &lt;Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
        &lt;Group&gt;
        &lt;Statement Property="BTS.ReceivePortName" Operator="0" Value="GetContacts" /&gt;
        &lt;/Group&gt;
        &lt;/Filter&gt;
   </Filter>

Monday, 29 September 2014

Gac all assemblies in a directory


Installs all assemblies in a particular directory into the global assembly cache from batch file.


@SETLOCAL
@ECHO OFF
@CALL "%VS110COMNTOOLS%vsvars32.bat"

@SET BuildFolder=..\bin\Debug

@ECHO.
@ECHO GAC all project assemblies...


@for %%f in (%BuildFolder%\*.dll) do (

        @echo %%~nf.dll
@gacutil -if %BuildFolder%\%%~nf.dll
    )

@PAUSE
@EXIT
@ENDLOCAL

Execute a batch file from Visual Studio


From the menu select Tools => External Tools

Then add the following:




Sunday, 28 September 2014

SQL job to remove old BizTalk backup files


Run this:

EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1

GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO

Save and schedule this in a sql job:

EXEC xp_cmdshell 'FORFILES /p "D:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Backup" /s /m AU-*.bak /d -1 /c "CMD /C del /Q /F @FILE"'

BizTalk Developer - Interview Question 1.

Rewrite the following xml without using namespace prefixes:


<ns0:RootNode Code="COMP" xmlns:ns0="http://ABC.Schemas.RootNode">
  <Identifier>X984991</Identifier>
  <Products>
    <Product>
      <Code>WW01</Code>
      <Description>Winter Woolies</Description>
    </Product>
  </Products>
</ns0:RootNode>