Archive

Posts Tagged ‘Configuration Errors’

BizTalk Best Practices | Tip and Tricks

January 6, 2012 Leave a comment

Below is a list that needs to be remembered when developing BizTalk solutions.

BizTalk Orchestration:

XPath Expressions: 1. To do an XPath count:


countVariable = System.Convert.ToInt32(xpath(yourMsg, "count({XPATH Instance path,can be copied from Schema})"));

2. To extract a value using XPath (string):

stringVar = xpath(yourMessage, "string({XPATH Instance path,can be copied from Schema})")

BizTalk WCF-SQL Adapter:

When confronted with the problem about MSDTC issue, either due to cross domain or the actual MSDTC being disabled this adapter will still work by just setting the useAmbientConnection to FALSE

BizTalk mySAP Adapter:

1. RFC/BAPI function not returning any result.

When expecting a response from SAP via RFC or BAPI you always need to supply an empty node wherein you’re expecting a result. For example if the field is under the T_QAIVCTAB, in the mapping you need to generate this field by mapping a scripting functoid that returns empty string.

2. Set EnableSafeTyping to True

To avoid nasty data type issue when sending/receiving a response set this value to true in your binding. Data type error: An error occurred when trying to convert the byte array [30-00-30-00-30-00-30-00-30-00-30-00-30-00-30-00] of RFCTYPE RFCTYPE_DATE with length 8 and decimals 0 to XML format. Parameter/field name: Error message: Year, Month, and Day parameters describe an un-representable DateTime. —> System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime. at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day) Configuration: Schema Generation: During the schema generation (WCF Consume Adapter Service) also set the Enable Safe Typing to TRUE.

BizTalk Mapping:

Microsoft.XLANGs.Core.XTransformationFailureException: Error encountered while executing the transform. Error:Transformation failed.. —> System.Xml.XPath.XPathException: Function ‘userCSharp:ConvertToDecimal()’ has failed. —> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.FormatException: Input string was not in a correct format.

1. Be careful in data conversion inside the mapping especially when using Scripting Functiod to convert values. One prime example is when you use the Convert.ToDecimal method. If you use this method and the value contains scientific notation ( 3.71615996396169E-02) it will throw an exception. The correct way of doing it is by using the Decimal.Parse method.

decimal d = Decimal.Parse("8.71615996396169E-02", System.Globalization.NumberStyles.Float);

SAP Schema Generation Error:

Error Message:

Error while retrieving or generating the WSDL. Adapter message: Details: ErrorCode=RFC_EXCEPTION. ErrorGroup=RFC_ERROR_APPLICATION_EXCEPTION. SapErrorMessage=SEGMENT_UNKNOWN.  AdapterErrorMessage=Error returned by RfcCallReceiveEx while calling RFC: IDOCTYPE_READ_COMPLETE..

Cause:

Idoc segment in SAP is not set to Released. Ask the SAP Team to check whether all segments are released.

BizTalk Deployment

Use BizTalk Deployment Framework (BTDF) to simplify deployment. BTDF can be downloaded from here. BTDF quick tutorial: https://randypaulo.wordpress.com/2012/01/13/biztalk-deployment-framework-btdf-tutorial-walkthrough/ Automating/Silent Install of BTDF using powershell here:  https://randypaulo.wordpress.com/2012/01/31/automating-silent-install-biztalk-deployment-framework-btdf-using-powershell/

ESB Toolkit 2.1 using Enterprise Library 5.0

December 16, 2011 4 comments

If you’re here probably you have a problem about this error:

[A]Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection cannot be cast to [B]Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection. Type A originates from ‘Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ in the context ‘Default’ at location ‘C:\Windows\assembly\GAC_MSIL\Microsoft.Practices.EnterpriseLibrary.Common\4.1.0.0__31bf3856ad364e35\Microsoft.Practices.EnterpriseLibrary.Common.dll’. Type B originates from ‘Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ in the context ‘Default’ at location ‘C:\Windows\assembly\GAC_MSIL\Microsoft.Practices.EnterpriseLibrary.Common\5.0.505.0__31bf3856ad364e35\Microsoft.Practices.EnterpriseLibrary.Common.dll’

Now there’s been lot of discussion how ESB Toolkit 2.1 breaks all other application that uses Enterprise Library 5.0 when deployed on the same machine, that’s because it updates the machine.config, which is the mother of all configs.

As of this moment there’s no fix regarding this matter. To undo the error that ESB Toolkit causes (see error above) you can follow the steps below:

Solution:

Step 1. You need to check the platform that your application targets, either 32bit or 64bit and the .NET Version. For BizTalk 2010 it’s 4.0. 

To check the Host whether it’s using 32bit (default) or 64bit explicitly. BizTalk Admin Console -> Platform Settings -> Hosts -> <HostName> -> Properties -> Options -> 32-bit only flag.

Step 2. After determining the target platform,  open the Notepad.exe (Run as Administrator). It’s important to run it as administrator as we are going to edit the machine.config.

Step 3. Based on the platform open the machine.config using the Notepad.

