Random pitfalls (and their solutions) in EAI technologies such as BizTalk
Friday, October 12, 2012
Reading current UNB Reference numbers from Biztalk
While migrating EDIFACT partners from Biztalk 2006 to 2010, we had to read the current UNB Reference numbers from the Biztalk 2006 database. They are stored in the BiztalkMsgBoxDb database in table EdiSequenceNumbers. Using the column PartyId, one can link the numbers to the EDI party information from database BiztalkMgmtDb, table EdiPartnerEdifactInterchange.
BTW, beginning from Biztalk 2009, you can directly set the UNB Reference number before sending the EDIFACT XML to the EDI Send Pipeline, hence it might be useful to create the number by oneself.
Labels:
Biztalk,
EDIFACT,
EDISendPipeline
Location:
Hamburg, Deutschland
Tuesday, September 27, 2011
Parse XML with XmlReader (closing empty elements correctly)
If you want to parse an XML document with the XmlReader, it might help to use this XmlReader example from MSDN. However, there's one thing missing: If you parse an XML with empty elements, such as:
<example1 />
<example2>bla</example2>
the example doesn't set the closing tags write, but like this:
<example1>
<example2>bla</example2>
</example1>
In order to omit this problem, you have to write the end elements in case that the reader parses an empty element:
case XmlNodeType.Element:
writer.WriteStartElement(reader.Name);
writer.WriteAttributes(reader, true);
if (reader.IsEmptyElement)
writer.WriteEndElement();
break;
<example1 />
<example2>bla</example2>
the example doesn't set the closing tags write, but like this:
<example1>
<example2>bla</example2>
</example1>
In order to omit this problem, you have to write the end elements in case that the reader parses an empty element:
case XmlNodeType.Element:
writer.WriteStartElement(reader.Name);
writer.WriteAttributes(reader, true);
if (reader.IsEmptyElement)
writer.WriteEndElement();
break;
Friday, September 23, 2011
VS/BTS Error "The system cannot find the file specified"
If you receive the error message "The system cannot find the file specified." with the exception code 80070002 while adding a disassembling schema in Visual Studio/BizTalk, it is because VS does not find the assembly from the referenced project with the schema. Just build the referenced project, and then you should be able to add the schema.
Wednesday, September 14, 2011
Error details: The Messaging Engine encountered an error during the processing of one or more inbound messages.
If you have created a flatfile schema, you might run into the following error:
A message received by adapter "FILE" on receive location "..." with URI "D:\dev\TestFlatfileDis\filedrop\*Copy.txt" is suspended.In this case, it might be that your test file is running into an error while reading the lines:
Error details: The Messaging Engine encountered an error during the processing of one or more inbound messages.
Reason: Unexpected data found while looking for:To solve this, check that all the lines go until a certain column. If you can't ensure this, you could define the fields (at the end of the line) with MinOccurs=0, so that it can be omitted.
'\r\n'
The current definition being parsed is Root. The stream offset where the error occured is 13. The line number where the error occured is 3. The column where the error occured is 2.
Wednesday, September 7, 2011
XML-Error Message "content is not allowed in prolog"
When we created a BizTalk Mapping in VS2008, the compiler returned the error "line 1 colum 1 content is not allowed in prolog". Since the compiler told us that the error was detected in the very beginning (line 1 column 1), we needed a bit of time to see that actually the error was inside the document, where we had filled an element with a value although this shouldn't contain one.
So, if you get the same error message, check which fields you filled and if one of these shouldn't be filled.
So, if you get the same error message, check which fields you filled and if one of these shouldn't be filled.
Tuesday, September 6, 2011
32/64-bit Installation of Oracle Adapter
After installing the Oracle Adapter, it might be that you run into errors in run-time, though you solved all the problems so that you could connect to Oracle in VS. ;-) I ran into the following error
System.IO.FileNotFoundException: Die Datei oder Assembly Oracle.DataAccess, Version=2.111.7.20, ...
Actually, the Oracle WCF adapter found the assembly 2.111.7.0, but was searching the Oracle.DataAccess.dll in the BizTalk installation folder:
Furthermore, deploy the policies "policy.2.x.Oracle.DataAccess" into the 32- and the 64-bit GAC to because both VS and the administration console of the BizTalk are searching for the assembly.
System.IO.FileNotFoundException: Die Datei oder Assembly Oracle.DataAccess, Version=2.111.7.20, ...
Actually, the Oracle WCF adapter found the assembly 2.111.7.0, but was searching the Oracle.DataAccess.dll in the BizTalk installation folder:
LOG: Diese Bindung startet im default-Load-Kontext.The problem was inconsistent image-typing: While VS ran in 32bit, the BizTalk host instance ran in 64bit so that it didn't look in the GAC... Using a 32-bit host instance solved the problem; however, more elegant might be to install a 64-bit version of the Oracle.DataAccess (that however could cause problems with a 32-bit VS...)
LOG: Die Anwendungskonfigurationsdatei wird verwendet: D:\Program Files (x86)\Microsoft BizTalk Server 2009\BTSNTSvc64.exe.Config
LOG: Die Computerkonfigurationsdatei von C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\config\machine.config wird verwendet.
LOG: In der Anwendungskonfigurationsdatei wurde eine Umleitung gefunden. 2.111.7.0 wird nach 2.111.7.20 umgeleitet.
LOG: Verweis nach der Richtlinie: Oracle.DataAccess, Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342
LOG: Download von neuem URL file:///D:/Program Files (x86)/Microsoft BizTalk Server 2009/Oracle.DataAccess.DLL.
Furthermore, deploy the policies "policy.2.x.Oracle.DataAccess" into the 32- and the 64-bit GAC to because both VS and the administration console of the BizTalk are searching for the assembly.
Monday, September 5, 2011
Installing Oracle WCF-Adapter
In order to use the LOB WCF-Adapter for Oracle, you have to install an oracle client. Since BizTalk requests the assembly Oracle.DataAccess of version 2.111.7.0 or above, you have to select a correct Oracle client at least in version 11.2.0.21.
Install the client according to Steef-Jan Wigger's explanation. In %oracle%\product\11.1.0\client_1\odp.net\bin\2.x, you find the Oracle.DataAccess and you can put it to the GAC using OraProvCfg.exe that also redirects all assembly invocations to the actual one. (Otherwise, VS throws an error that it can't find version 2.111.7.0).
Additionally, you can add the sqlnet.ora und tnsnames.ora into %oracle%\product\11.1.0\client_1\Network\Admin. You find samples in the "Sample" folder.
ORA-1017: invalid name/password: When you connect from Visual Studio to the Oracle server, make sure to write the username in capital letters, even if the username is not written in capital letters in Oracle (otherwise you get an ORA-1017: invalid name/password error)!
Install the client according to Steef-Jan Wigger's explanation. In %oracle%\product\11.1.0\client_1\odp.net\bin\2.x, you find the Oracle.DataAccess and you can put it to the GAC using OraProvCfg.exe that also redirects all assembly invocations to the actual one. (Otherwise, VS throws an error that it can't find version 2.111.7.0).
Additionally, you can add the sqlnet.ora und tnsnames.ora into %oracle%\product\11.1.0\client_1\Network\Admin. You find samples in the "Sample" folder.
ORA-1017: invalid name/password: When you connect from Visual Studio to the Oracle server, make sure to write the username in capital letters, even if the username is not written in capital letters in Oracle (otherwise you get an ORA-1017: invalid name/password error)!
Labels:
Biztalk,
Oracle,
SDK Adapter Pack 2,
WCF adapter,
WCF LOB adapter
Friday, September 2, 2011
Error Message: "Fehler beim Laden der Eigenschaftenliste anhand des Namespaces, oder Eigenschaften in der Liste nicht gefunden."
On a German installation, the BizTalk server threw the following error message after parsing a message:
Fehler beim Laden der Eigenschaftenliste anhand des Namespaces, oder Eigenschaften in der Liste nicht gefunden, Überprüfen Sie, ob das Schema korrekt bereitgestellt wurde.Actually, this error states already the problem quite good, which is that the message contains a promoted property that doesn't exist in the schema property. So, if you get this error message, go through your code and have a close look at all properties that you set and check whether you've spelled their names correctly.
Labels:
Biztalk,
Pipeline Component,
promoted properties
Tuesday, August 30, 2011
Setting the mail address of Receiver in the Pipeline Component
If you want to send a message with a static or dynamic SMTP send port, you can configure the mail address of the receiver in a pipeline component. Therefore, you have to promote OutboundTransportLocation in the message context of the message:
msgContext.Promote("OutboundTransportLocation", "http://schemas.microsoft.com/BizTalk/2003/system-properties", "mailto:" + mailAddress);
Wednesday, August 24, 2011
How to Filter in Orchestrations on Promoted Properties
If you want to do direct-bounding into an orchestration (for example, because you're implementing an ESB where send ports and orchestrations subcribe directly to the message box), you would define filter expressions in the receive shape.
Basically, you can filter on schema properties that are referenced in the BizTalk project of your orchestration. However, to make them visible (and selectable) here, you have to publish them. You can do this in (at least) two ways:
Basically, you can filter on schema properties that are referenced in the BizTalk project of your orchestration. However, to make them visible (and selectable) here, you have to publish them. You can do this in (at least) two ways:
- First, you could promote a field in the incoming message and link the field to a promoted property. This option helps you if you filter on a field that is inside the message.
- Second - if the data is not part of the message but a header information - you have to set the "property schema base" of the schema property to MessageContextPropertyBase. This way, it gets visible and you can filter on it.
Subscribe to:
Posts (Atom)