Quantcast
Channel: BizTalk Guru
Viewing all 56 articles
Browse latest View live

Q & A - How to Configure Parties in BizTalk 101

$
0
0

Q: You are developing an EDI solition, and you need to configure a new trading partner.


A:
Trading partner management is the most significant new functionality presented in BizTalk Server 2010. The new mapper has some nice features, but it doesn't bring new functionality to the product. The trading partner configuration, on the other hand, allows for the development of EDI solutions that could not be done before. This solution outlines how to create a trading partner in BizTalk Server.

Open the BizTalk Administration Console, and click Parties (see Figure 1).

Figure 1. The Parties folder in BizTalk



Right-click any area in the Parties and Business Profiles area and select New => Party.

In the Party Properties dialogue box, give the party an appropriate name. This should be the name of the trading partner you will be exchanging documents with.

Enable the option for the Local BizTalk processing (see Figure 2). This setting is used to indicate that BizTalk Server will be used to process messages to or from the party (rather than being the default party itself).

Figure 2. Configuring the base party object



Click the "Send ports" tab. This is where ports are associated with a party, and it is used in instances where all outbound EDI documents on this port should have envelope information configured as specified in the EDI properties of the party being configured. Add any relevant send ports, and click OK.
            Now that the party object has been created, a new business profile must be created. A business profile contains all of the EDI configurations for a given business of a trading partner. For example, a trading partner may be a single company with multiple departments or divisions. Each department has its own integrations with internal and external vendors, and each uses its own X12 or EDIFACT settings. One business profile for each department must be created in order to ensure that the envelopes on the EDI documents being exchanged are set properly, and that all other EDI specific configurations are accurate for that department.

            Right-click the party that was created, and select New => Business Profile (see Figure 3).

            Figure 3. Creating a business profile on a party




            Give the business profile a name representative of the business unit or department being set up. In many cases, a party will only have a single business profile.


            On the identities screen, set the trading partner ID(s) and qualifier(s) (see Figure 4). These values are given to you directly by the trading partner, and are the way trading partners are uniquely identified.

            Figure 4. Setting the Business Profile's identities


            Once the business profile is fully configured, click OK.
            With the business profile and core party configured, an agreement can be made. However, to create an agreement, you must have two parties configured. One party represents the recipient, and one is the sender. In many cases, BizTalk is going to be one of the parties. However, in the cases where BizTalk is acting as a value added network (VAN)—essentially, as a router of documents between parties—there may be many parties sending and receiving documents to many other parties. All of the configurations representing document communication between parties are known as agreements.

            To create an agreement, right-click the business profile, and select New => Agreement.

            Initially, there will be only a single tab to configure. You must specify the party being interacted with and the protocol being used. To do so, set the Protocol property to (for example) X12, and the Party and Business properties to an available party. Once these have been set, two new tabs will appear (see Figure 5). 
            These tabs are where all of the EDI specific information is configured for the given agreement.

            Figure 5. Setting the general properties of the Agreement



            Click each of the tabs to set the EDI-specific values based on the trading partner configuration specifications. An example of the Identifiers screen is shown in Figure 6. Once you are finished, click OK to save the trading partner configuration.

            Figure 6. Setting values within the agreement



            How It Works

            This recipe outlined how to configure the different components that make up a trading partner, but without the full story, understanding all of the settings is difficult.

                          Creating Classes Using xsd.exe Demystified

                          $
                          0
                          0

                          Posted by 
                          Not a lot of people are familiar with the xsd.exe that ships with Visual Studio. It allows you to create XML/classes from XML/classes. The following are the 4.0 xsd.exe capabilities:
                          XDR to XSD
                          Generates an XML schema from an XML-Data-Reduced schema file. XDR is an early XML-based schema format.
                          XML to XSD
                          Generates an XML schema from an XML file.
                          XSD to DataSet
                          Generates common language runtime DataSet classes from an XSD schema file. The generated classes provide a rich object model for regular XML data.
                          XSD to Classes
                          Generates runtime classes from an XSD schema file. The generated classes can be used in conjunction with System.Xml.Serialization.XmlSerializer to read and write XML code that follows the schema.
                          Classes to XSD
                          Generates an XML schema from a type or types in a runtime assembly file. The generated schema defines the XML format used bySystem.Xml.Serialization.XmlSerializer.
                          It I’m a big fan of using xml schemas (XSDs) to generate classes that can be used to serialize and deserialize objects to and from XML (the XSD to Classes functionality listed above). If your schema changes, just rerunning xsd.exe for the correct schema updates the classes. No manually changes have to be made, including serialization code. It’s a beautiful thing. The problem has been, how do you set up your classes to automatically recompile with changes to the schema, and how do you deal with schemas that import other schemas?

                          XSDs Importing other XSDs

                          A common issue that developers of XSDs run into is violating the DRY principle repeatedly with XSD types. For example, let’s say you create a calendar meeting request service that has two XSDs, one for the request XML and one for the response XML. You’ve defined a xs:complexType “Meeting” that includes the date and location:
                          <xs:complexType name="Meeting">
                          <xs:sequence>
                          <xs:element name="Location"type="xs:string"/>
                          <xs:element name="Date"type="xs:date"/>
                          </xs:sequence>
                          </xs:complexType>
                          But you want to use it in both the request and the response XML. You could just copy and past it into both XSD files, and it will validate just fine, but if you use xsd.exe to generate your classes, it’s going to create two classes of type Meeting, which will cause a compiler error. You could have a separate namespace for each class, but then you’re definitely violating DRY. The answer is to place the Meeting type in a separate XSD and then reference it from both your request and your response XSD. This results in the XSDs below

                          C:\Solution\Project\Types.xsd
                          <?xml version="1.0"encoding="utf-8"?>
                          <xs:schema id="Types"
                          targetNamespace="http://www.Example.com/Types"
                          elementFormDefault="qualified"
                          xmlns="http://www.Example.com/Types"
                          xmlns:mstns="http://www.Example.com/Types"
                          xmlns:xs="http://www.w3.org/2001/XMLSchema"
                          >
                          <xs:complexType name="Meeting">
                          <xs:sequence>
                          <xs:element name="Location"type="xs:string"/>
                          <xs:element name="Date"type="xs:date"/>
                          </xs:sequence>
                          </xs:complexType>
                          </xs:schema>


                          C:\Solution\Project\Request.xsd
                          <?xml version="1.0"encoding="utf-8" ?>
                          <xs:schema elementFormDefault="qualified"xmlns:xs="http://www.w3.org/2001/XMLSchema"xmlns:myTypes="http://www.Example.com/Types">
                          <xs:import namespace="http://www.Example.com/Types"schemaLocation="Types.xsd" />
                          <xs:element name="Request">
                          <xs:complexType>
                          <xs:sequence>
                          <xs:element name="RqstMeeting"type="myTypes:Meeting"/>
                          <xs:element name="RqstName"type="xs:string"/>
                          </xs:sequence>
                          </xs:complexType>
                          </xs:element>
                          </xs:schema>

                          C:\Solution\Project\Response.xsd
                          <?xml version="1.0"encoding="utf-8" ?>
                          <xs:schema elementFormDefault="qualified"xmlns:xs="http://www.w3.org/2001/XMLSchema"xmlns:myTypes="http://www.Example.com/Types">
                          <xs:import namespace="http://www.Example.com/Types"schemaLocation="Types.xsd" />
                          <xs:element name="Response">
                          <xs:complexType>
                          <xs:sequence>
                          <xs:element name="Accepted"type="xs:boolean"/>
                          <xs:element name="AlternateMeeting"type="myTypes:Meeting"minOccurs="0"/>
                          </xs:sequence>
                          </xs:complexType>
                          </xs:element>
                          </xs:schema>


                          Now we’ve defined our Meeting type in one file, and reused it in both our Request.xsd and Response.xsd.


                          Getting xsd.exe To Import XSDs

                          Now that the type has been defined in another file, the xsd.exe will generate this error if you attempt to create the create the Request XML:
                          C:\Solution\Project>xsd.exe Request.xsd /c
                          Schema validation warning: Type 'http://www.Example.com/Types:Meeting' is not declared.
                          Warning: Schema could not be validated. Class generation may fail or may produce incorrect results.
                          Error: Error generating classes for schema 'C:\Solution\Projects\Request'.

                          - The datatype 'http://www.Example.com/Types:Meeting' is missing.
                          If you would like more help, please type "xsd /?".
                          This is due to the fact that the xsd.exe does not use the schemaLocation hint to find the imported schema. You’ve got to include it as a parameter. in your xsd.exe call:
                          C:\Solution\Project>xsd.exe Types.xsd Request.xsd /c
                          This will generate one file call Request.cs that has a Request class, and a Meeting class. Now we just need to create the Response class and we’re good to go. But wait… running “C:\Solution\Project>xsd.exe Types.xsd Response.xsd /c” will create a different file, Response.cs, that contains a Response class and a duplicate Meeting class. Now we’re stuck with another compiler error and no longer DRY.


                          Getting xsd.exe To Not Create Duplicate Classes

                          This is a simple fix, but it took me a long time to figure out. You have to use xsd.exe to compile all of your classes at once, so rather than running two separate commands, you just need to run one:
                          C:\Solution\Project>xsd.exe Types.xsd Request.xsd Response.xsd /c
                          Now you have one file, Response.xsd, with all three classes in it.

                          Getting Visual Studio 2010 To Auto Recompile XSD Generated Classes

                          Using the Project Build Events, you can set the project to always recompile the XSD classes each time you build the project. It is also helpful to rename the file so it isn’t always the name of the last XSD file passed to xsd.exe. Here are the Pre-build event command line values required to auto build the XSD classes and rename the file to XsdGeneratedClasses.cs:

                          EDIT suggested by Jamie instead of the Registry hack (it worked back in the day for me, don't know if it still does), he suggests using "$(TargetFrameworkSDKToolsDirectory)xsd.exe" to find the path of the xsd.exe. Thanks Jamie!

                          "$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A\@InstallationFolder)\bin\NETFX 4.0 Tools\xsd.exe""$(ProjectDir)Request.xsd""$(ProjectDir)Response.xsd""$(ProjectDir)Types.xsd" /c /o:"$(ProjectDir)"
                          move "$(ProjectDir)Types.cs""$(ProjectDir)XsdGeneratedClasses.cs"

                          Now whenever the project get’s built, the XSD generated classes will always be rewritten by xsd.exe



                          Extending XSD Generated Classes

                          Don’t forget that classes created by xsd.exe are all partial classes. It’s a good idea to add default constructors and logic in a separate partial class in a different file. It’s especially helpful for initializing arrays since xsd.exe generated classes use arrays and not ArrayLists or Generic Lists. This allows you to add logic, that won’t be changed when the class is regenerated.


                          Serializing/Deserializing XSD Generated Classes

                          Now your code for Serializing and Deserializing your objects is as simple as this:
                          To Serialize:

                          XmlSerializer s = new XmlSerializer(typeof(Request));System.IO.TextWriter w = new System.IO.StreamWriter(@"C:\Request.xml");s.Serialize(w, new Request());w.Close();


                          To Deserialize:

                          XmlSerializer s = new XmlSerializer(typeof(Request));Request request;System.IO.TextReader r = new System.IO.StreamReader("request.xml");request = (Request)s.Deserialize(r);r.Close();

                          Biz Talk Q&A : Register Correct version of ASP.NET in IIS

                          $
                          0
                          0
                          Q:
                          Getting the below error while browsing the website running on ASP.NET 4 application pool.
                          Server Error in '/myVDir' Application. 
                          -------------------------------------------------------------------------------- Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.TypeLoadException: Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
                          1. Re-register the .NET 4 framework of ASP.NET with IIS
                          1. Force this module to be loaded only inside a 2.0 application pool by changing the configuration manually
                          1. Remove this 2.0 version Module from the list of modules if you are planning to run only ASP.NET 4 application pools.

                          You will run into this problem only if you install the .NET 3.5.1 WCF HTTP Activation feature after the installation of .NET 4 framework on your server.
                          Cause
                          Installation of .NET 3.5.1 WCF HTTP activation feature adds a global module for the 3.0 framework’s 'System.ServiceModel’ assembly for the type 'System.ServiceModel.Activation.HttpModule'. Since the application pool’s runtime version is v4.0, this assembly is tried to be loaded from the .NET 4 assemblies folder. Since, the definition of the 'System.ServiceModel.Activation.HttpModule’ is now moved to the “System.ServiceModel.Activation” assembly, it fails.
                          This problem doesn’t occur if you run your application pool under classic mode. You can resolve the problem by following any of the following:
                          Answer #1
                          To re-register the ASP.NET 4 assemblies with IIS, open a command prompt (as an admin), and navigate to the .NET 4 framework folder (%windir%\Microsoft.NET\Framework\v4.0.30319). Type aspnet_regiis -iru, and press enter. This command will re-register the ASP.NET 4 framework with IIS which will modify the ‘ServiceModel’ configuration to be loaded only inside a .NET 2.0 application pools. For some reason, you choose not to re-register the ASP.NET 4 version assemblies with IIS, you can follow the resolution #2 explained below, which will do the same configuration change, but manually.
                          Answer #2
                          The worker process tries to load the assembly since it passes the pre-condition. Its pre-condition is just “managedHandler” which doesn’t specify the runtimeVersion information. By default it is loaded inside the application pools running with any version of .NET framework.
                          To resolve the problem, change the configuration of the module to be loaded only if the runtime version is 2.0, so that it doesn't interfere with .NET framework 4 application pool:
                          <add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler,runtimeVersionv2.0" />
                          AppCmd syntax:
                          appcmd.exe set config -section:system.webServer/modules /[name='ServiceModel'].preCondition:"managedHandler,runtimeVersionv2.0" /commit:apphost
                          Answer #3
                          Alternatively, you can uninstall the .NET 3.5.1 WCF HTTP activation if you are not planning to use this feature. This would simply remove the module ‘ServiceModel’ from the list of modules. Remember, this is going to affect all the application pools, so if you have any application pool which might use this module, then do not proceed with the uninstallation. Alternatively, you can remove it from the global modules list, and add it specifically to the application needing it.
                          You can also simply remove the module from the modules list. Below is the appcmd to remove the module from the global list.
                          AppCmd to remove the module:
                          appcmd.exe set config -section:system.webServer/modules /-"[name='ServiceModel']" /commit:apphost
                          Below is the AppCmd to add the module to the application needing it.
                          appcmd.exe set config "Default Web Site" -section:system.webServer/modules /+"[name='ServiceModel',type='System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089',preCondition='managedHandler,runtimeVersionv2.0']"

                          Q & A: How To: Get rid of wcf one way port communication error

                          $
                          0
                          0
                          Q:

                          Hi,
                           I Consumed one wcf one way serive at send port,but it is throwing error asking for reply.
                          A message sent to adapter "WCF-WSHttp" on send port "WcfCacheService" with URI "" is suspended.
                          Error details: System.ServiceModel.CommunicationException: The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.
                          Server stack trace:
                          at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
                          at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
                          at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
                          at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)
                          Exception rethrown at [0]:
                          at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
                          at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
                          at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result)
                          at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)
                          MessageId: {BE03C2AD-5888-42AA-AE1B-D25965C6446A}

                           Thanks,


                          Sol:

                          Hi,
                          Problem got solved finally....feel gr8..
                          In Binding tab of WCF-Custom adaptor...Binding Type is customBinding
                          in the bindings rightclick on CustomBindingElement->Add Extention->select one way->and move this to up other wise will get error,bcoz http transport should be last.
                          click ok and apply..thats it..
                          Regards,



                          Q & A : BizTalk Server 2010 Configuration Error SSODB Cannot be created, SSODB is not accessible

                          $
                          0
                          0
                          Q: I have encountered the following error during BizTalk 2010 Configuration Error's : SSODB Cannot be created, SSODB is Not Accessible, SSODB is Used by Another service etc..,

                          Ans: 

                          There are a few known issues encountered during installation and configuration of BizTalk Server 2010,  There are a few points that you need to verify before you start configuring BizTalk Server 2010

                          1. MSDTC Should be configured and Tested for ping using DTC Tester, DTC Ping for Multi-server Installation.
                          2. Installing User need to have permissions to update Active Directory for If Domain Accounts are used for BizTalk Configuration
                          3. BizTalk Service Account used for configuration needs  to have sufficient permissions to access database It needs to be part of SSO Administrators group during configuration
                          4. You need to provide full SQL server name during installation SERVER_NAME\INSTANCE_NAME (Do NOT provide SQL Server Alias even if you have created one it may cause problems).
                          5. In case you have installed .Net 4.0 as a part of Visual Studio or something else you need to register SSOSQL.dll so that SSO is registered to point the correct version of .Net Framework and load the correct dll. REGASM the SSOSQL.dll

                          This must be performed in order to allow the BizTalk Server Configuration console to access the database when performing the Enterprise Single Sign-On initial group creation.
                          1. 1.     On servers which have .NET 4.x installed, a hotfix to repair the .NET version control on the SSOSQL.dll must first be run.  As an administrative user on the BizTalk Server, access this hotfix:

                            http://www.microsoft.com/en-us/download/details.aspx?id=12284
                            2.     As an administrative user on the BizTalk Server or using the Command Prompt being run as an Administrator, register the SSOSQL.dll using:

                            C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe “C:\Program Files\Common Files\Enterprise Single Sign-On\SSOSQL.dll”
                            3.     Ensure you are registering the SSOSQL.dll using the .NET 4.x version of RegAsm.exe or you’ll be wasting your time!  You can register it with an earlier .NET version RegAsm.exe but it will not work – it will not allow your BizTalk Server Configuration to access the database to setup the SSO Group.

                          BizTalk : Q&A : Read Repeating Namepair values using XSLT for-each

                          $
                          0
                          0
                          Q: Hi i have a strange issue with matching specific attribute of xml node. Example code that doesnt work:
                          <xsl:for-each select="../../unit/service/price/season[@name=$period_name]">
                          <xsl:attribute name="std_bed_price">
                          <xsl:value-of select="../@amount"/>
                          </xsl:attribute>
                          </xsl:for-each>
                          Example code that DOES work but i don't like this way too much:
                          <xsl:for-each select="../../unit/service/price/season">
                          <xsl:if test="@name = $period_name">
                          <xsl:attribute name="std_bed_price">
                          <xsl:value-of select="../@amount"/>
                          </xsl:attribute>
                          </xsl:if>
                          </xsl:for-each>
                          If in first example i replace the variable name with some of the values like 'A' it works, i also tested what variable name is selected and it has the correct data inside (so, 'A','B','C' ...)
                          Anyone had this problem before?

                          A: You might try changing it to an apply-templates instead of a foreach. Something like the following should work.
                          <xsl:template match="price">
                          <xsl:attribute name="std_bed_price">
                          <xsl:value-of select="@amount" />
                          </xsl:attribute>
                          </xsl:template>
                          And then call it like:
                          <xsl:apply-template select="../../unit/service/price/[season/@name=$period_name]" />
                          or

                          select="../../unit/service/price/season[./@name=$period_name]

                          BizTalk : How To : Map Repeating Sequence Elements

                          $
                          0
                          0
                          source: paul petrov


                          Repeating sequence groups can often be seen in real life XML documents. It happens when certain sequence of elements repeats in the instance document. Here's fairly abstract example of schema definition that contains sequence group:
                          <xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
                                     xmlns:xs="http://www.w3.org/2001/XMLSchema"
                                     xmlns="NS-Schema1"
                                     targetNamespace="NS-Schema1" >
                            <xs:element name="RepeatingSequenceGroups">
                              <xs:complexType>
                                <xs:sequence maxOccurs="1" minOccurs="0">
                                  <xs:sequence maxOccurs="unbounded">
                                    <xs:element name="A" type="xs:string" />
                                    <xs:element name="B" type="xs:string" />
                                    <xs:element name="C" type="xs:string" minOccurs="0" />
                                  </xs:sequence>
                                </xs:sequence>
                              </xs:complexType>
                            </xs:element>
                          </xs:schema>
                          And here's corresponding XML instance document:
                          <ns0:RepeatingSequenceGroups xmlns:ns0="NS-Schema1">
                            <A>A1</A>
                            <B>B1</B>
                            <C>C1</C>
                            <A>A2</A>
                            <B>B2</B>
                            <A>A3</A>
                            <B>B3</B>
                            <C>C3</C>
                          </ns0:RepeatingSequenceGroups>
                          As you can see elements A, B, and C are children of anonymous xs:sequence element which in turn can be repeated N times. Let's say we need do simple mapping to the schema with similar structure but with different element names:
                          <ns0:Destination xmlns:ns0="NS-Schema2">
                            <Alpha>A1</Alpha>
                            <Beta>B1</Beta>
                            <Gamma>C1</Gamma>
                            <Alpha>A2</Alpha>
                            <Beta>B2</Beta>
                            <Gamma>C2</Gamma>
                          </ns0:Destination>
                          The basic map for such typical task would look pretty straightforward:
                          If we test this map without any modification it will produce following result:
                          <ns0:Destination xmlns:ns0="NS-Schema2">
                            <Alpha>A1</Alpha>
                            <Alpha>A2</Alpha>
                            <Alpha>A3</Alpha>
                            <Beta>B1</Beta>
                            <Beta>B2</Beta>
                            <Beta>B3</Beta>
                            <Gamma>C1</Gamma>
                            <Gamma>C3</Gamma>
                          </ns0:Destination>
                          The original order of the elements inside sequence is lost and that's not what we want. Default behavior of the BizTalk 2009 and 2010 Map Editor is to generate compatible map with older versions that did not have ability to preserve sequence order. To enable this feature simply open map file (*.btm) in text/xml editor and find attribute PreserveSequenceOrder of the root <mapsource> element. Set its value to Yes and re-test the map:
                          <ns0:Destination xmlns:ns0="NS-Schema2">
                            <Alpha>A1</Alpha>
                            <Beta>B1</Beta>
                            <Gamma>C1</Gamma>
                            <Alpha>A2</Alpha>
                            <Beta>B2</Beta>
                            <Alpha>A3</Alpha>
                            <Beta>B3</Beta>
                            <Gamma>C3</Gamma>
                          </ns0:Destination>
                          The result is as expected – all corresponding elements are in the same order as in the source document. Under the hood it is achieved by using one common xsl:for-each statement that pulls all elements in original order (rather than using individual for-each statement per element name in default mode) and xsl:if statements to test current element in the loop:
                            <xsl:template match="/s0:RepeatingSequenceGroups">
                              <ns0:Destination>
                                <xsl:for-each select="A|B|C">
                                  <xsl:if test="local-name()='A'">
                                    <Alpha>
                                      <xsl:value-of select="./text()" />
                                    </Alpha>
                                  </xsl:if>
                                  <xsl:if test="local-name()='B'">
                                    <Beta>
                                      <xsl:value-of select="./text()" />
                                    </Beta>
                                  </xsl:if>
                                  <xsl:if test="local-name()='C'">
                                    <Gamma>
                                      <xsl:value-of select="./text()" />
                                    </Gamma>
                                  </xsl:if>
                                </xsl:for-each>
                              </ns0:Destination>
                            </xsl:template>
                          BizTalk Map editor became smarter so learn and use this lesser known feature of XSLT 2.0 in your maps and XSL stylesheets.

                          BizTalk : How To : Save suspended messages in BizTalk Vb Script

                          $
                          0
                          0

                          Last week, I needed to save 700+ suspended messages to file. I didn’t want to go in to each instance and click ‘save to file’ 700 times. A quick search in the web did not find what I want, however there were a number of articles about extracting messages from the BizTalk tracking database. One of which is this excellent article by Thiago Almeida.
                          My scenario was for an existing BizTalk 2004 implementation in the company and is only a once-off thing I need to do. For the newer BizTalk 2006 applications, there is the ‘Failed Message Routing’ feature that can be enabled on send ports and receive ports. The failed messages could then be easily subscribed to a send port to output to file.
                          Then it occured to me that the WMI script Terminate.vbs has the option to save the messages before terminating the instances (http://go.microsoft.com/fwlink/?LinkID=107591 and slightly updated for 2009). Thus changing this script to do what I want required the least effort. I could just use the script as it is to save all the messages and terminate the instances. However it didn’t take much to modify it to take a parameter for filtering on an instance name and to only save messages (and not terminate them). Below is the usage description of the save_messages.vbs script and the actual script. It works for BizTalk 2004, 2006 and 2009.
                          There is also a replacement of the Terminate.vbs script: Biztalk Terminator.
                          Usage:
                          cscript save_messages.vbs < -Z | -A | -DIS | -SR | -SNR > [Port/Orchestration name]
                          -Z saves all “Zombie” instances (e.g. completed with discarded messages)
                          -A saves all suspended and zombie instances as well as all routing failure reports
                          -SR saves suspended resumable instances only
                          -SNR saves suspended non-resumable instances only
                          -DIS saves all dehydrated ‘isolated adapter’ instances
                          optionally supply the name of the orchestration or port name to filter on specific instances
                          Ensure that the C:\Temp folder exists before running as that is where it saves the instances
                          Example: cscript save_messages.vbs -z “E-Reporting Data Transform Port”
                          Visual Basic Script:
                          ‘ save_messages.vbs
                          ‘ Enter save_messages.vbs with no arguments from a command prompt for usage
                          ‘ This script needs to be run under a user account that is a member of the BizTalk Administrators
                          ‘ group. This script needs to be run on a machine that is configured with BizTalk administration
                          ‘ tools.
                          dim objBtsWmiNS, objMsg, svcinsts, inst, msg, ndx, size
                          Dim aryHostNames()
                          Dim aryObjQueues()
                          Dim aryHostBatchSize()
                          Dim strKey2Instance
                          Dim strQuery2Msg
                          Dim strServiceName
                          On Error Resume Next
                          Dim objArgs: Set objArgs = WScript.Arguments
                          If ( objArgs.Count = 0 OR objArgs.Count > 2) Then
                          PrintUsage()
                          wscript.quit 0
                          End If
                          wmiQuery = “”
                          ‘ServiceStatus = 16 – ‘Completed With Discarded Messages’ in BizTalk Server 2004
                          ‘ServiceStatus = 32 – ‘Suspended (not resumable)’
                          ‘ServiceStatus = 4 – ‘Suspended (resumable)’
                          ‘ServiceClass = 64 – ‘Routing Failure Report’
                          ‘ErrorId = “0xC0C01B4C” – is how ‘Completed With Discarded Messages’ are exposed in BizTalk Server 2006
                          If (objArgs(0) = “-Z” OR objArgs(0) = “-z”) Then
                          wmiQuery = “select * from MSBTS_serviceinstance where ServiceStatus=16 OR ErrorId=’0xC0C01B4C’”
                          End If
                          If (objArgs(0) = “-A” or objArgs(0) = “-a”) Then
                          wmiQuery = “select * from MSBTS_serviceinstance where ServiceStatus=4 OR ServiceStatus=32 OR ServiceStatus=16 OR ErrorId=’0xC0C01B4C’ OR ServiceClass=64″
                          End If
                          If (objArgs(0) = “-SR” or objArgs(0) = “-sr”) Then
                          wmiQuery = “select * from MSBTS_serviceinstance where ServiceStatus=4″
                          End If
                          If (objArgs(0) = “-SNR” or objArgs(0) = “-snr”) Then
                          wmiQuery = “select * from MSBTS_serviceinstance where ServiceStatus=32″
                          End If
                          If (objArgs(0) = “-DIS” or objArgs(0) = “-dis”) Then
                          wmiQuery = “select * from MSBTS_serviceinstance where ServiceClass=32 AND ServiceStatus=8″
                          ‘ServiceClass = 32 ‘Isolated Adapter
                          ‘ServiceStatus = 8 ‘Dehydrated
                          End If
                          saveMessagesBeforeTermination = True
                          If ( objArgs.Count > 1) Then
                          strServiceName = objArgs(1)
                          End If
                          If(wmiQuery = “”) Then
                          PrintUsage()
                          wscript.quit 0
                          End If
                          wscript.echo “–>Connecting to BizTalk WMI namespace”
                          Set objBtsWmiNS = GetObject(“WinMgmts:{impersonationLevel=impersonate, (security)}\\.\root\MicrosoftBizTalkServer”)
                          If Err <> 0 Then
                          CheckWMIError
                          wscript.quit 0
                          End If
                          wscript.echo “–>Getting BizTalk host collection”
                          Set hosts = objBtsWmiNS.ExecQuery(“select * from MSBTS_HostSetting”)
                          If Err <> 0 Then
                          CheckWMIError
                          wscript.quit 0
                          End If
                          hostCount = hosts.count
                          ReDim aryHostNames(hostCount – 1)
                          ReDim aryObjQueues(hostCount – 1)
                          ReDim aryHostBatchSize(hostCount – 1)
                          wscript.echo “–>Retrieve BizTalk host names and loading host queues”
                          ndx = 0
                          For Each host in hosts
                          wscript.echo “Found host ” & host.Properties_(“Name”)
                          aryHostNames(ndx) = host.Properties_(“Name”)
                          Set aryObjQueues(ndx) = objBtsWmiNS.Get(“MSBTS_HostQueue.HostName=”"” & aryHostNames(ndx) & “”"”)
                          If Err <> 0 Then
                          CheckWMIError
                          wscript.quit 0
                          End If
                          ndx = ndx + 1
                          Next
                          wscript.echo “–>Getting collection of service instances”
                          Set svcinsts = objBtsWmiNS.ExecQuery(wmiQuery)
                          ‘Iterate through instances and save them in host-specific arrays.
                          wscript.echo “–>Start iterating service instances”
                          totalCount = 0
                          For Each inst in svcinsts
                          If (objArgs.Count = 1 Or (objArgs.Count > 1 And strServiceName = inst.Properties_(“ServiceName”) ) ) Then
                          wscript.echo “Found suspended instance “”"& inst.Properties_(“ServiceName”) & “”" on host ” & inst.Properties_(“HostName”)
                          ‘Resolve host index
                          For hostIdx = 0 To hostCount-1
                          If aryHostNames(hostIdx) = inst.Properties_(“HostName”) Then
                          Exit For
                          End If
                          Next
                          ’16 is an internal service class that cannot be terminated
                          If 16 = inst.Properties_(“ServiceClass”) Then
                          wscript.echo “Skipping BizTalk internal service instances (they cannot be terminated anyway)”
                          Else
                          ’64 is a routing failure report and doesn’t have messages that can be saved
                          If 64 = inst.Properties_(“ServiceClass”) Or 16 = inst.Properties_(“ServiceClass”) Then
                          saveMessagesBeforeTermination = False
                          End If
                          errorCountSavingMessages = 0
                          If saveMessagesBeforeTermination Then
                          strQuery2Msg = “select * from MSBTS_MessageInstance where ServiceInstanceID=”"” & inst.Properties_(“InstanceId”) & “”"”
                          Set msgInsts = objBtsWmiNS.ExecQuery(strQuery2Msg)
                          For Each msg in msgInsts
                          msg.SaveToFile “C:\Temp”
                          If Err <> 0 Then
                          CheckWMIError
                          wscript.echo “Failed to save MSBTS_MessageInstance”
                          wscript.echo Err.Description & Err.Number
                          errorCountSavingMessages = errorCountSavingMessages + 1
                          Else
                          wscript.echo “Saved message ” & msg.Properties_(“MessageInstanceID”)
                          End If
                          Next
                          End If
                          totalCount = totalCount + 1
                          End If
                          End If
                          Next
                          ‘ Delete whatever is left
                          For hostIdx = 0 To hostCount-1
                          If aryHostBatchSize(hostIdx) > 0 Then
                          TerminateAccumulatedInstacesForHost hostIdx
                          End If
                          Next
                          wscript.echo “SUCCESS> ” & totalCount & ” instances were found and attempted to be saved”
                          ‘This subroutine deals with all errors using the WbemScripting object.
                          ‘Error descriptions are returned to the user by printing to the console.
                          Sub CheckWMIError()
                          If Err <> 0 Then
                          On Error Resume Next
                          Dim strErrDesc: strErrDesc = Err.Description
                          Dim ErrNum: ErrNum = Err.Number
                          Dim WMIError : Set WMIError = CreateObject(“WbemScripting.SwbemLastError”)
                          If (TypeName(WMIError) = “Empty” ) Then
                          wscript.echo strErrDesc & ” (HRESULT: ” & Hex(ErrNum) & “).”
                          Else
                          wscript.echo WMIError.Description & “(HRESULT: ” & Hex(ErrNum) & “).”
                          Set WMIError = nothing
                          End If
                          ‘wscript.quit 0
                          End If
                          End Sub
                          Sub PrintUsage()
                          wscript.echo “Usage:”
                          wscript.echo “cscript save_messages.vbs < -Z | -A | -DIS | -SR | -SNR > [Port/Orchestration name]“
                          wscript.echo
                          wscript.echo “  -Z saves all “”Zombie”" instances (e.g. completed with discarded messages)”
                          wscript.echo “  -A saves all suspended and zombie instances as well as all routing failure reports”
                          wscript.echo “  -SR saves suspended resumable instances only”
                          wscript.echo “  -SNR saves suspended non-resumable instances only”
                          wscript.echo “  -DIS saves all dehydrated ‘isolated adapter’ instances”
                          wscript.echo “  optionally supply the name of the orchestration or port name to filter on specific instances”
                          wscript.echo
                          wscript.echo “  Ensure that the C:\Temp folder exists before running as that is where it saves the instances”
                          wscript.echo
                          wscript.echo “  Example: cscript save_messages.vbs -z “”E-Reporting Data Transform Port”"”
                          wscript.echo
                          End Sub

                          BizTalk : How To : Call .Net Component inside Biztalk mapper using XSLT call template PART 1

                          $
                          0
                          0

                          post by  Richard Seroter
                          I encountered a particularly tricky multi-part mapping scenario. I had to build a destination message that contained groupings from the two source messages. Each record in the first source message created a destination node, and each record in the second source message created a destination node directly beneath the related first source record. To make matters tougher, every destination record has an attribute containing a sequential number. So out of this …
                          <source1>
                            <Node1><Node1>
                            <Node2></Node2>
                          </source1>
                          <source2>
                            <NodeRelatedToNode1></NodeRelatedToNode1>
                            <NodeRelatedToNode1></NodeRelatedToNode1>
                            <NodeRelatedToNode2></NodeRelatedToNode2>
                          </source2>
                          The destination was supposed to look like this …
                          <destination>
                            <Node1 page=”1″><Node1>
                            <NodeRelatedToNode1 page=”2″></NodeRelatedToNode1>
                            <NodeRelatedToNode1 page=”3″></NodeRelatedToNode1>
                            <Node2 page=”4″></Node2>
                            <NodeRelatedToNode2 page=”5″></NodeRelatedToNode2>
                          </destination>
                          The grouping part wasn’t too tough, just used a Scripting functoid with the XSLT Call Templateand a little hand written XSL. The hard part was creating the sequential “page” numbers. Those familiar with XSLT know that the “variables” in XSLT are basically constants, so you can’t create a variable and increment it. I considered building some sort of recursion to get my incremented number, but in the end, decided to call a custom .NET component from my map’s XSLT. I built a C# component that had a member variable, and a method called “GetNext()” which incremented and then returned the next sequential number. I then set my map’s Custom Extension XML to an XML document referencing my custom component. Now in my XSLT Call Template I could get the next “page” number each time I built a destination node. Neat!
                          See here for an example of doing this.
                          Here’s where a “quirk” was introduced. When I deployed this map, and ran multiple documents through it, the first document had it’s paging correct (e.g. pages 1-5), but the next messages had the wrong values (e.g. 6-10, 11-16, etc). What was happening was that somehow this custom C# component was being shared! The “increment” kept counting on each orchestration call! My C# component wasn’t built as a “static” object, and I assumed that the scope of each custom object was the individual map (or orchestration) instance.
                          I still have no idea why this happened, but to ensure it wouldn’t keep happening, I added a method to the custom component called “Reset()” which set the counter to 0. Then at the top of the map I call out to that method to ensure that each map starts its counter at 0.

                          BizTalk : How To : Call .Net Component inside Biztalk mapper using XSLT call template PART 2

                          $
                          0
                          0
                          post by  Richard Seroter

                          A problem I mentioned was that the member variable in the class that the map was calling seemed to be getting shared amongst execution instances. Each map creates a sequential page number in the XSLT and puts it into the destination XML. However, I’d see output where the first message had pages “1..3..5..7..8″ and the second message had pages “2..4..6..9.” Very strange. I thought I fixed the problem, but it surfaced today in our Test environment.
                          So, I set out to keep everything local to the map and get rid of external assembly calls. After banging my head for a few minutes, I came up the perfect solution. I decided to mix inline script with inline XSLT. “Madness” you say? I built a small test scenario. The map I constructed looks like this:
                          In the first Scripting functoid, I have “inline C#” selected, and I created a global variable. I then have a function to increment that variable and return the next number in sequence.
                          Did you know that you could have “global variables” in a map? Neat stuff. If I check out the XSLT that BizTalk generates for my map, I can see my function exposed as such:
                          Now I know how to call this within my XSLT! The second Scripting functoid’s inline XSLT looks like this:

                          Notice that I can call the C# method written in the previous functoid with this code:
                          <xsl:value-of select=”userCSharp:GetPageNumber()”/>
                          The “prefix” is the auto-generated one from the XSLT. Now, all the calculations are happening locally within the map, and not relying on outside components. The result of this map is a document that looks like this:
                          There you go. Using global variables within a BizTalk map and calling a C# function from within the XSLT itself.

                          BizTalk : How To : Trouble Shoot BAM EventBus Service Error in Event Log

                          $
                          0
                          0
                          post by Tiho

                          Here are 8 tables in each BizTalk Message Box database which store the tracking data before it is imported by the BAM EventBus Service (a.k.a. TDDS or Tracking Data Decoding Service) into the DTA/HAT and the BAM Primary Import databases. The tables are named TrackingData_x_y where 0 ≤ x ≤ 1 and 0 ≤ y ≤ 3. It is absolutely critical that the sizes of these tables do not increase over time. If the sizes are increasing than either TDDS is not able to catch up with the load or it is not working properly. There is a performance counter that can be used to monitor the size of the tracking data – BizTalk:Messsage Box:General Counters\Tracking Data Size.

                          The first step to troubleshoot issues with the tracking data is to examine the Windows Event Log on the BizTalk Tracking Host machine for errors from the BAM EventBus Service. Error information along with the serialized original tracking data might be available in the TDDS_FailedTrackingData tables in the DTA/HAT and the BAM Primary Import databases. Another place where error information might be available is the TDDS_Heartbeats table in the BizTalk Management database.

                          In this post I will focus on one very common cause which manifests as an error from the BAM EventBus Service in the Windows Event Log with event ID 25. 

                          The error should look like this:
                          Event Type: Error
                          Event Source: BAM EventBus Service
                          Event Category: None
                          Event ID: 25
                          Date: 12/20/2006
                          Time: 10:38:27 AM
                          User: N/A
                          Computer: TRACKINGHOST
                          Description:
                          Either another TDDS is processing the same data or there is an orphaned 
                          session in SQL server holding TDDS lock.Timeout expired. The timeout
                          period elapsed prior to completion of the operation or the server is not
                          responding. SQLServer: DBSERVER, Database: BAMPrimaryImport.

                          This error will usually show up every 5 minutes or so. Below are the steps to resolve it.
                          First, make sure that you are not hitting any of the issues described in this article. If this is the case, then killing the orphaned sessions or restarting the SQL Server machine will resolve the issue. You can use the information in this article to identify orphaned sessions.
                          If the issue is still there, then you most certainly have permissions problems. The account under which TDDS (and the BizTalk Tracking Host) is running must have execute permissions for the following stored procedures in the BizTalk Message Box database: TDDS_RedisterTDDSAccess and TDDS_GetNumTrackingPartitions. The same account must also have execute permissions for the TDDS_Lock stored procedure in the DTA/HAT and the BAM Primary Import databases.

                          The permissions are set correctly when BizTalk Server is first installed but might be altered later directly or indirectly by manually setting explicit deny permissions for the specific account or any group that it is a member of.
                          The best way to check that permissions are indeed the problem is to open Task Manager on the Tracking Host machine and on the Processes tab check the account under which the BTSNTSvc.exe process is running. This is the Tracking Host account. Now start SQL Query Analyzer or SQL Management Studio (or any of the command line counterparts) with the same user credentials as BTSNTSvc.exe. You can use the “runas” command or right-click on a shortcut and choose “Run as…”. I suggest that you do this test on the Tracking Host machine to rule out any network connectivity issues.
                          After you have connected to the correct SQL database execute the following:

                          In all BizTalk Message Box databases:

                          DECLARE @RC int
                          DECLARE @retVal int
                          EXEC @RC = [BizTalkMsgBoxDb].[dbo].[TDDS_RegisterTDDSAccess] @retVal OUTPUT
                          SELECT @RC
                          GO

                          DECLARE @RC int
                          DECLARE @nPartitions tinyint
                          EXEC @RC = [BizTalkMsgBoxDb].[dbo].[TDDS_GetNumTrackingPartitions] @nPartitions OUTPUT
                          SELECT @RC
                          GO

                          In the BizTalk DTA and BAM Primary Import databases:
                          DECLARE @RC int
                          DECLARE @resource nvarchar(128)
                          DECLARE @milisecTimeout int
                          DECLARE @retVal int
                          SELECT @resource = N'Foo'
                          SELECT @milisecTimeout = 5000
                          EXEC @RC = [BAMPrimaryImport].[dbo].[TDDS_Lock] @resource, @milisecTimeout, @retVal OUTPUT
                          SELECT @retVal
                          SELECT @RC
                          GO

                          The results of these queries should be 0 and there should not be any errors. If you get “EXECUTE permission denied” errors then grant the corresponding execute permissions until you can execute the queries without any errors. At this point TDDS should start moving the tracking data from the Message Box databases to the DTA and the BAM databases.

                          BizTalk : How To : Call a Web service Using Custom Pipeline in a Messaging Solution

                          $
                          0
                          0


                          In this article I'll explain how you can call a Web Service which requires multiple arguments using a Custom pipeline and a custom pipeline component in a messaging-only scenario without using any Orchestration.

                          Normally, when there is a requirement to call a web service from BizTalk, people tend to take the easy route of calling it via an Orchestration. When we do a web reference inside the orchestration, Orchestration does quite a lot of work for us. It creates all the required schemas, it creates all the required multipart messages, which will be passed to the web service as argument. It makes our life easier. But I guess like me, some of you out there might need to call the web service without using Orchestration. As shown in the above figure. I've one request-response HTTP receive port, and one Solicit response SOAP send port, through this I'm going to call a web service, which expects multiple argument (including one complex type) and return the result back to the caller (HTTP Response). Here are the steps: The attached sample file contains all the required file, I'm just going to explain the key factors in this article.
                          1. Web Service Definition:
                          [WebMethod]
                          public Person GetPersonInfo(Person person, string firstName, string secondName) {
                          //Some processing
                          return person;
                          }
                          2. Create a general custom pipeline component to construct the multipart message required for the Web Service call 
                          At run time SOAP Adapter in the send port will map the Biztalk multipart IBaseMessage to the Web Service argument based on the partName of IBaseMessage and argument names of the Webservice. The key factor is how we are going to construct the multipart message in the format required by the SOAP Adapter to make the WebService call. So, in this article we are going to create custom pipeline component which will construct the correct IBaseMessage required by the SOAP adapter based on the input message and some pipeline design time properties
                          The custom pipeline component we are going to use has 2 design time properties FirstName and SecondName, which will be passed as parameters to the web service (See webservice definition from Step 1). We'll pass the first webservice argument "Person" as the incoming message via HTTP receive port. The figure below show the custom design time properties configuration window within Biztalk Admin console. 
                          The code below is the snippet from the custom pipeline component (two important methods Execute and CreateMessage). The Execute method below without the first line of code will be equivalent to aPassThru pipeline component with default Biztalk IBaseMessage. 
                          #############################################################
                          public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg)
                          {
                          IBaseMessage msg = CreateMessage(inmsg.BodyPart.GetOriginalDataStream(), pc.GetMessageFactory(),inmsg.Context);
                          return msg;
                          }
                          #############################################################
                          IBaseMessage CreateMessage(Stream s, IBaseMessageFactory msgFactory, IBaseMessageContext context)
                          {
                          IBaseMessage msg = msgFactory.CreateMessage();
                          IBaseMessagePart part = msgFactory.CreateMessagePart();
                          part.Data = s;
                          msg.AddPart("Person", part, true);
                          msg.Context = context;
                          //1st Part
                          IBaseMessagePart partFirstName = msgFactory.CreateMessagePart();
                          byte[] firstPart = System.Text.Encoding.UTF8.GetBytes(string.Format("<string>{0}</string>", _firstName));
                          partFirstName.Data = new MemoryStream(firstPart);
                          partFirstName.Charset = "utf-8"
                          partFirstName.ContentType = "text/xml"
                          msg.AddPart("firstName", partFirstName, false);
                          //2nd Part
                          IBaseMessagePart partSecondName = msgFactory.CreateMessagePart();
                          byte[] secondPart = System.Text.Encoding.UTF8.GetBytes(string.Format("<string>{0}</string>", _secondName));
                          partSecondName.Data = new MemoryStream(secondPart);
                          partSecondName.Charset = "utf-8"
                          partSecondName.ContentType = "text/xml"
                          msg.AddPart("secondName", partSecondName, false);
                          return msg;
                          }
                          #############################################################
                          Our user defined function CreateMessage will create the required BizTalk IBaseMessage as shown in the below figure
                          In the above code snippet, the important things to note are highlighted in RED. The incoming message ("Person") will go as the first part (BodyPart) of the IBaseMessage with the name "Person", and then we added two more addional parts "firstName" and "secondName" to the IBaseMessage with correct partNames inline with the web service arguments. The other important thing to note is how the basic data types gets serialized. In our example we got "<string>{0}</string>" as value for firstName and secondName, because they are of type string. If for example you got int as your argument then you need to create the part in the format <int>5</int>.
                          NOTE: See the web service signature defined in Step 1 for comparison
                          3. Create a Custom Receive Pipeline using the custom pipeline component
                          Create a new Biztalk Receive Pipeline and place the custom pipeline component we created in the "Decode" stage of the pipeline.
                          4. Configure the ports
                          As shown in our design diagram at the beginning we need 2 ports to send and receive the message, the attached sample file got a binding file, this section is just for explanation, doesn't explain in detail how to configure the ports. Make sure the URL are correct, both on Receive and Send side after importing the binding. You need to configure IIS as well to receive messages via HTTP, follow the link to configure IIS for HTTP receive  http://msdn2.microsoft.com/en-us/library/aa559072.aspx.
                          Two-Way HTTP Receive Port:
                          Solicit-Response SOAP Send Port:
                          We used the .NET Proxy class on our SOAP port to make the call.
                          Filter Condition on the Send Port
                          5. Post a Message.
                          I used WFetch to post the message to BizTalk. You can see on the result pane the request message is posted and you got the response back from the web service synchronously on a two way connection.
                          Troubleshooting:
                          Some of the common exceptions you'll see while calling a webservice via SOAP adapter is shown below (from HAT and eventviewer)
                          1. "Failed to retrieve the message part for parameter "firstName". "
                          2. "Failed to serialize the message part "firstName" into the type "String" using namespace "". Please ensure that the message part stream is created properly."
                          The reason for the first error message is due to wrongly named IBaseMessage partName. ReadSection 2 carefully to overcome this error.
                          The reason for the second error message is mainly due to some problem with serializing the IBaseMessage parts to the correct web service arguments. Best approach to overcome this error will be to build a .net console/windows application, add a web reference to the webservice and try to serialize each argument to the corresponding type. For example for this example you can try the following
                          FileStream fs = new FileStream(@"C:\Documents and Settings\SaravanaK\Desktop\FailedMessages\_Person.out",FileMode.Open,FileAccess.Read);
                          XmlSerializer serialise = new XmlSerializer(typeof(LH.WebReference.Person));
                          LH.WebReference.Person per = (LH.WebReference.Person)serialise.Deserialize(fs);
                          fs.Close();
                          fs = new FileStream(@"C:\Documents and Settings\SaravanaK\Desktop\FailedMessages\_secondName.out",FileMode.Open,FileAccess.Read);
                          serialise = new XmlSerializer(typeof(string));
                          string s2 = (string)serialise.Deserialize(fs);
                          fs.Close();
                          The files "_Person.out" and "_secondName.out" are saved from HAT tool. See the exception detail and fix the issue, it will be some namespace issue or data issue.
                          Read the readme.txt file inside to configure it. Will take approximately 5-20 minutes based on your BizTalk knowledge level.

                          BizTalk : How To : Configure the Backup BizTalk Server Job

                          $
                          0
                          0




                           How to Configure the Backup BizTalk Server Job

                          1.     On the computer that contains the BizTalk Management database, click Start, click Programs, click Microsoft SQL Server 2005, and then click SQL Server Management Studio.
                          2.     In the Connect to Serverdialog box, specify the name of the SQL Server where the BizTalk Server databases reside and the appropriate authentication type, and then click Connect.
                          3.     In Microsoft SQL Server Management Studio, double-click SQL Server Agent, and then click Jobs.
                          4.     In the details pane, right-click Backup BizTalk Server (BizTalkMgmtDb), and then click Properties.
                          5.     In the Job Properties - Backup BizTalk Server (BizTalkMgmtDb) dialog box, under Select a page, click Steps.
                          6.     In the Job step list, click BackupFull, and then click Edit.
                          7.     On the General page, in the Command box, edit the command, and then click OK.
                          exec [dbo].[sp_BackupAllFull_Schedule] 'd' /* Frequency */, 'BTS' /* Name */, '<destination path>' /* location of backup files */, 0 (default) or 1 /* ForceFullBackupAfterPartialSetFailure */

                          1.     Frequency: The default is d (daily). This is the recommended setting. Other values include h (hourly), w (weekly), m(monthly), or y (yearly).
                          2.     Name: The default is BTS. This is the recommended setting. The name is used as part of the backup file name.
                          3.     Location of backup files: Replace '<destination path>' with the full path (the path must include the single quotes) to the computer and folder where you want to back up the BizTalk Server databases.

                          Caution
                          To avoid potential data loss, you should specify a computer for your backup that is different from the computer with the original data.
                          Caution
                          If you specify a local path, then you have to manually copy all the files to the same folder on the destination system whenever the Backup BizTalk Server job creates new files. If you specify a remote path, it must be a UNC share such as \\<ServerName>\<SharedDrive>\, where <ServerName> is the name of the server where you want the files to be backed up using the Backup BizTalk Server Job, and <SharedDrive> is name of the shared folder.

                          4.     Force full backup after partial backup failures: The default is 0when not specified, which means that if a log backup fails, no full backups are done until the next full backup frequency interval is reached. Replace with 1if you want a full backup to be made whenever a log backup failure occurs.

                          8.     In the Job step list, click MarkAndBackupLog, and then click Edit.
                          The MarkAndBackupLog step is responsible for marking the logs and then backing them up.
                          9.     On the General page, in the Command box, replace '<destination path>'with the full path (including single quotes) to the computer and folder where you want to store the BizTalk Server database logs and then click OK. The <destination path> may be local or a UNC path to another server.

                          Description: http://i.msdn.microsoft.com/Aa546765.Caution(en-us,MSDN.10).gifCaution
                          To avoid potential data loss, the <destination path> should specify a computer to store the database logs that is different from the computer with the original database logs.

                          10.  In the Job step list, click Clear Backup History, and then click Edit.

                          11.  On the General page, in the Command box, change DaysToKeep=<number>to the number of days you want to keep the backup history, and then click OKtwice to close the Job Properties - Backup BizTalk Server (BizTalkMgmtDb)dialog box.

                          Description: http://i.msdn.microsoft.com/Aa546765.note(en-us,MSDN.10).gifNote
                          The DaysToKeep parameter specifies how long the backup history is kept in the Adm_BackupHistory table. Periodically clearing the backup history helps to maintain the Adm_BackupHistory table at an appropriate size. The default value for the DaysToKeep parameter is 14 days.

                          12.  Change the backup schedule, if desired. For more information, see How to Schedule the Backup BizTalk Server Job.

                          Description: http://i.msdn.microsoft.com/Aa546765.note(en-us,MSDN.10).gifNote
                          The Backup BizTalk Server job runs the first time you configure it. By default, on subsequent runs, the Backup BizTalk Server job performs a full backup once a day and performs log backups every 15 minutes.

                          13.  In the details pane, right-click the Backup BizTalk Serverjob, and then click Enable.
                          In the Enable Jobs dialog box, the status changes to Success.

                          BizTalk : How To : Configure the Destination System for Log Shipping

                          $
                          0
                          0

                          How to Configure the Destination System for Log Shipping

                          1.     On the computer or computers that you have identified as the destination system, click Start, click Programs, click Microsoft SQL Server 2005, and then click SQL Server Management Studio.
                          2.     In the Connect to Server dialog box, specify the name of the SQL Server on the destination computer, and then click Connect to connect to the appropriate SQL Server.
                          3.     In Microsoft SQL Server Management Studio, click File, click Open, and then click File.
                          4.     In the Open File dialog box, browse to the following SQL script:
                          %SystemRoot%\Program Files\Microsoft BizTalk Server 2006\Schema\LogShipping_Destination_Schema.sql
                          5.     Click the Query menu, and then click Execute.
                          The LogShipping_Destination_Schema drops and recreates the tables used for restoring the source databases on the destination system. This includes tables to store the list of databases being recovered, copies of the backup history imported from the source system's BizTalkMgmtDb database, and information about SQL Server Agent jobs configured to run against the source databases.
                          6.     In Microsoft SQL Server Management Studio, click File, click Open, and then click File.
                          7.     In the Open File dialog box, browse to the following SQL script:
                          %SystemRoot%\Program Files\Microsoft BizTalk Server 2006\Schema\LogShipping_Destination_Logic.sql
                          8.     Click the Query menu, and then click Execute.
                          9.     On the computer or computers you have identified as the destination system, click Start, click Programs, click Microsoft SQL Server 2005, and then click SQL Server Management Studio.
                          10.  In the Connect to Server dialog box, specify the name of the SQL Server on the destination computer, and then click Connect to connect to the appropriate SQL Server.
                          11.  In Microsoft SQL Server Management Studio, click New Query.
                          12.  In the query window paste the following command:
                          exec bts_ConfigureBizTalkLogShipping @nvcDescription = '<MyLogShippingSolution>',
                          @nvcMgmtDatabaseName = '<BizTalkServerManagementDatabaseName>',
                          @nvcMgmtServerName = '<BizTalkServerManagementDatabaseServer>',
                          @SourceServerName = null, -- null indicates that this destination server restores all databases
                          @fLinkServers = 1 -- 1 automatically links the server to the management database

                          13.  In the command, replace <MyLogShippingSolution> with a meaningful description, surrounded by single quotes. Replace <BizTalkServerManagementDatabaseName> and <BizTalkServerManagementDatabaseServer> with the name and location of your source BizTalk Management database, surrounded by single quotes.

                          Description: http://i.msdn.microsoft.com/Aa560961.Important(en-us,MSDN.10).gifImportant
                          Before you execute this statement, you must enable the Ad Hoc Distributed Queries configuration option on the destination system.
                          Description: http://i.msdn.microsoft.com/Aa560961.note(en-us,MSDN.10).gifNote
                          If you have more than one source server, you can restore each source server to its own destination server. On each destination server, in the @SourceServerName = null parameter, replace null with the name of the appropriate source server, surrounded by single quotes (for example, @SourceServerName = 'MySourceServer',).

                          14.  Click the Query menu, and then click Execute.
                          Description: http://i.msdn.microsoft.com/Aa560961.Important(en-us,MSDN.10).gifImportant
                          if the query fails, after you fix the problem with the query, you must start over from step 1 of this procedure to reconfigure the destination system.
                          Description: http://i.msdn.microsoft.com/Aa560961.note(en-us,MSDN.10).gifNote
                          The restore jobs on the destination system will attempt to recreate the log and data files for each restored database in the same location as they existed on the source database server.

                          15.  On the destination system, in SQL Server Management Studio, double-click the appropriate server, double-click SQL Server Agent, and then double-click Jobs.
                          16.  In the details pane, you will see three new jobs:
                          ·         BTS Log Shipping Get Backup History
                          The BizTalk Server Log Shipping Get Backup History job moves backup history records from the source to the destination. It is scheduled by default to run every minute. This job runs as frequently as possible in order to move history records from the source to the destination. In the event of a system failure to the source system, the server that you identified as the destination system will continue to process the history records that have already been imported.
                          ·         BTS Server Log Shipping Restore Databases
                          The BizTalk Server Log Shipping Restore Databases job restores backup files for the given databases for the source to the destination server. It is scheduled by default to run every minute. This job runs continuously without completing as long as there are backup files to restore. As an extra precaution, you can run this job an additional time to ensure that it is complete.
                          ·         BTS Log Shipping Restore To Mark
                          The BizTalk Server Log Shipping Restore To Mark job restores all of the databases to a mark in the last log backup. This ensures that all of the databases are in a transactionally consistent state. In addition, this job re-creates all of the SQL Server Agent jobs on the destination system that had been on the source system.

                          Description: http://i.msdn.microsoft.com/Aa560961.Important(en-us,MSDN.10).gifImportant
                          You should monitor these jobs to ensure that they do not fail.

                          17.  On a computer running BizTalk Server 2006, browse to the following folder: %SystemRoot%\Program Files\Microsoft BizTalk Server 2006\Schema\Restore.

                          Description: http://i.msdn.microsoft.com/Aa560961.note(en-us,MSDN.10).gifNote
                          On 64-bit computers, browse to the following folder: %SystemRoot%\Program Files (x86)\Microsoft BizTalk Server 2006\Bins32\Schema\Restore.

                          18.  Right-click SampleUpdateInfo.xml, and then click Edit.
                          19.  Replace all instances of "SourceServer" with the name of the source system, and then replace all instances of "DestinationServer" with the name of the destination system.

                          Description: http://i.msdn.microsoft.com/Aa560961.Important(en-us,MSDN.10).gifImportant
                          Include the quotation marks around the name of the source and destination systems.
                          Description: http://i.msdn.microsoft.com/Aa560961.note(en-us,MSDN.10).gifNote
                          If you renamed any of the BizTalk Server databases, you must also update the database names as appropriate.
                          Description: http://i.msdn.microsoft.com/Aa560961.note(en-us,MSDN.10).gifNote
                          If you have configured BAM, you must add two more lines in OtherDatabases section of the SampleUpdateInfo.xml file for the BAMAlertsApplication and BAMAlertsNSMain databases. If you changed the default name for these two databases, please use the actual database names.
                          <Database Name="BAM Alerts Application DB" oldDBName="BAMAlertsApplication" oldDBServer="SourceServer" newDBName=" BAMAlertsApplication" newDBServer="DestinationServer"/>
                          <Database Name="BAM Alerts Instance DB" oldDBName="BAMAlertsNSMain" oldDBServer="SourceServer" newDBName="BAMAlertsNSMain" newDBServer="DestinationServer"/>

                          21.  If you have more than one MessageBox database in your BizTalk Server system, add another MessageBoxDB line to the list, and then set IsMaster="0" for the non-master databases.
                          22.  If you are using BAM, HWS, or the Rules Engine, EDI, uncomment these lines as appropriate.
                          23.  If you have any custom databases, add them as appropriate under the <OtherDatabases> section. For more information, see How to Back Up Custom Databases.
                          24.  When you are finished editing the file, save it and exit.

                          BizTalk : How To : Restore Your backup BizTalk Databases

                          $
                          0
                          0

                          How to Restore Your BizTalk Databases

                          1.     On the computer or computers that you have identified as the destination system, click Start, click Programs, click Microsoft SQL Server 2005, and then click SQL Server Management Studio.
                          2.     In the Connect to Server dialog box, specify the name of the SQL Server on the destination system, and then click Connect to connect to the appropriate SQL Server.
                          3.     In Microsoft SQL Server Management Studio, double-click the appropriate server, double-click SQL Server Agent, and then double-click Jobs.
                          4.     In the details pane, right-click BTS Log Shipping - Get Backup History, and then click Disable.
                          In the Disable Jobs dialog box, the status changes to Success.
                          5.     In the details pane, right-click BTS Log Shipping - Restore Databases, and then click Disable.
                          In the Disable Jobs dialog box, the status changes to Success.
                          6.     In the details pane, right-click BTS Log Shipping - Restore To Mark, and then click Start Job.
                          SQL Server Agent jobs and BizTalk Server databases are restored to the destination system.
                          7.     On the computer running BizTalk Server 2006, where you edited the SampleUpdateInfo.xml file, open a command prompt. Click Start, click Run, type cmd and then click OK.
                          8.     Navigate to the following directory: %SystemRoot%\Program Files\Microsoft BizTalk Server 2006\Schema\Restore.

                          Description: http://i.msdn.microsoft.com/Aa546753.note(en-us,MSDN.10).gifNote
                          On 64-bit computers, browse to the following folder: %SystemRoot%\Program Files (x86)\Microsoft BizTalk Server 2006\Bins32\Schema\Restore.

                          9.     At the command prompt, type:
                          cscript UpdateDatabase.vbs SampleUpdateInfo.xml
                          This script updates all tables that store information about the location of other databases.

                          Description: http://i.msdn.microsoft.com/Aa546753.note(en-us,MSDN.10).gifNote
                          You only need to run UpdateDatabase.vbs on one server in the BizTalk group.
                          Description: http://i.msdn.microsoft.com/Aa546753.note(en-us,MSDN.10).gifNote
                          On 64-bit computers, you must run UpdateDatabase.vbs from a 64-bit command prompt.

                          10.  Copy the edited SampleUpdateInfo.xml file to the %SystemRoot%\Program Files\Microsoft BizTalk Server 2006\Schema\Restore directory on every computer running BizTalk Server 2006 that is part of the BizTalk Server group.

                          Description: http://i.msdn.microsoft.com/Aa546753.note(en-us,MSDN.10).gifNote
                          On 64-bit computers, browse to the following folder: %SystemRoot%\Program Files (x86)\Microsoft BizTalk Server 2006\Bins32\Schema\Restore.

                          11.  On each computer in the BizTalk Server group, open a command prompt. Click Start, click Run, type cmd and then click OK.

                          12.  Navigate to the following directory: %SystemRoot%\Program Files\Microsoft BizTalk Server 2006\Schema\Restore.

                          Description: http://i.msdn.microsoft.com/Aa546753.note(en-us,MSDN.10).gifNote
                          On 64-bit computers, browse to the following folder: %SystemRoot%\Program Files (x86)\Microsoft BizTalk Server 2006\Bins32\Schema\Restore.

                          13.  At the command prompt, type:
                          cscript UpdateRegistry.vbs SampleUpdateInfo.xml
                          This script updates all registry entries that store information about the location of other databases.

                          Description: http://i.msdn.microsoft.com/Aa546753.note(en-us,MSDN.10).gifNote
                          You need to run UpdateRegistry.vbs on every server in the BizTalk group.
                          Description: http://i.msdn.microsoft.com/Aa546753.note(en-us,MSDN.10).gifNote
                          On 64-bit computers, you must run UpdateRegistry.vbs from a 64-bit command prompt.

                          14.  Restart all of the BizTalk Server services. For more information about how to restart the BizTalk Server services, see How to Start, Stop, Pause, Resume, or Restart BizTalk Server Services.

                          15.  After restoring your databases, you must restart the Windows Management Instrumentation service. Click Start, click Run, type services.msc, and then click OK. Right-click Windows Management Instrumentation, and then click Restart.
                          16.  On the computer you use to administer BizTalk Server, click Start, click Programs, click Microsoft BizTalk Server 2006, and then click BizTalk Server Administration.
                          17.  In the console tree, right-click the BizTalk Group, and then click Remove.
                          18.  In the console tree, right-click BizTalk Server 2006 Administration, and then click Connect to Existing Group.
                          19.  In the Connect to Existing BizTalk Server Configuration Database dialog box, in the SQL Server name drop-down list box, select the name of the Microsoft SQL Server instance that hosts the BizTalk Management database. When you select the instance of SQL Server, BizTalk Server automatically attempts to detect BizTalk Server databases on that computer.
                          20.  In the Database name drop-down list box, select the BizTalk Management database (BizTalkMgmtDb) to which you want to connect, and then click OK.
                          The BizTalk Server Administration Console adds the BizTalk group to the console tree.
                          Your BizTalk server is now restored and should be running. You should now configure the Backup BizTalk Server job to start writing backups to a new destination server. You should also reconfigure a new destination system.

                          Description: http://i.msdn.microsoft.com/Aa546753.Important(en-us,MSDN.10).gifImportant
                          If you are using the Rules Engine, after restoring the databases, you must restart the Rule Engine Update Service on every server in the BizTalk Server group. For more information about how to restart the Rule Engine Update Service, see How to Start, Stop, Pause, Resume, or Restart BizTalk Server Services.

                          Description: http://i.msdn.microsoft.com/Aa546753.note(en-us,MSDN.10).gifNote
                          If you are using BAS or BAM, this is the time to restore the BAS and BAM databases. For more information, see Backing Up and Restoring BAS and Backing Up and Restoring BAM.


                          BizTalk : How To : Backup BAM Databases and Update References to BAM Databases

                          $
                          0
                          0
                          The following tables describe the databases used by BizTalk Server and identify which methods are used to back up the databases.

                          Databases Backed Up by the Backup BizTalk Server Job

                          The following table lists the databases that are backed up and restored as a part of the Backup BizTalk Server job. You can modify the Backup BizTalk Server job to back up custom databases by adding them to the adm_OtherBackupDatabases table.

                          Database
                          Default database name
                          Description
                          BAM Primary Import database
                          BAMPrimaryImport
                          This is the database where the Business Activity Monitoring (BAM) collects raw tracking data.
                          BAM Notification Services Application database
                          BAMAlertsApplication
                          This database contains alert information for BAM notifications. For example, when you create an alert using the BAM portal, entries are inserted in the database specifying the conditions and events to which the alert pertains, as well as other supporting data items for the alert.
                          BAM Notification Services Instance database
                          BAMAlertsNSMain
                          This database contains instance information specifying how the notification services connect to the system that BAM is monitoring.
                          HWS Administration database
                          BizTalkHwsDb
                          This database contains all administration information related to Human Workflow Services (HWS).
                          BizTalk Tracking database
                          BizTalkDTADb
                          This database stores health monitoring data tracked by the BizTalk Server tracking engine.
                          BizTalk Management database
                          BizTalkMgmtDb
                          This database is the central meta-information store for all instances of BizTalk Server.
                          BizTalk MessageBox database
                          BizTalkMsgBoxDb
                          This database is used by the BizTalk Server engine for routing, queuing, instance management, and a variety of other tasks.
                          Rule Engine database
                          BizTalkRuleEngineDb
                          This database is a repository for:
                          ·         Policies, which are sets of related rules.
                          ·         Vocabularies, which are collections of user-friendly, domain-specific names for data references in rules.
                          SSO database
                          SSODB
                          This Enterprise Single Sign-On database securely stores the configuration information for receive locations.
                          TPM database
                          TPM
                          This database stores trading partner data for Business Activity Services (BAS). By default, TPM database is combined with BizTalk Management (BizTalkMgmtDb) database.
                          BizTalk Base EDI database
                          BizTalkEDIdb
                          This database stores state for the Base electronic data interchange (EDI) adapter, which has been deprecated in BizTalk Server 2006 R2. The Base EDI adapter can be used in upgrade scenarios, but for new installations of BizTalk Server 2006 R2, use the native EDI and AS2 functionality.

                          Databases Backed Up by the BAS Backup Process

                          The following table lists the Microsoft Windows SharePoint Services databases that are backed up and restored using the procedures in Backing Up and Restoring BAS:

                          Database
                          Default database name
                          Description
                          Windows SharePoint Services configuration database
                          User-defined
                          This database contains all of the global settings for the server.
                          Windows SharePoint Services content database
                          User-defined
                          This database contains all of the site content, such as list items and documents.

                          Databases Backed Up by the BAM Backup Process

                          The following table lists the databases that are backed up and restored using the procedures in Backing Up and Restoring BAM:

                          Database
                          Default database name
                          Description
                          BAM Star Schema
                          BAMStarSchema
                          This database contains the staging table, and the measure and dimension tables.
                          BAM Analysis
                          BAMAnalysis
                          This database contains BAM OLAP cubes for both online and offline analysis.
                          BAM Archive
                          BAMArchive
                          This database archives old business activity data. Create a BAM Archive database to minimize the accumulation of business activity data in the BAM Primary Import database.
                          Tracking Analysis Server
                          BizTalkAnalysisDb
                          This database stores health monitoring online analytical processing (OLAP) cubes.

                          How to Back Up the BAM Analysis and Tracking Analysis Server Databases

                          The Business Activity Monitoring (BAM) Analysis database and the Tracking Analysis Server database store content in SQL Server Analysis Services cubes. The Backup BizTalk Server job does not back up these databases. Instead, to backup these databases, you must use SQL Server Analysis Manager.
                          After you back up these databases, you may want to purge the OLAP cubes. When you purge the OLAP cubes, you must also perform the following steps:
                          1.     Before you purge the OLAP cubes, in the BAM Star Schema database, truncate the fact table(s) for the cube you want to purge. The table naming convention is "bam_<CubeName>_Facts".
                          2.     After you purge the OLAP cubes, you must fully process active, completed, and virtual cubes.
                          For instructions about backing up the analysis databases, see "Archiving an Analysis Services Database" in SQL Server Books Online.

                          Scheduling backups for the BAM databases

                          If you are using BAM, verify that neither the BAM cube process nor data maintenance Data Transformation Services (DTS) packages are running when the backup package is scheduled to run.
                          To ensure consistent schema across all BAM databases, back up the BAM databases and DTS packages each time you deploy or undeploy a BAM activity.
                          Back up the BAM Analysis database and BAM Star Schema database each time you deploy or undeploy a BAM view.
                          Back up the BAM databases in the following order:
                          1.     Run the Backup BizTalk Server job to back up the BAM Primary Import database and your other BizTalk Server databases.
                          2.     Run the BAM data maintenance DTS package for all activities.
                          Incorporate these steps into a DTS package, and schedule the package to run on a regular basis. To ensure data integrity, make sure no other BAM cubing or data maintenance DTS packages run when this backup package is scheduled to run.
                          To ensure that you can recover a complete set of archived data if the BAM Archive database fails, back up the BAM Archive database after you copy the partition into the BAM Archive database, but before you delete the partition from the BAM Primary Import database. To do this, modify the data maintenance DTS package for each activity to insert a step to back up the BAM Archive database before the last step in the DTS package, "End Archiving."
                          3.     Back up the BAM Analysis database, and then the BAM Star Schema database.

                          How to Update References to the BAM Analysis Server Database Name

                          1.     Stop any BAM cube update and data maintenance SSIS packages, or prevent them from running until you have restored the BAM Analysis database.
                          2.     Stop the BizTalk Application service (which includes the BAM Event Bus service) so it does not try to import more data into the database.
                          1.     Click Start, click Run, and then type services.msc.
                          2.     Right-click the BizTalk Service BizTalk Group: BizTalkServerApplication service and then click Stop.
                          3.     Click Start, click Microsoft SQL Server 2005, and then click SQL Server Business Intelligence Development Studio.
                          4.     In SQL Server Business Intelligence Development Studio, create a new project. Click File, click New, and then click Project.
                          5.     In the New Project dialog box, in Templates, click Integration Services Project, and then click OK.
                          6.     In the Integration Services Project dialog box, in Solution Explorer, right-click SSIS Packages, and then click Add Existing Package.
                          7.     In the Add Copy of Existing Package dialog box, in the Server drop-down list box, select the server that contains the BAM_AN package.
                          8.     In Package Path, click the ellipses button.
                          9.     In the SSIS Package dialog box, select the BAM_AN package, click OK, and then click OK.
                          The package is now listed in Solution Explorer.
                          10.  In Solution Explorer, double-click the BAM_AN package. In Connection Managers, double-click database number 3 (MSDB database).
                          11.  In the Connection Manager dialog box, in the Server name box, enter the name of the MSDB server, and then click OK.
                          12.  Click the Package Explorer tab, double-click the Variables folder, and then update the values for the primary import server name and primary import database name.
                          13.  Click File, and then click Save All.
                          14.  In Microsoft SQL Server Management Studio, click Connect.
                          15.  Click Integration Services, double-click Stored Packages, click MSDB, right-click the BAM_AN package, and then click Import Package.
                          16.  In the Import Package dialog box, in Package location, select File System.
                          17.  In Package Path, navigate to your saved project, select the BAM_AN*.dtsx file, and then click Open.
                          18.  Click inside the Package Name box to automatically populate the box.
                          19.  Click OK, and then click Yes to overwrite.
                          20.  Restart the BizTalk Application service.
                          1.     Click Start, click Run, and then type services.msc.
                          2.     Right-click the BizTalk Service BizTalk Group: BizTalkServerApplication service and then click Start.
                          21.  Enable any BAM cube update and data maintenance SSIS packages.

                          How to Update References to the BAM Star Schema Database Name

                          1.     Stop any BAM cube update and data maintenance SSIS packages, or prevent them from running until you have restored the BAM Star Schema database.
                          2.     Stop the BizTalk Application service (which includes the BAM Event Bus service) so it does not try to import more data into the database.
                          1.     Click Start, click Run, and then type services.msc.
                          2.     Right-click the BizTalk Service BizTalk Group: BizTalkServerApplication service and then click Stop.
                          3.     Click Start, click Programs, click Microsoft SQL Server 2005, and then click SQL Server Business Intelligence Development Studio.
                          4.     In SQL Server Business Intelligence Development Studio, create a new project. Click File, click New, and then click Project.
                          5.     In the New Project dialog box, in Templates, click Integration Services Project, and then click OK.
                          6.     In the Integration Services Project dialog box, in Solution Explorer, right-click SSIS Packages, and then click Add Existing Package.
                          7.     In the Add Copy of Existing Package dialog box, in the Server drop-down list box, select the server that contains the BAM_AN package.
                          8.     In Package Path, click the ellipses button.
                          9.     In the SSIS Package dialog box, select the BAM_AN package, click OK, and then click OK.
                          The package is now listed in Solution Explorer.
                          10.  In Solution Explorer, double-click the BAM_AN package. In Connection Managers, double-click database number 3 (MSDB database).
                          11.  In the Connection Manager dialog box, in the Server name box, enter the name of the MSDB server, and then click OK.
                          12.  Click the Package Explorer tab, double-click the Variables folder, and then update the values for the primary import server name and primary import database name.
                          13.  Click File, and then click Save All.
                          14.  In Microsoft SQL Server Management Studio, click Connect.
                          15.  Click Integration Services, double-click Stored Packages, click MSDB, right-click the BAM_AN package, and then click Import Package.
                          16.  In the Import Package dialog box, in Package location, select File System.
                          17.  In Package Path, navigate to your saved project, select the BAM_AN*.dtsx file, and then click Open.
                          18.  Click inside the Package Name box to automatically populate the box.
                          19.  Click OK, and then click Yes to overwrite.
                          20.  Restart the BizTalk Application service.
                          1.     Click Start, click Run, and then type services.msc.
                          2.     Right-click the BizTalk Service BizTalk Group: BizTalkServerApplication service and then click Start.
                          21.  Enable any BAM cube update and data maintenance SSIS packages.

                          How to Update References to the BAM Archive Database Name

                          1.     Stop any BAM cube update and data maintenance DTS packages, or prevent them from running until you have restored the BAM Archive database.
                          2.     Stop the BizTalk Application service (which includes the BAM Event Bus service) so it does not try to import more data into the database.
                          1.     Click Start, click Run, and then type services.msc.
                          2.     Right-click the BizTalk Service BizTalk Group: BizTalkServerApplication service and then click Stop.
                          3.     Click Start, click Programs, click Microsoft SQL Server 2005, and then click SQL Server Business Intelligence Development Studio.
                          4.     In SQL Server Business Intelligence Development Studio, create a new project. Click File, click New, and then click Project.
                          5.     In the New Project dialog box, in Templates, click Integration Services Project, and then click OK.
                          6.     In the Integration Services Project dialog box, in Solution Explorer, right-click SSIS Packages, and then click Add Existing Package.
                          7.     In the Add Copy of Existing Package dialog box, in the Server drop-down list box, select the server that contains the BAM_DM package.
                          8.     In Package Path, click the ellipses button.
                          9.     In the SSIS Package dialog box, select the BAM_DM package, click OK, and then click OK.
                          The package is now listed in Solution Explorer.
                          10.  In Solution Explorer, double-click the BAM_DM package. In Connection Managers, double-click database number 3 (MSDB database).
                          11.  In the Connection Manager dialog box, in the Server name box, enter the name of the MSDB server, and then click OK.
                          12.  Click the Package Explorer tab, double-click the Variables folder, and then update the values for the primary import server name and primary import database name.
                          13.  Click File, and then click Save All.
                          14.  In Microsoft SQL Server Management Studio, click Connect.
                          15.  Click Integration Services, double-click Stored Packages, click MSDB, right-click the BAM_DM package, and then click Import Package.
                          16.  In the Import Package dialog box, in Package location, select File System.
                          17.  In Package Path, navigate to your saved project, select the BAM_DM*.dtsx file, and then click Open.
                          18.  Click inside the Package Name box to automatically populate the box.
                          19.  Click OK, and then click Yes to overwrite.
                          20.  Restart the BizTalk Application service.
                          1.     Click Start, click Run, and then type services.msc.
                          2.     Right-click the BizTalk Service BizTalk Group: BizTalkServerApplication service and then click Start.
                          21.  Enable any BAM cube update and data maintenance SSIS packages.

                          How to Update References to the BAM Primary Import Database Name and Connection String

                          1.     Stop any BAM cube update and data maintenance Data Transformation Services (DTS) packages, or prevent them from running until you have restored the BAM Primary Import database.
                          2.     Stop the BizTalk Application service (which includes the BAM Event Bus service) so it does not try to import more data into the database.
                          1.     Click Start, click Run, and then type services.msc.
                          2.     Right-click the BizTalk Service BizTalk Group: BizTalkServerApplication service and then click Stop.
                          3.     Restore the BAM Primary Import database, performing the steps in How to Restore Your Databases.
                          4.     Update the following Web.Config files:
                          ·         C:\Program Files\Microsoft BizTalk Server 2006\BAMPortal\BamManagementService\Web.Config.
                          Replace the <ServerName> string with the new server name and <DatabaseName> with the new database name. Update the following connection strings:
                          <appSettings>
                          <add key="BamServer" value="<ServerName>" />
                          <add key="BamDatabase" value="<DatabaseName>" />
                          <add key="MaxResultRows" value="2000" />
                          </appSettings>
                          ·         C:\Program Files\Microsoft BizTalk Server 2006\BAMPortal\BamQueryService\Web.Config.
                          Replace the <ServerName> string with the new server name and <DatabaseName> with the new database name. Update the following connection strings:
                          <appSettings>
                          <add key="BamServer" value="<ServerName>" />
                          <add key="BamDatabase" value="<DatabaseName>" />
                          <add key="MaxResultRows" value="2000" />
                          </appSettings>

                          5.     Click Start, click Run, type cmd and then click OK.
                          6.     Navigate to the following directory: %SystemRoot%\Program Files\Microsoft BizTalk Server 2006\Schema\Restore.
                          7.     Right-click SampleUpdateInfo.xml, and then click Edit.
                          0.     Comment out all of the database sections except for the BizTalkMgmtDb, OldPrimaryImportDatabase, PrimaryImportDatabase, ArchivingDatabase, AnalysisDatabase, StarSchemaDatabase, and Alert.
                          1.     For the BizTalkMgmtDb, OldPrimaryImportDatabase, PrimaryImportDatabase, ArchivingDatabase, AnalysisDatabase, StarSchemaDatabase, and Alert sections, set the "SourceServer" and "Destination Server" to the name of the existing server where those databases reside.
                          2.     For PrimaryImportDatabase, set the "SourceServer" to the name of the server where you have moved the BAM Primary Import database.

                          Description: http://i.msdn.microsoft.com/Aa561586.Important(en-us,MSDN.10).gifImportant
                          Include the quotation marks around the name of the source and destination systems.
                          Description: http://i.msdn.microsoft.com/Aa561586.note(en-us,MSDN.10).gifNote
                          If you renamed any of the BizTalk Server databases, you must also update the database names as appropriate.

                          3.     When you are finished editing the file, save it and exit.
                          8.     At the command prompt, type:
                          cscript UpdateDatabase.vbs SampleUpdateInfo.xml

                          Description: http://i.msdn.microsoft.com/Aa561586.note(en-us,MSDN.10).gifNote
                          You only need to run UpdateDatabase.vbs once.
                          Description: http://i.msdn.microsoft.com/Aa561586.note(en-us,MSDN.10).gifNote
                          On 64-bit computers, you must run UpdateDatabase.vbs from a 64-bit command prompt.


                          9.     At the command prompt, navigate to the following directory:
                          %SystemRoot%\Program Files\Microsoft BizTalk Server 2006\Tracking
                          10.  At the command prompt, edit bm.exe.config, change the value of key="DefaultServer" to the new server name, and then save the file.
                          11.  Update the reference to BAM Primary Import Database in all BAM Livedata Microsoft Excel files. For each file:
                          0.     Open the Excel live data file. The file name ends with _LiveData.xls.
                          1.     On the BAM menu, click BAM DB Connection.
                          2.     In the Select BAM Database dialog box, enter the SQL Server and BAMPrimaryImport database, and then click OK.
                          3.     On the File menu, click Close and Return to Microsoft Excel.
                          4.     On the File menu, click Save.
                          12.  Restart the BizTalk Application service.
                          0.     Click Start, click Run, and then type services.msc.
                          1.     Right-click the BizTalk Service BizTalk Group: BizTalkServerApplication service and then click Start.
                          13.  Enable any BAM cube update and data maintenance DTS packages.
                          14.  To resolve any incomplete trace instances, see How to Resolve Incomplete Activity Instances.

                          How to Update References to the BAM Notification Services Databases

                          1.     Click Start, click Run, type cmd, and then click OK.
                          2.     At the command prompt, navigate to the following directory: %SystemRoot%\Program Files\Microsoft BizTalk Server 2006\Tracking.
                          3.     Type: bm.exe get-config –filename:config.xml
                          4.     Open the xml file created in step 2 to obtain the list of the computers on which you must re-register Notification Services.
                          The computer names are listed in the <Property Name=> parameters in the <DeploymentUnit Name="Alert"> section of the xml file:
                                  <DeploymentUnit Name="Alert">
                                         <Property Name="GeneratorServerName" />
                                         <Property Name="ProviderServerName" />
                                         <Property Name="DistributorServerName" />
                            </DeploymentUnit>
                          5.     On each computer listed in the xml file, stop the NS service and then unregister an instance of Notification Services:
                          1.     Click Start, click Programs, click Microsoft SQL Server 2005, click Configuration Tools, and then click Notification Services Command Prompt.
                          2.     At the command prompt, type: net stop NS$BamAlerts
                          3.     Type the following command to unregister the instance:
                          nscontrol unregister -name BamAlerts
                          Unregistering an instance removes the registry entries, removes the NS$instance_name service (if present), and deletes the performance counters for the service.
                          6.     Re-register the Notification Service:
                          1.     Click Start, click Programs, click Microsoft SQL Server 2005, click Configuration Tools, and then click Notification Services Command Prompt.
                          2.     At the command prompt, type: nscontrol register -name BamAlerts -server <ServerName> -service -serviceusername "<ServiceUserName>" -servicepassword "<ServicePassword>"
                          This enables Notification Services to log on to the correct database (this information is maintained in the registry of the service machine by nscontrol).

                          Description: http://i.msdn.microsoft.com/Aa578110.Important(en-us,MSDN.10).gifImportant
                          Remember to use the new Notification Services databases server in the -server option when re-registering the service. In addition, you should use the same user name for the new Notification Services service as the old one.

                          7.     On the computer that hosts the BAM portal, click Start, click Programs, click Microsoft SQL Server 2005, click Configuration Tools, and then click Notification Services Command Prompt.
                          8.     At the command prompt, type:
                          net stop NS$BamAlerts
                          9.     At the command prompt, type:
                          nscontrol unregister -name BamAlerts
                          10.  At the command prompt, type:
                          nscontrol register -name <BamAlerts> -server<NotificationServicesDatabaseServer>
                          11.  At the command prompt, type: net start NS$BamAlerts.
                          12.  Click Start, click Run, type cmd, and then click OK.
                          13.  At the command prompt, navigate to the following directory: %SystemRoot%\Program Files\Microsoft BizTalk Server 2006\Tracking.
                          14.  At the command prompt, type:
                          bm.exe update-config –FileName:config.xml

                          How to Resolve Incomplete Activity Instances

                          1.     Run the following query against the BAM Primary Import database:
                          Select ActivityID from bam_<ActivityName>_Active where IsComplete = 0
                          2.     If data from external systems indicates that the activity instance is in fact completed, run the following query to manually complete the instance:
                          exec bam_<ActivityName>_PrimaryImport @ActivityID=N'<ActivityID>', @IsStartNew=0, @IsComplete=1

                          Description: http://i.msdn.microsoft.com/Aa561272.note(en-us,MSDN.10).gifNote
                          You can follow the same process to complete a continuation activity by replacing ActivityID with ContinuationID.



                          Description: http://i.msdn.microsoft.com/Aa561272.note(en-us,MSDN.10).gifNote
                          If the main trace has any active continuation traces, it remains active until the continuation traces are completed.

                          Viewing all 56 articles
                          Browse latest View live