32-bit: %Windows%\Microsoft.NET\Framework\v4.0.30319\Config

64-bit: %Windows%\Microsoft.NET\Framework64\v4.0.30319\Config

Step 4. Comment or remove the following sections:

<section name=”enterpriseLibrary.ConfigurationSource” type=”Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>

<enterpriseLibrary.ConfigurationSource selectedSource=”ESB File Configuration Source”><sources><add name=”ESB File Configuration Source” type=”Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35″ filePath=”E:\Program Files\Microsoft BizTalk ESB Toolkit 2.1\esb.config”/><add name=”ESB SSO Configuration Source” type=”Microsoft.Practices.ESB.SSOConfigurationProvider.SSOConfigurationSource, Microsoft.Practices.ESB.SSOConfigurationProvider, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ applicationName=”ESB” description=”ESB SSO Configuration” contactInfo=”someone@microsoft.com” userGroupName=”BizTalk Application Users” adminGroupName=”BizTalk Server Administrators”/></sources></enterpriseLibrary.ConfigurationSource>

Step 5. Save and restart the application/services/host instances.

IIS 7 The protocol ‘net.tcp’ is not supported, Enabling net.tcp in IIS using WAS

November 14, 2011 Leave a comment

Without the proper configuration, IIS will throw the error below wheneven you try to use net.tcp:

The protocol ‘net.tcp’ is not supported

Below is the configuration on how you can enable net.tcp in IIS 7.

1. Add WCF Activation, to do this go to Server Management -> Features -> Click Add Features

2. After installing the WCF Activation it may throw an error:

Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’

To fix it, open the command prompt (Run as administrator) and enter the ff:

 C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis -iru

3. Issue an iireset on command prompt.

4. Go to the Web Site -> Right Click -> Edit Bindings – > Click Add, in the type select net.tcp and in the binding information set it to 808:*

5. Go to the Web Site -> In the Actions Pane click Advance Settings  -> In the Behavior change it to http,net.tcp.

Repeat steps for every WCF Service Application (Virtual Directories) under the Web Site.

Categories: IIS Tags: , , ,

Event Log – System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security

November 10, 2011 2 comments

Event Log – System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security

This is a common error specially if you’re using Windows Server 2008 and higher, error means that the application/program that’s trying to write to event log with source not registered properly. Take the sample code below as an example:

EventLog.WriteEntry(“<Source>”,”Message”);

During the deployment you can register the source by entering the ff command in the command prompt (Run as Administrator):

eventcreate /ID 1 /L APPLICATION /T INFORMATION /SO <Source> /D “Registering”

If for some  reason you don’t know the source is and it’s throwing the error do the following:

Start -> Run -> regedit.exe Navigate to My Computer > HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\EventLog

in the Permissions, and grant the identity wherein the application/server is running with read/write permissions.

You will see the source that you need to register in the Event Log.

VS Setup – The version of the .NET Framework launch condition ‘.NET Framework 4’ does not match the selected .NET Framework bootstrapper package

November 2, 2011 Leave a comment

I recently upgraded existing solution built using VS2008 to VS2010 and encountered the warning:

The version of the .NET Framework launch condition ‘.NET Framework 4’ does not match the selected .NET Framework bootstrapper package

To resolve it:

1. The .NET Framework version you have in Launch Condition should match with the 2. Prerequisites in Setup Properties.

 

Launch Condition:

Prerequisites:

BizTalk WCF-SQL Adapter MSDTC Issue

September 27, 2011 Leave a comment

This was imported from my old blog dated  July 3, 2009.

I was working on a Biztalk integration project that perform a CRUD operation using old SQL adapter (the new one is available via Microsoft Adapter Pack 2.0), everything works fine on the development environment but when we’ve tried to deploy it to test environment which have the same structure with the production server we stumble again on MSDTC issues.

To cut the story short it was too complicated and too many settings (firewall, NETBIOS etc) needs to be change since the database server is located on DMZ. The next day while I’m configuring the mySAP adapter, I found out that license has expired, since we’ve downloaded the trial version of BizTalk adapter pack 1.0. So I have to look for another setup, it so happen that for some reason I can’t find the 1.0 version that’s why I’ve installed the Adapter pack 2.0. I was a little bit surprise to see that there’s a new SQL Adapter included. So I’ve installed it and give it a try and it works fine.

Two important sql binding settings that needs to be set are:

1) useAmbientTransaction = false, to solve MSDTC issue.

2) allowIdentityInsert = true, if you’re trying to add rows to a table that has identity column.

 

SQL Login not working in SQL 2008R2/2005

August 19, 2011 1 comment

From time to time I see this problem reoccurring, suppose you correctly setup an SQL Login for a certain account and when you tried to login it throws: Login failed for ‘RPAULO_WebUser’ (Microsoft SQL Server, Error: 18456) you might want to check whether the sql server supports mixed mode by going to SQL Server Properties of the server (connect via RDP).

Note that updating the settings would require a service restart to take effect.

%d bloggers like this: