John Glisson's Blog

Geeky stuff…

XSLT String Padding

leave a comment »

I had the need to pad values in a xsl template from a BizTalk map. These helpful call templates did the trick:

http://www.dpawson.co.uk/xsl/sect2/padding.html

<xsl:template name=”prepend-pad”>
<!– recursive template to right justify and prepend–>
<!– the value with whatever padChar is passed in   –>
<xsl:param name=”padChar”/>
<xsl:param name=”padVar”/>
<xsl:param name=”length”/>
<xsl:choose>
<xsl:when test=”string-length($padVar) &lt; $length”>
<xsl:call-template name=”prepend-pad”>
<xsl:with-param name=”padChar” select=”$padChar”/>
<xsl:with-param name=”padVar” select=”concat($padChar,$padVar)”/>
<xsl:with-param name=”length” select=”$length”/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select=”substring($padVar,string-length($padVar) -
$length + 1)”/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template name=”append-pad”>
<!– recursive template to left justify and append  –>
<!– the value with whatever padChar is passed in   –>
<xsl:param name=”padChar”/>
<xsl:param name=”padVar”/>
<xsl:param name=”length”/>
<xsl:choose>
<xsl:when test=”string-length($padVar) &lt; $length”>
<xsl:call-template name=”append-pad”>
<xsl:with-param name=”padChar” select=”$padChar”/>
<xsl:with-param name=”padVar” select=”concat($padVar,$padChar)”/>
<xsl:with-param name=”length” select=”$length”/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select=”substring($padVar,1,$length)”/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

Written by jglisson73

August 5, 2011 at 4:29 pm

Posted in Uncategorized

Tagged with ,

ESB WCF Pipeline Error

leave a comment »

I was receiving a very troubling error message when trying to submit a message to the ESB Bus through the ESB.ItineraryServices.WCF/ProcessItinerary.svc service.

ItinerarySelectReceiveXml – Verify the schema for this document specification is deployed and is in the Global Assembly Cache.

I thought I was going to have to reinstall the ESB Toolkit. It turns out all I needed to do was change the IIS Application Pool the WCF website was running on from .NET 2.0 to .NET 4.0. Apparently it was looking for the assembly in the 2.0 GAC rather than the 4.0 GAC.

Thanks to this forum thread for the solution!

Written by jglisson73

June 2, 2011 at 1:46 pm

Posted in Uncategorized

Tagged with ,

Using a Transform in an ESB Itinerary After a Flat File Disassembler

leave a comment »

That subject is a mouthful!

This is a situation I was having and was resolved using this technique

When parsing a flat-file, then applying a transform (map) to it in an itinerary, I was consistently getting an error message:

Description: There was a failure executing the receive pipeline

Reason: Cannot access a disposed object.

Object name: ‘DataReader’.

Updating the FF Disassembler Pipeline Component in my custom Pipeline fixed the issue. I had to set the “Recoverable interchange processing” property to true.

This article describes the function of this property in the disassemble stage.

Written by jglisson73

May 25, 2011 at 12:39 pm

Posted in Uncategorized

Tagged with ,

BizTalk 2010 Current ISA Control Numbers

leave a comment »

This is some useful information about how EDI Control Numbers are managed within BizTalk 2010.

http://social.msdn.microsoft.com/Forums/en-US/biztalkediandas2/thread/17e16112-209b-40ed-926b-8d2627954b9a/

I have a situation at a client because we were keeping the Party/Agreement nodes in the Bindings file when we promoted new bindings from QA to Production. This was causing the Party Agreements to get dropped and re-created, which reset the control numbers back to 1. The result was 997 rejects for duplicate control numbers.

Moving forward, I will have to be careful to remove the Trading Partners from the Bindings file which we do not want to be dropped and re-created, that way the EDI Control Numbers will be maintained.

This is the answer to my question about the issue from the MSDN Forum link above:

To get the current ISA Control number, you can find it in the BizTalkMsgBoxDb database EdiControlNumbers table. Control numbers are maintained based on the Agreement set up between trading partners. Agreement details can be found in BizTalkMgmtDb – tpm.OnewayAgreement table.

When you import binding file with a party information, which already exists, existing agreement id will be removed and new agreement id will be created with new control numbers(1 as starting value).

Here are the queries I used to help track down the Party to get the OneWayAgreement.Id to use when querying the EdiControlNumbers table.

 USE BizTalkMgmtDb

select * from tpm.OnewayAgreement o

inner join tpm.BusinessIdentity bi on bi.Id = o.ReceiverId

inner join tpm.BusinessProfile bp on bp.ProfileId = bi.ProfileId

where bp.Name like ‘%[name]%’

USE BizTalkMsgBoxDb

select * from EdiControlNumbers

where OnewayAgreementId = [id]

Written by jglisson73

April 15, 2011 at 3:19 pm

Posted in Uncategorized

Tagged with

SQL Server Loopback Linked Server

leave a comment »

