Omer Dansky’s Blog

Just another WordPress.com weblog

Solution for when you get the error The partner transaction manager has disabled its support for remote/network transactions Exception from HRESULT: 0x8004D025

A team member found this link with the solution:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=230390&SiteID=1

(Thanks to morningsunshine):

First verify the “Distribute Transaction Coordinator” Service is
running on both database server computer and client computers
1.      Go to “Administrative Tools > Services”
2.      Turn on the “Distribute Transaction Coordinator” Service if it is not running

If it is running and client application is not on the same computer as
the database server, on the computer running database server
1.      Go to “Administrative Tools > Component Services”
2.      On the left navigation tree, go to “Component Services > Computers
> My Computer” (you may need to double click and wait as some nodes
need time to expand)
3.      Right click on “My Computer”, select “Properties”
4.      Select “MSDTC” tab
5.      Click “Security Configuration”
6.      Make sure you check “Network DTC Access”, “Allow Remote Client”,
“Allow Inbound/Outbound”, “Enable TIP” (Some option may not be
necessary, have a try to get your configuration)
7.      The service will restart
8.      BUT YOU MAY NEED TO REBOOT YOUR SERVER IF IT STILL DOESN’T WORK
(This is the thing drove me crazy before)

On your client computer use the same above procedure to open the
“Security Configuration” setting, make sure you check “Network DTC
Access”, “Allow Inbound/Outbound” option, restart service and computer
if necessary.

On you SQL server service manager, click “Service” dropdown, select
“Distribute Transaction Coordinator”, it should be also running on
your server computer.

November 25, 2008 Posted by | Biztalk | , , | Leave a comment

Orders Receive Adapter – String was not recognized as a valid DateTime

When getting an error like this:

==================================================

Event Type: Error
Event Source: Commerce Server Orders Receive Adapter
Event Category: None
Event ID: 0
Date:  19/11/2008
Time:  11:07:00
User:  N/A
Computer: SV-BIZ2
Description:
Failed submitting message to BizTalk.  Message: String was not recognized as a valid DateTime..  Stack trace:    at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
   at System.DateTime.Parse(String s, IFormatProvider provider)
   at Microsoft.CommerceServer.Adapter.Orders.OrdersReceiveEndpoint.get_TimeWindow()
   at Microsoft.CommerceServer.Adapter.Orders.OrdersReceiveEndpoint.SubmitBatch().

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

==================================================

 

All you need to do – is

1. disable the receive location.

2. start->run->regedit->and go to:
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Commerce Server 2007 BizTalk Adapters\Orders]

3. Delete the Key which associates with with the Orders Receive port (you can find it in the adapter properties: “Registy Subkey”

4. Start the port again.

 

Omer

November 19, 2008 Posted by | Biztalk | , | Leave a comment

Select Distinct Commerce Server Catalog SearchClause

 

In this case I needed to get a list of products from the Commerce Server catalog.

As you probably know, it is possible to get a catalog content from Commerce Server via BizTalk catalog adapter.

In this scenario I get a list of products which needs to be updated – but the client does not have all the mandatory fields.

To get all the product details I use the “CommerceServerCatalogQuery”  schema.

I came across this article which explains how to build “SeachClause” dynamically inside the BizTalk map.

   

The two main issues I found with the  article above are:

1.       Moving this function from map to map for each client could be a bit complicated (The xpath is messy and has to be manipulated for each scenario).

2.       The result “SearchClause” is not distinct.

  

Solution 

This is what I did to make it distinct (and maybe a bit more reusable).

1.       For each product in the source file – I call Inline C# function (“GetProductDistinctSearchClause”)

2.       I created two global variables (returnSearchClause,duplicateProdList).

3.       GetProductDistinctSearchClause decides if the product already exists in the list. Then it calls a private function (“GetSearchClause”)

4.       GetSearchClause returns an updated “SearchClause” string.

Breakdown Example

Source File example:

Source Example

Source Example

 

Result File example:

Result File

Result File

 

 

Here is an example of a BizTalk map which builds a “CommerceServerCatalogQuery”  message. 

How The Map Looks Like

How The Map Looks Like

As you can see there are 2 functoids in the map:

1.       Inline XSLT

2.       Inline C#

 

 

 

The Inline XSLT code:

 

Inline XSLT

Inline XSLT

 <xsl:for-each select=”/*[local-name()=’ExcelXLSWorkbook’ and namespace-uri()=’http://SIT.Schemas.ExcelRelationshipImport’%5D/*%5Blocal-name()=’Sheet1&#8242; and namespace-uri()=’http://SIT.Schemas.ExcelRelationshipImport’%5D%5B1%5D/*%5Blocal-name()=’Sheet1_Record&#8217; and namespace-uri()=’http://SIT.Schemas.ExcelRelationshipImport’%5D/*%5Blocal-name()=’ProductId&#8217; and namespace-uri()=’http://SIT.Schemas.ExcelRelationshipImport’%5D”&gt;
 <xsl:variable name=”varProdId” select=”.”/>
 <xsl:variable name=”varReturnValue” select=”userCSharp:GetProductDistinctSearchClause($varProdId)” />
 <xsl:attribute name=”SearchClause”><xsl:value-of select=”$varReturnValue” /></xsl:attribute>
</xsl:for-each>

 

The Inline C# code:

This is the inline C# code

This is the inline C# code

 

Here is the code

public System.Collections.Generic.List<string> duplicateProdList = 
new System.Collections.Generic.List<string>();
public string returnSearchClause = string.Empty;
// public function which is being called from the inline XSLT script
public string GetProductDistinctSearchClause(string prodId)
{
    ProductExists productExists = ProductExists.ItemError;
    if(!duplicateProdList.Contains(prodId.Trim().ToLower()))
    {
        duplicateProdList.Add(prodId.Trim().ToLower());
        productExists = duplicateProdList.Count == 1 ? 
        ProductExists.ItemExistsFirstTime : ProductExists.ItemExistsRepeat; 
    }
    else
    {
        productExists = ProductExists.ItemAlreadyExists; // item is duplicate
    }
    returnSearchClause = GetSearchClause(prodId, productExists);
    return returnSearchClause;
}
 
private string GetSearchClause(string prodId,ProductExists productExists)
{
    if (productExists > ProductExists.ItemAlreadyExists)
    {
        if (productExists == ProductExists.ItemExistsFirstTime)
        {
            returnSearchClause = 
            string.Format("ProductId='{0}'", prodId.Trim());
        }
        else
        {
            returnSearchClause += 
            string.Format(" OR ProductId='{0}'", prodId.Trim());
        }
    }
    return returnSearchClause;
}
private enum ProductExists
{
    ItemError = -1,
    ItemAlreadyExists,
    ItemExistsFirstTime,
    ItemExistsRepeat
}

 

 Good luck, Omer

October 28, 2008 Posted by | Biztalk, Maps | , , , , , , | Leave a comment