BizTalk and Oracle EBS User Defined Types (UDTs) – Only one .Net assembly allowed
When you are generating Oracle EBS User Defined Types (UDT) using the generation wizard in Visual Studio, you may encounter the following error:
A message sent to adapter “WCF-Custom” on send port “SP.Oracle” with URI “oracledb://ORACLE” is suspended.
Error details: System.InvalidOperationException: Custom type mapping for ‘dataSource=’ORACLE’ schemaName=’SCHEMA’ typeName=’SCHEMATYPE” is not specified or is invalid.
Good chance that you are generating several libraries (dll) for your user assemblies (userAssembliesLoadPath), instead of just one. Oracle’s ODP.Net only allows one assembly for your UDTs. So if you are generating a different UDT library for your Purchase Orders and another for your Sales Orders, it’s not going to work.
So instead you should recreate the schema’s every single time?! So if Oracle adds UDTs, it means you need to regenerate the library selecting all the objects you will be using in BizTalk. Quite unrealistic indeed!
Solution: use ILMerge
To get around this problem, you can merge all the dlls of the UDTs into one single assembly. Microsoft has a tool for this called ILMerge. There’s also an ILMerge GUI for ILMerge, allthough the command line tool should be enough to automate this process.
So if you have two assemblies called POTypes.dll and SOTypes.dll, you can merge them with ILMerge like this:
ILMerge.exe /out:VTech.EU.BizTalk.eBS.OracleTypes.dll /keyfile:Oracle.eBS.snk POTypes.dll SOTypes.dll
And with some imagination you can build your own script around it. Maybe a batch or some custom wrapper, which can then be placed in your post build event and makes sure it always merges the latest dlls for you.