Occasionally I run across companies that make use of linked servers. This can be a nasty little detail in a development environment to fully test database code. The solution is to create a loopback linked server so that code referencing a linked server will run as if it were running in the distributed production environment.

  1. Get a backup of the database on the other end of the linked server call.
  2. Restore the backup on your local SQL Server instance
  3. Run the code below to create the loopback linked server

EXEC sp_addlinkedserver @server = N’name_for_linked_server’,

@srvproduct = N’ ‘,

@provider = N’SQLNCLI’,

@datasrc = N’name_of_my_sqlserver_instance’,

@catalog = N’name_of_database’

 

 

Written by jglisson73

February 24, 2011 at 6:31 pm

Posted in Uncategorized

Tagged with

BizTalk 2010 ESB 2.1 Portal Issue

leave a comment »

Long live Google. I was having an issue with the ESB Portal (2.1) on a BizTalk 2010 machine. I found the fix at the following link.

http://www.businessprocessintegration.net/2009/03/espportal-and-a-network-related-or-instance-specific-error-occurred-while-establishing-a-connection-to-sql-server/

I was seeing this error when I would attempt to navigate to the Registry tab of the ESB Portal.

Exception information:

Exception type: SqlException

Exception message: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 – No connection could be made because the target machine actively refused it.)

Request information:

Request URL: http://localhost/ESB.Portal/Lists/RegistrySummaryContainer.aspx

Request path: /ESB.Portal/Lists/RegistrySummaryContainer.aspx

The solution was to enabled TCPIP in the SQL Server Configuration Manager under SQL Server Network Configuration–>Protocols for MSSQLSERVER.

The same issue is addressed at this blog post and has an interesting comment.

I solved the problem the opposite way: I altered the connection string to remove “Network Library=dbmssocn”, thus eliminating the requirement to use TCP/IP.Richard

I did not try that solution, but it sounds plausible as well.

Written by jglisson73

February 17, 2011 at 2:51 pm

Posted in Uncategorized

Tagged with ,

BizTalk 2010 Pipeline Component Wizard

leave a comment »

In case you were wondering, the 2.20 release of the BizTalk Pipeline Component Wizard project on CodePlex works with BizTalk 2010.

http://btsplcw.codeplex.com/releases/view/46419

It took me a little while to find it on Google, so I thought I’d give something to add to the search community!

Written by jglisson73

February 8, 2011 at 5:39 pm

Posted in Uncategorized

Tagged with

BizTalk Map Documenter for 2010

with 2 comments

I have a project with BizTalk 2010 and really want to use the BizTalk Map Documenter for the maps. I pointed it to my maps and the output did not show the content from Constant Functoids or Links into Functoids.

I looked through the XSLT file and discovered a couple of tweaks that got it all working.

Basically, everywhere in the XSLT where it references ”@Type = ‘Link’” or ”@Type = ‘Constant’” had to be changed to ”@Type = ‘link’” and ”@Type = ‘constant’”.

XLST is a case-sensitive language. Apparently in BizTalk 2010 the Type for Links and Constants in the map-generated code has all lower-case “link” and “constant”.

Anyway, I am glad to have found an easy solution. It sure beats having to put all that documentation together by hand! There will be lots of maps by the end of this project, so I am happy to have an automated tool to create useful docs.

Written by jglisson73

February 4, 2011 at 8:57 pm

Posted in Uncategorized

Tagged with ,

Internet Connection Not Working in Virtual PC

leave a comment »

I have a MS VPC 2007 with Windows Server 2008 as the guest operating system. Today I suddenly had issues accessing the internet from the VPC. I tried resetting the adapters and blah blah blah, nothing worked. After a quick Google search, I discovered this article that got me up and running.

http://www.tipandtrick.net/2008/fix-virtual-pc-2007-shared-networking-nat-internet-not-working-in-windows-server-2003-2008-and-vista-guest-os/

It appears that Ping was working, but url browsing was not.

Written by jglisson73

December 29, 2010 at 2:13 pm

Posted in Uncategorized

Tagged with

BizTalk Orchestration Will Not Open in the Designer

leave a comment »

I had an issue after upgrading a BizTalk Orchestration project from version 2006r2 to 2010. One of the Orchestrations mysteriously would not open in the Orchestration Editor in Visual Studio. Rather, it would open in the XML editor. The code would compile properly, but obviously this was unacceptable.

I followed these steps and was able to get the Orchestration to open properly in the IDE:

  1. Close Visual Studio
  2. Launch the services console with the command: Services.msc. Restart the “Protected Storage” Service (make sure it is in the automatic mode and started).
  3. Restart IIS with the command : iisreset
  4. Reset the Visual Studio loaded packages (in a Visual Studio Command Prompt) with the command: devenv.exe /setup /resetskippkgs

After these steps, I right-clicked on the Orchestration in the IDE Solution Explorer, chose “Open With” and then Orchestration Designer just to make sure it would open as expected.

I found this solution here: http://geekswithblogs.net/synBoogaloo/archive/2007/04/17/111745.aspx#423642

Written by jglisson73

December 27, 2010 at 4:34 pm

Posted in Uncategorized

Tagged with

Follow

Get every new post delivered to your Inbox.