Bts 06 Developerstroubleshootingguide
Bts 06 Developerstroubleshootingguide
Abstract
This troubleshooting guide is intended to provide guidance to developers in the detection and correction of programming issues within a BizTalk application. It may also be useful to information technology (IT) professionals who support BizTalk applications.
Contents
Contents.............................................................................................................................2 Legal Information .................................................................................................11
Intro .....................................................................................................................12 Prerequisites.................................................................................................................12 Prerequisites for Developers.....................................................................................12 Prerequisites for IT Professionals..............................................................................12 General Prevention .............................................................................................13 Application Development..............................................................................................13 Application Development Best Practices...................................................................13 Other Resources.......................................................................................................14 Custom Coding.............................................................................................................14 Custom Coding Best Practices..................................................................................15 Other Resources.......................................................................................................15 Source Control..............................................................................................................16 Source Control Best Practices...................................................................................16 Other Resources.......................................................................................................17 Testing..........................................................................................................................18 Testing Best Practices...............................................................................................18 Other Resources.......................................................................................................18 Deployment...................................................................................................................19 Deployment Best Practices.......................................................................................19 Other Resources.......................................................................................................20 General Troubleshooting .....................................................................................21 BizTalk Server Administration Console.........................................................................21 Viewing In-Process and Suspended Items................................................................22 Viewing Message Flow..............................................................................................22 Saving a Message to a File.......................................................................................23 HAT...............................................................................................................................24 Viewing Tracked Message Events, Properties, and Bodies.......................................24 Debugging an Orchestration Instance.......................................................................28 Reconstructing Rule Events......................................................................................28 Searching Archived Data...........................................................................................29 Event Log......................................................................................................................29 Accessing Event Logs...............................................................................................30 Writing to the Event Log............................................................................................30
Network Monitor............................................................................................................31 SQL Server Profiler.......................................................................................................32 SQL Server Query Analyzer and Query Profiler............................................................32 PSSDiag.......................................................................................................................32 BizTalk Assembly Checker and Remote GAC Tool.......................................................33 DTCTester.....................................................................................................................33 DTCPing.......................................................................................................................33 RegMon, FileMon, and DebugView..............................................................................34 Debug Diagnostics Tool of the IIS Diagnostics Toolkit..................................................34 BizTalk Server 2006 Best Practices Analyzer...............................................................34 Troubleshooting Adapters ....................................................................................35 Using the BizTalk Adapter Trace Utility.........................................................................35 Strategies for Handling Adapter Failures......................................................................37 Base EDI Adapter.........................................................................................................37 Enabling Trace..........................................................................................................37 General Troubleshooting Questions and Answers.....................................................39 The destination EDI codelist database was not updated when I deployed my project. How do I update it?................................................................................39 Common Errors.........................................................................................................40 You receive errors with event ID 5724 or 5719 when using the Base EDI adapter. ............................................................................................................................40 You receive a "Cant make a connection to BizTalk for document" error message when you send a message through a send port that uses the EDI transport......40 You receive a "Could not connect EDI Subsystem (StartDatabase returned -2) to Database" error message, and the BizTalk Base EDI service does not start......41 You receive an error in the event log similar to "index was outside the bounds of the array" when validating or sending an EDI document....................................42 File Adapter...................................................................................................................43 General Troubleshooting Questions and Answers.....................................................43 Why isn't my file being picked up by the File receive adapter?..............................43 Why won't the File adapter accept my file name and/or file mask?........................44 FTP Adapter..................................................................................................................44 General Troubleshooting Questions and Answers.....................................................44 How do I enable logging?.......................................................................................44 Why does the FTP adapter duplicate or lose data?...............................................45 Common Errors.........................................................................................................45 You receive a "Failure occurred in parsing the remote folder listing" error message when you try to retrieve documents from or send documents to an FTP server. 45 FTP receive adapter fails to publish message if receive pipeline processing time exceeds server time-out.....................................................................................46
HTTP Adapter...............................................................................................................47 General Troubleshooting Questions and Answers.....................................................47 Where are the IIS and HTTPERR log files?...........................................................47 I am using the x64 edition of Microsoft Windows Server 2003. How do I use the 64bit version of the HTTP adapter?........................................................................48 Common Errors.........................................................................................................48 You receive error 405 (Method Not Allowed) on your HTTP receive location.........48 You receive error 500 (Internal Server Error) on your HTTP receive location........49 JD Edwards EnterpriseOne Adapter.............................................................................49 Accessing JD Edwards Event Trace for Windows Providers.....................................49 Enabling Java Trace..................................................................................................50 Common Errors.........................................................................................................50 JAR inconsistencies...............................................................................................50 I-JDE0043 or I-JDE0027........................................................................................51 I-JDE0048..............................................................................................................51 Oracle E-Business Suite ODBC Adapter......................................................................52 Common Errors.........................................................................................................52 I-OAP0007.............................................................................................................52 Messaging Engine failed to register the adapter for "Adapter" for the receive location "SomeName".........................................................................................52 You are receiving error "HY104 : [Oracle][ODBC]Invalid precision or scale value" with the INSERT method....................................................................................53 IM-004....................................................................................................................53 Oracle Database ODBC Adapter..................................................................................53 Limitations of the Oracle Database Adapter..............................................................53 Cannot use wildcard characters in send port properties........................................53 XMLDATATYPE and BFILE are unsupported data types.......................................54 Only RefCursor can be returned from native SQL stored procedure......................54 PeopleSoft Enterprise Adapter......................................................................................54 Accessing PeopleSoft Adapter Event Trace for Windows Providers..........................54 Common Errors.........................................................................................................55 E-JNI0004..............................................................................................................55 E-PSFT0030..........................................................................................................55 E-PSFT0019..........................................................................................................55 E-PSFT0024..........................................................................................................55 MQSeries Adapter........................................................................................................56 General Troubleshooting Questions and Answers.....................................................56 How do I programmatically modify jobs and mappings?........................................56 Common Errors.........................................................................................................57 Adapter raises error "Access Denied" when sending and receiving messages......57 MSMQ Adapter.............................................................................................................58
General Troubleshooting Questions and Answers.....................................................58 Why doesn't the MSMQ adapter work with my dependent MSMQ client?.............58 How do I access MSMQ adapter context properties for my project?......................58 Where are my failed transaction messages going?................................................59 Why aren't my receive locations processing documents?......................................59 Microsoft BizTalk Adapter v2.0 for mySAP Business Suite...........................................59 Using SAP RFC and CPIC Trace..............................................................................60 Common Errors.........................................................................................................60 Connection error occurs when you deploy an orchestration using a binding file....60 BizTalk service is not receiving IDOCs from the SAP system................................61 SQL Adapter.................................................................................................................62 Debugging Stored Procedures..................................................................................62 Troubleshooting Deadlocks.......................................................................................62 Debugging deadlocks in SQL Server 2005............................................................63 Debugging deadlocks in SQL Server 2000............................................................63 Minimizing deadlocks.............................................................................................63 General Troubleshooting Questions and Answers.....................................................64 How do I support the Euro symbol () when using the SQL adapter?....................64 How do I use a table that has one or more spaces in its name with the SQL adapter?..............................................................................................................65 Common Errors.........................................................................................................65 The SQL Transport Schema Generation Wizard closes unexpectedly in BizTalk Server 2006........................................................................................................65 A syntax error is raised when sending updategrams to the adapter.......................66 You get error "Invalid 'name' attribute value" when compiling your solution...........66 Columns are missing from generated XML schemas.............................................67 Troubleshooting the API ......................................................................................67 Exploring WMI Objects with CIM Studio.......................................................................67 General Troubleshooting Questions and Answers........................................................69 When does BtsCatalogExplorer commit changes?....................................................70 Why are my WMI calls failing?..................................................................................70 Troubleshooting BAM ..........................................................................................71 Tracking Profile Editor Error Messages and Remedies................................................71 Failed to apply the tracking profile.............................................................................71 Errors in retrieving, connecting, enumerating, or opening objects in the Primary Import or BizTalk Management databases.............................................................71 Failed to read server and database names from the registry....................................72 Failed to remove the tracking profile..........................................................................72 WSDL load failures....................................................................................................72
Failed to save {0}.......................................................................................................72 Failed to load {0}.......................................................................................................73 This tracking profile does not contain some actions to which milestones or data items are mapped or contains invalid or missing port mappings.....................................73 There is no active tracking profile for this activity definition. Would you like to import this activity definition instead?................................................................................73 There are no ports associated with {0}......................................................................73 Matching problems with a continuation......................................................................73 The Tracking Profile Editor cannot start the activity from the location from which you have selected the ActivityID or ContinuationID because of scope constraints. Please check your tracking profile..........................................................................74 The assembly/schema/activity cannot be found........................................................74 {0} contains invalid character(s)................................................................................74 Your tracking profile is invalid....................................................................................75 {0} is too long for Continuation, ContinuationID, Relationship or Name.....................75 General Troubleshooting Questions and Answers........................................................75 Why are the times for my tracking data in the BAM portal incorrect?........................75 Hard-coded or one-time instrumentationwhich is better?.......................................76 Why aren't my orchestration variables showing up in the TPE?................................76 Why won't my BAM and MOM integration work?.......................................................76 Why is my BAM continuation value being overwritten?.............................................76 Common Errors............................................................................................................77 You receive an error message when you try to apply a tracking profile to an x64based computer in the Tracking Profile Editor........................................................77 Problem..................................................................................................................77 Cause.....................................................................................................................77 Resolution..............................................................................................................77 You receive a "TDDS failed to read from source database" error message in the application log of a computer that is running BizTalk Server..................................78 Problem..................................................................................................................78 Cause.....................................................................................................................78 Resolution..............................................................................................................78 You receive "Error 7105" when BizTalk Services tries to read data in the BizTalk Messaging Management database or in the BizTalk MessageBox database.........79 Problem..................................................................................................................79 Cause.....................................................................................................................79 Resolution..............................................................................................................79 Troubleshooting BAS ..........................................................................................80 Enabling Trace..............................................................................................................80 General Troubleshooting Questions (and Answers)......................................................80
Why do I get the error message, 'Failed to post the SOAP request to the Web Service...' when I click Submit Profile?...................................................................81 Why do I get the error message, 'InfoPath cannot create a new, blank form. InfoPath cannot find or cannot access the following file: ...' when I try to create or edit a partner profile?.......................................................................................................81 Troubleshooting Maps .........................................................................................81 Troubleshooting Strategies...........................................................................................81 Validate your map......................................................................................................81 Review the XSLT generated for the map...................................................................82 Tune your map for specific scenarios using <mapsource>........................................82 General Troubleshooting Questions and Answers........................................................83 How do I specify XSLT output settings?....................................................................83 How do I create multipart mappings?........................................................................83 Why isn't my database functoid working?..................................................................83 Why is my map failing when calling my custom functoid?.........................................84 Common Errors............................................................................................................84 You receive error event ID 324 when parsing dates..................................................84 Problem..................................................................................................................84 Cause.....................................................................................................................85 Resolution..............................................................................................................85 Troubleshooting Orchestrations ..........................................................................85 Orchestration Tracking Options....................................................................................85 Replaying an Orchestration Instance in HAT................................................................87 Interactive Debugging of an Orchestration in HAT........................................................89 Setting a Class-Level Breakpoint..............................................................................89 Removing a Class-Level Breakpoint..........................................................................91 Setting an Instance-Level Breakpoint........................................................................91 Removing an Instance-Level Breakpoint...................................................................92 Attaching to an Orchestration Instance by Using Orchestration Debugger................92 Detaching from an Orchestration Instance................................................................93 Working with the Orchestration Debugger.................................................................93 Resuming an Orchestration Instance........................................................................95 Debugging a Called Orchestration.............................................................................95 Debugging an Orchestration Instance That is Suspended (Resumable)...................96 Debugging Orchestrations on a Remote Computer...................................................97 Limitations of the Debugger.......................................................................................98 Using Debug and Trace Statements in an Orchestration..............................................99 Writing the Assembly Version..................................................................................101 Writing Message Content........................................................................................102
Writing Information to the Event Log...........................................................................102 Writing to the Application Log..................................................................................103 Writing to a Custom Log..........................................................................................103 General Troubleshooting Questions and Answers......................................................104 How can I share global variables across all instances of an orchestration?............104 Why is my orchestration instance suspended with the status "Complete with Discarded Message"?..........................................................................................104 Should I be concerned with messages that are "Delivered Not Consumed"?.........108 Why does the compiler require my variable to be serializable?...............................108 Why must interface-based programming be done inside atomic scope?.................109 How does an orchestration invoke a COM/COM+ component?..............................110 Why doesn't my atomic transaction retry?...............................................................110 Do orchestrations support parallel activation?.........................................................111 Why do I get intermittent subscription errors when sending to a child orchestration that was just started by the parent?......................................................................112 How can I get context or other promoted properties from XLANGMessage?..........112 Why do I get errors when I attach a dynamic send port to a logical port?................113 Why aren't updates made to message fields inside an Expression shape showing up on the message I send out?.................................................................................113 How can I retry a send when an exception occurs when calling a Web service with the SOAP sending adapter?.................................................................................114 What parameters control dehydration?....................................................................114 When does the persistence of an orchestration happen?........................................114 How can an orchestration be updated without bringing down the BizTalk Host?.....115 How can I load a message to construct an XLANGPart?........................................115 When is the Delivery Notification delivered?............................................................115 When I try to run my application after deploying an orchestration with custom components, why do I get the error "File or Assembly name or one of its dependencies not found"?....................................................................................116 Common Errors...........................................................................................................116 A "WrongBodyPartException" occurs when handling a multipart MIME message in an orchestration................................................................................................116 Compiler asks if you are missing an assembly reference.....................................116 Assignment to properties of type long fails on Windows 2000..............................117 An "AssemblyName context property was not valid" error occurs when submitting a document to a Web service via an orchestration...............................................118 You receive a "Message has not been initialized in construct statement" error when building your project..........................................................................................118 You receive a "use of unconstructed message" error when building your project.119 Multipart MIME message part cannot be found....................................................119 Setting a transaction level for a scope results in an error.....................................120
Project build results in the error "you must specify at least one already-initialized correlation set for a non-activation receive that is on a non-selfcorrelating port" ..........................................................................................................................120 You receive the error "Assembly generation failed -- Referenced assembly '<assembly>' does not have a strong name" when building your solution........121 You receive an "invalid property value" error when compiling your orchestration 121 See Also......................................................................................................................121 Troubleshooting Pipelines .................................................................................121 Pipeline Tools in the SDK............................................................................................122 General Troubleshooting Questions and Answers......................................................122 Why is my custom policy file generating strange errors?.........................................122 Why am I losing data when using my custom disassembler pipeline component?..123 Why am I receiving parsing and validation errors in my receive pipeline when using my custom disassembler pipeline component?....................................................123 How do I use a signing certificate in outgoing messages?......................................124 Troubleshooting Schemas .................................................................................124 Common Errors..........................................................................................................125 You receive error 'Namespace:Element1 cannot be a member of substitution group with head element Namespace:Element2' when compiling your solution............125 Problem................................................................................................................125 Cause...................................................................................................................125 Resolution............................................................................................................125 You cant remove all data related with Cross-Referencing from the BizTalk Server database..............................................................................................................125 Problem................................................................................................................125 Cause...................................................................................................................125 Solution................................................................................................................125 Troubleshooting Web Services ..........................................................................126 General Troubleshooting.............................................................................................126 Enabling Web Services Publishing Wizard tracing..................................................126 Enabling SOAP message tracing............................................................................126 Using the ThrowDetailedError switch......................................................................126 Using .NET Framework tracing to capture and log errors in the Web service.........127 General Troubleshooting Questions and Answers......................................................129 I am receiving errors when consuming a Web service; how can I avoid them?.......129 Why am I getting errors publishing my schema that uses the <include> element?. 130 Why do I receive errors when publishing my envelope schema?............................130 Clients of published Web services may not receive server script time-out errors....130 Common Errors..........................................................................................................131
You receive 'Type messagename cannot be found in namespace servicename' error using the WSE adapter........................................................................................131 Problem................................................................................................................131 Cause...................................................................................................................131 Resolution............................................................................................................131 A Web service returns an HTTP 404 (File Not Found) error....................................132 Problem................................................................................................................132 Cause...................................................................................................................132 Resolution............................................................................................................132 A "System.IO.FileNotFoundException" error occurs when a Web service is called. 132 Problem................................................................................................................132 Cause...................................................................................................................132 Resolution............................................................................................................132
11
Legal Information
The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication. This White Paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property. Unless otherwise noted, the companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted in examples herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. 2006 Microsoft Corporation. All rights reserved. Microsoft, MS-DOS, Windows, Windows Server, Windows Vista, BizTalk, InfoPath, MSDN, SharePoint, Visual Basic, Visual SourceSafe, and Visual Studio are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. All other trademarks are property of their respective owners.
12
Intro
Microsoft BizTalk Server 2006 provides developers with an extensive set of customization options, from inline script to external components and custom libraries. These customization options often include rules governing which interfaces must be supported, what obligations classes and methods must fulfill, how external dependencies are used, and how the lifetime of the object is controlled. With so many options and rules, debugging can be difficult. This troubleshooting guide is intended to provide guidance to developers in the detection and correction of programming issues within a BizTalk application. It may also be useful to information technology (IT) professionals who support BizTalk applications.
Prerequisites
The prerequisite skills and knowledge required for various roles is detailed below.
BizTalk Server 2006 tools including the Administration console and the Health and Activity Tracking tool Microsoft SQL Server
13
General Prevention
You can minimize the number of bugs introduced into your BizTalk solution through rigorous development practices, strong coding practices, early and frequent testing, repeatable deployment, and a well-defined source code control process. It is better to prevent bugs early in the development process than to troubleshoot a solution in production.
Application Development
There are many different preventative measures you can take when developing your application. Many of the measures involve seemingly minor details like naming conventions and project organization; however, these details can have a huge impact on productivity and your ability to enhance and debug an application as it evolves.
14
Develop custom Visual Studio project templates for often-used configurations. If your team relies on the same configuration for each new project, you can package the configuration as a Visual Studio project template and ensure the basic configuration is consistent for all team members. For more information about project templates, see the MSDN article Create Reusable Project and Item Templates For Your Development Team. Consider creating secondary message pick-up locations for testing and error recovery. As you build your orchestrations and other artifacts, consider creating an alternative message pick-up location for processes that could fail. Minimize the size of your BizTalk project. The Visual Studio compiler will not successfully compile a project if it would result in an assembly larger than 75 megabytes. When the compiler reaches a size constraint it will emit fatal error CS0013 "Unexpected error writing metadata to file <filename>" and halt. Avoid using the project name as a map type name. When adding a new map to a BizTalk project in Visual Studio 2005, do not use the project name as the type name. If you do, the compiler will generate one or more errors similar to "The type name <name>' does not exist in the type". Avoid using keywords or namespace names as orchestration types. Do not use reserved words like "string" for orchestration (or any other) type name; doing so will result in one or more compilation errors.
Other Resources
The following resources may be useful when developing your application: Visual Studio Templates in the Visual Studio documentation. This page provides links to topics on using existing templates and creating new templates. Developing Integration Solutions with BizTalk Server 2004 by Angus Foreman and Andy Nash. While written for BizTalk Server 2004, much of the information contained in this technical article can be applied to BizTalk Server 2006 development including naming conventions, deployment scenarios, and testing information.
Custom Coding
When you are writing custom code, your ability to extend and troubleshoot your custom components will be greatly affected by how the code is written, commented, tested, and versioned. This section contains important best practices and resources for minimizing the defects in your code.
15
Other Resources
The following resources may be useful when coding your application: Exception Handling Application Block by Microsoft. The Enterprise Library Exception Handling Application Block lets developers and policy makers create a consistent strategy for processing exceptions that occur in all architectural layers of an enterprise application. For more information about other application blocks, see Enterprise Library for .NET Framework 2.0. Logging Application Block by Microsoft. This application block provides extensive support for logging to many different targets including e-mail and files. For more information about other application blocks, see Enterprise Library for .NET Framework 2.0. Patterns & Practices online documentation on MSDN. Microsoft patterns & practices contain deep technical guidance and tested source code based on realworld experience. Content includes software factories, guides, reference implementations, and application blocks and was created, reviewed, and approved by Microsoft architects, product teams, consultants, product support engineers, and by Microsoft partners and customers.
16
Source Control
While it may seem obvious to use a source control system, it is important to emphasize that tracking changes to source codeand protecting the source code from inadvertent changes and lossshould be a top priority in any development process. By maintaining a healthy version control system and check-in process, you can minimize the errors that are introduced to your BizTalk solution.
17
Keep test messages in their own folder under the project. Choose a folder name to hold messages ("Msgs" or "SampleMessages") and use it consistently across all BizTalk projects. You should keep generated and example messages distinct by naming convention or by placing them in a separate folder. Track version numbers in the file name and through your version control system. Check in code only when it has passed functional tests. The developer should be confident that the code will build successfully without breaking any related code. Schemas should be checked in only when they have been tested against a wide variety of messages, BizTalk projects containing business processes should be checked in only after testing with expected (and unexpected) messages with all ports configured, and Web service projects should be checked in only after testing using a test harness or by the initiating system. Use the version control system to track non-BizTalk projects related to your solution. Use the version control system to track custom tools, deployment utilities, scripts, documentation, and other artifacts relevant to your BizTalk project. For example, if your project uses a Visual Basic .NET Windows application to manage accounts in a related system, you should consider tracking the executable and configuration files. Choose a versioning number approach and stick with it. There are two approaches to setting version numbers for BizTalk solution assemblies: choose a fixed assembly version and increment only the file version, or increment both assembly and file version for a build. The approach you choose will impact how you maintain and deploy your project.
Other Resources
The following resources may be helpful additions to your source code control process: Concurrent Versions System (CVS) by the Free Software Foundation. CVS is an open-source version control system with server and client software that runs on a number of different platforms. It contains a number of features and ample documentation. Visual SourceSafe 2005 by Microsoft. Visual SourceSafe contains many features for managing source code and integrates with Visual Studio 2005. It also provides a seamless migration path to Visual Studio Team System if you later move to that platform. Visual Studio Team System (VSTS) by Microsoft. VSTS is not directly supported by BizTalk projects, but you may find that your project can be managed through VSTS through alternative methods.
18
Assembly Versioning in the .NET Framework documentation. Provides additional information about versioning .NET assemblies without focusing on BizTalk Server. It also provides links to useful information about configuration files, how the runtime locates an assembly, and assembly attributes.
Testing
Testing should be an integral part of any BizTalk Server development process.
Other Resources
The following resources may be helpful when testing your solution:
19
Visual Studio Team Edition for Software Testers by Microsoft. This version of Visual Studio provides enhanced support for managing the test life cycle and features an extensible test infrastructure for running legacy and custom tests. BizUnit by Kevin Smith. BizUnit is a test framework for automated testing of BizTalk applications. The tool provides an extensive collection of built-in test steps for different activities including the rule engine, orchestrations, Web services, database, performance counters, and validating XML. LoadGen by Microsoft. This tool is useful for generating loads on a BizTalk server and can be used to stress-test your deployment.
Deployment
In BizTalk Server 2006, application deployment complexity can run the gamut from simple (a project with few dependencies and artifacts) to complex (multiple applications with many dependencies installed on multiple servers). The key to managing deployments of any size is to consider deployment during the requirements phase and follow through in development, building appropriate scripts and modifying the solution to ensure that you have a documented, repeatable deployment process.
20
Avoid large (over 100 MB) MSI files. Large (over 100 MB) MSI files may not be deployed within the transaction time-out of the COM+ components used by BizTalk Server during application deployment, causing the deployment to fail. You should deploy smaller MSI files or modify the default transaction time-out for the deployment COM+ objects. For more information about changing the transaction time-out, see Best Practices for Deploying a BizTalk Application. Document your deployment process. Even the most complex deployment scenario can be simplified with documentation. You should document the deployment environment, steps for deploying the solution, and custom configuration settings for hardware and software. Configure a binding file for each environment and computer. You can control settings by environment or server by packaging additional binding files in your solution's exported MSI file. For more information about creating custom binding files, see Customizing Binding Files. Customize your MSI file with pre- and post-processing scripts. For more information about processing scripts and MSI, see Using Pre- and Post-processing Scripts to Customize Application Deployment. Ensure that only BizTalk administrators have access to the assemblies, binding files, and policy files. These files may contain sensitive business data such as connectivity and configuration information. If you deploy applications through a network share, configure the discretionary access control list (DACL) on the network share so that only BizTalk administrators can view its contents. Verify the security settings on virtual directories before exporting an MSI file. Be aware that the security settings on the virtual directory are those in effect when the MSI file is generated. If you are deploying an application with a virtual directory and the virtual directory already exists in the destination environment, the security settings on the existing virtual directory will be in effect.
Other Resources
The following resources may be useful when packaging and deploying your BizTalk applications: Understanding BizTalk Application Deployment and Management in the online documentation. This topic points to in-depth details on all aspects of BizTalk application deployment including binding files, management tools, and dependencies. Application Deployment Security Recommendations in the online documentation. This is an excellent source of security recommendations for application deployment and contains links to many useful related articles.
21
.NET Build Tool (NAnt) on Sourceforge. The .NET build tool provides functionality similar to the Ant by the Apache Software foundation but for .NET; you can extend the tool using .NET classes and accommodate many diverse build tasks including BizTalk tasks. Deployment Framework by Scott Colestock. The chief goal of the Deployment Framework is to streamline the deployment process and make deployment consistent and repeatable. It requires the NAnt tool. UK SDC BizTalk 2006 Documentor by Jason Birth. The UK SDC BizTalk 2006 Documenter creates compiled help files (*.chm) or Microsoft Word 2003 XML files to quickly document a given BizTalk Server 2006 installation. This tool can be run on an ad-hoc basis using the UI or from the command line as a post build/deploy task to create a compiled help file describing a BizTalk Server 2006 installation. BizTalk Server 2006 Minty Fresh Documentor by Eric Battalio. The Documentor program retrieves BizTalk Server 2006 configuration information and saves it as XML for reference; it also includes an XSLT file that transforms the XML into HTML with a table of contents.
General Troubleshooting
Troubleshooting begins with the BizTalk Server Administration console and the Health and Activity Tracking (HAT) tool, and can extend into a number of different tools and utilities. You may find yourself going from the Orchestration Debugger in HAT to the Network Monitor application to look at packets containing information relevant to your solution. This section discusses the many different tools and utilities available along with key functionality that may prove useful when performing basic troubleshooting.
22
If you want to track rule-firing events and debug orchestrations, you must use the HAT tool.
23
24
7. On the Service Details screen, click the Messages tab, right-click a message, and then click Save To File. After you have read the message about confidential data, click OK.. Note Do not save the message if you are unsure about file security or whether the message contains confidential data. 8. Choose a directory for instance-related files, and then click OK. If the files are saved successfully, you will receive a success message. 9. Use Windows Explorer to navigate to the directory you specified in the preceding step, and view the data file ({partname}.out) and context file ({messagename}.xml) for the selected message instance.
HAT
The Health and Activity Tracking tool enables developers and system administrators to: View tracked message events, properties, and bodies Debug orchestrations and replay the execution of a specific orchestration instance using the Orchestration Debugger. Track rule-firing events. Retrieve messages by specifying criteria such as message schema and message property/value pairs. Search for archived data in an archived or backed-up Tracking database. If you are looking for configuration information, instance status, message contents, and other instance information, you can use the BizTalk Server Administration console.
25
of the message's promoted properties. The predefined queries provide common queries; after you run them you can modify them and save them for reuse. To run a predefined query 1. Click Start, point to Programs, point to Microsoft BizTalk Server 2006, and then click Health and Activity Tracking. 2. On the HAT Tools menu, click Queries, and then choose Most recent 100 service instances or one of the other query choices as appropriate to your situation. The results will be displayed in the Query Builder view and will include tracked messages. For example, the following screenshot shows three tracking message events and tracks the receipt of a message through a receive port, processing through an orchestration (HelloWorld sample), and transmission through a send port.
3. Right-click an individual entry to view the message flow, save the message body, or perform other actions relevant to the type of entry. For example, you cannot save a service instance to disk, but you can save related messages to disk. To run a custom query using the Find Message view 1. Click Start, point to Programs, point to Microsoft BizTalk Server 2006, and then click Health and Activity Tracking. 2. On the HAT Tools menu, click Reporting, and then choose Find Message.
26
3. In the Find Message view, click Schema to open the Schema Selection screen, and then click one of the schemas. This limits searches to messages whose schema matches the selected schema. 4. Change the From and To dates as appropriate to your situation. To change, click the drop-down arrow and use the calendar to select a different date. The system defaults to an eight-day range from a week before the current date to 24 hours after. 5. Enter optional parameters for Port, Party, and the message properties filter. There is an implicit AND clause between all conditions, so messages must match all of the search criteria to be considered a match. Note Message properties filter values are available only if the property has been previously configured for tracking. 6. Click Run Query. Matching items are displayed below the search criteria. You can also save tracked message bodies to a file and view them using non-Microsoft tools. To save tracked message bodies 1. Click Start, point to Programs, point to Microsoft BizTalk Server 2006, and then click Health and Activity Tracking. 2. On the HAT Tools menu, click Queries, and then choose Most recent 100 service instances or one of the other query choices as appropriate to your situation.
27
3. Right-click a service item that has been configured to track messages, and then click Save All Tracked Messages. 4. If it has not been turned off, you will be cautioned that the tracked messages may contain confidential data. After you have read the message, click OK. Note Save tracked messages containing confidential information in a secure location. If you do not, users without proper authorization may be able to view the confidential information. 5. Choose a destination folder. Make sure the folder is secure if your messages contain confidential information. Click OK to continue. All of the tracked messages related to this service will be saved to the selected destination folder unless there was a problem or no messages were found. On success you will be shown a list of service instance IDs and associated message IDs that were saved, as in the following figure:
If a message could not be saved, the Save messages status column will contain a description of the possible error(s), similar to the following: "The message was not found in the Message Box or the Tracking database. This may be caused by the following conditions: (1) message tracking is not enabled; (2) the message(s) is no longer referenced by a running or suspended service instance; (3) the Message Box tracking tables have been automatically purged; or (4) the SQL Server agent is not running on the Message Box servers." To repair, first ensure that message tracking is enabled and the SQL Server agent is running on the MessageBox servers. After you confirm this, verify that the tracking tables have not been purged by running a custom query with dates that include the days your tracked messages were created. For messages associated with a service instance that are not tracked, use the Administration console group hub page to discover whether the message(s) are referenced by a running or suspended service instance. If they are not, you will not be able to save them. The tracked messages and related files are now saved in the destination folder you selected.
28
BizTalk Server does not track messages that do not successfully make it through one of the tracking points. In some casessuch as when a message is suspended because it is invalid, or if no host is expecting the messageit may be placed in the Suspended queue without being tracked. If you terminate this message there will be no record of it. Knowing which tracking points were reached and the first tracking point that was missed will shed light on where in the process the message is failing. For example, if a message fails to hit a tracking point on a receive adapter, the system generating the message may be failing to generate a message or a message with the expected schema, or a custom component within the receive pipeline may be throwing an exception prior to message identification. Your debugging strategy will then be based on the stage (and component) that you suspect caused the error. You can use the BizTalk Server Administration console to enable message body and message property tracking.
29
Note To perform the procedure in this topic, you must be logged on with an account that is a member of the BizTalk Server Administrators group. 2. In the console tree, expand the BizTalk group and the BizTalk application for which you want to configure tracking for a policy. 3. Click Policies, right-click the policy, click Properties, and then click Tracking. 4. Select the tracking options you want as described in the following table. Use this Fast activity To do this Select this check box to track the instance data on which the policy operates. Select this check box to track the true/false results of conditions in the selected policy. Select this check box to track the actions started as a result of the policy. Select this check box to track updates to the agenda. The agenda contains a list of actions that are "true" and need to fire.
Condition evaluation
Rule firings
Agenda updates
5. Click OK.
Event Log
The Windows event logs contain information, warnings, errors, and other messages relevant to BizTalk Server and other applications running on your BizTalk Server computer. You will find the Application, Security, and System event logs useful for
30
diagnosing application and server problems, and you can also write your own custom events into one of the existing event logs (such as Application) or into a custom event log specific to your application needs.
31
Note You must have administrative privileges to create a new event log. For this reason, you should create custom logs as part of your installation process and remove them in the uninstallation process. Consider using the Microsoft Logging Application Block if you need a flexible, tested mechanism to log events from your application. You can use the Logging Application Block to write information to a variety of locations including the event log, an e-mail message, a database, a message queue, a text file, a WMI event, or custom locations using application block extension points. For more information about the Logging Application Block, see Logging . You can also manipulate the Event Log by using the EventLog class. For more information about the EventLog class, see EventLog. Note Write confidential or protected message data to the event log only if you have taken steps to ensure that only authorized users have access. Failure to do so may expose confidential data to unauthorized users. For more information about security and event logs, see Security Ramifications of Event Logs. Note Event logging consumes resources such as disk space and processor time. The amount of disk space that an event log requires and the overhead for an application that logs events depend on how much information you choose to log.
Network Monitor
Use the Network Monitor utility to capture network traffic between BizTalk Server and remote clients or servers. Captured network traffic can be analyzed to diagnose networkrelated problems. Network Monitor is available on Windows 2000 Server and Windows Server 2003 through the Add/Remove Windows Components option that is available in Add/Remove Programs. Network Monitor functionality is provided for Windows XP through the use of the NETCAP.exe utility that is installed with the Windows Support Tools available on the Windows XP CD. For more information about the NETCAP.exe utility, see KB Article 310875. For information about how to capture network traffic with Network Monitor, see KB Article 148942.
32
PSSDiag
PSSDiag for BizTalk Server is a troubleshooting tool for Microsoft support engineers to capture diagnostic data. It captures data from many different areas including: BizTalk trace BizTalk HAT information Event logs Performance logs BizTalk registry BizTalk executable attributes BizTalk hotfix information MSInfo details
The program is available on the BizTalk Server installation CD. To use PSSDiag 1. Install Tracelog from the Platform SDK available here. Perform a custom installation, clear all features, and then expand the Microsoft Windows Core SDK feature and choose Tools. 2. Locate the Bin folder under the Microsoft Platform SDK folder, and then
33
copy the Tracelog.exe file to the Support folder under the Microsoft BizTalk Server 2006 installation folder. 3. Open a command prompt, go to the Support folder, and run PSSDiag.exe /G. 4. Specify the trace level when prompted: -high or -all, then press ENTER 5. Reproduce the issue. 6. Use CTRL+C at the command prompt to stop PSSDiag. Log files are created in the Output subfolder.
DTCTester
Most BizTalk Server runtime operations require Microsoft Distributed Transaction Coordinator (MSDTC) support to ensure that the operations are transactionally consistent. If MSDTC transaction support is not available, then the associated BizTalk Server runtime operations cannot proceed. Use the DTCTester tool to verify distributed transaction support across firewalls or against networks. The DTCTester utility uses ODBC to verify transaction support against a SQL Server database and therefore requires that SQL Server is installed on one of the computers being tested. For more information about DTCTester, see KB Article 293799.
DTCPing
Use the DTCPing tool to verify distributed transaction support across firewalls or against networks. The DTCPing tool must be installed on both the client and server computers and is a good alternative to the DTCTester utility when SQL Server is not installed on
34
either computer. For more information about using DTCPing to verify distributed transaction support, see KB Article 306843.
35
To download the Best Practices Analyzer, see BizTalk Server 2006 Best Practices Analyzer.
Troubleshooting Adapters
Because of the wide variety of functionality and configuration options provided by native and line-of-business (LOB) BizTalk Server adapters, troubleshooting can be a challenge. This section provides general troubleshooting techniques useful for all adapters along with adapter-specific advice for many of the LOB and native adapters.
36
To enable BizTalk adapter tracing 1. At a command prompt, change the current directory to the directory where BizTalk Server 2006 is installed. By default, BizTalk Server 2006 is installed in the Program Files\Microsoft BizTalk Server 2006 directory. 2. Type the following command, and then press ENTER: trace -tools "Path of the Trace Log tool" By default, the Trace Log tool is located in the C:\Program Files\Microsoft Platform SDK\Bin directory. You must enclose the path of the Trace Log tool in quotation marks. For example, type the following command, and then press ENTER: trace -tools "C:\Program Files\Microsoft Platform SDK\Bin" Note The -tools switch indicates to the Trace.cmd file the location of the Tracelog.exe file. To capture trace output 1. At a command prompt, change the current directory to the directory where BizTalk Server 2006 is installed. By default, BizTalk Server 2006 is installed in the Program Files\Microsoft BizTalk Server 2006 directory. 2. At a command prompt, type the following command, and then press ENTER: trace -start 3. Reproduce the scenario for which you want to capture trace output. 4. At a command prompt, type the following command, and then press ENTER: trace -stop 5. After you stop the trace, a binary file named Bts2006.bin is generated in the folder where BizTalk Server 2006 is installed. 6. Send the Bts2006.bin file to Microsoft Product Support Services for analysis. Some adapters have additional support for the trace utility in the form of special providers that supply adapter-specific details. To determine if your adapter provides additional support, check the adapter's documentation. Note This guide provides information about adapter-specific trace providers where appropriate.
37
Enabling Trace
The Base EDI adapter can be configured to generate a trace file containing information about the kernel and one or more of the following subprocesses: Translate Memory Database Network BizTalk connector
38
File connector
Base EDI adapter tracing is controlled through the Base EDI Administration console. To enable Base EDI adapter tracing 1. To start the Base EDI Administration console, browse to the <Installation Path>\\EDI\Subsystem directory and double-click EDIBTMMc.msc. 2. Expand the Microsoft BizTalk Server Base EDI Adapter folder. 3. Click the Parameters folder. 4. Right-click the server listed, and then click Properties. 5. On the EDI Subsystem screen, click the Trace tab and specify a trace file. 6. Click the items you want to trace. In the sample shown in following figure, the adapter is configured to trace kernel, BizTalk connector and file adapter activity.
Note
39
Tracing can have an impact on the performance of your solution. Use tracing with caution and disable it when you no longer need it. 7. Click OK when finished. Future EDI activity will be logged.
The destination EDI codelist database was not updated when I deployed my project. How do I update it?
The BizTalk Server application and deployment tools like BTSTask do not implement functionality to update the destination EDI codelist database with the information in the deployed EDI schemas. The codelist must be manually updated using the XSD2EDI tool. To manually update an EDI codelist 1. Click Start and then click Run. 2. Type cmd and then click OK. 3. At the command prompt, use the cd command to change to the directory that contains the Base EDI schema containing the codelist you want to use for the update. For example, cd c:\Projects\MyEDIProject\Schemas. 4. At the command prompt, run the XSD2EDI command to update the codelist database. The format of the command is: XSD2EDI -c <codelist database> <base EDI schema> For example, the following command updates the default codelist database with an X12 4010 850 codelist: XSD2EDI -c " C:\Program Files\Microsoft BizTalk Server 2006\EDI\Adapter\CodeLists\EDICodeLists.mdb" "C:\Program Files\Microsoft BizTalk Server 2006\EDI\Adapter\EDI Schemas\X12\4010\850Schema.xsd" Note Use quotes if your path includes spaces. If your path has spaces and you do not use quotes, you will receive a "file not found" error. 5. Restart the Base EDI service. In Control Panel, double-click Administrative Tools, double-click Services, right-click the BizTalk Base EDI service, and then click Stop. Right-click the service again and then click Start.
40
6. At the command prompt, enter COMPEIF to generate the EIF file that is used by the BizTalk Base EDI service at run time. 7. When you are finished, type exit at the command prompt, and then press ENTER.
Common Errors
You receive errors with event ID 5724 or 5719 when using the Base EDI adapter.
Problem When you use the adapter, you receive an error that is similar to one of the following messages when using party resolution together with an EDI receive location: The Messaging Engine is dropping the message due to authentication failure. The message came from Receive Location URL "EDI://1234567:ZZ:1234567". There was a failure executing the receive pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive" Source: "Microsoft.BizTalk.Pipeline.Components" Receive Location: "EDI://1234567:ZZ:1234567" Reason: There was an authentication failure. "The party corresponding to the inbound message cannot be identified". Cause The issue occurs because the BizTalk Server Base EDI adapter does not support party resolution. Resolution Create a custom pipeline or orchestration component to scan the InboundTransportLocation context property value and the ExplorerOM object model to enumerate through a list of parties to find a party that has an EDI qualifier value that matches.
You receive a "Cant make a connection to BizTalk for document" error message when you send a message through a send port that uses the EDI transport
Problem When you send a message through a send port that uses the EDI transport, you receive an error similar to the following in the event log:
41 Event Type: Error Event Source: EDI Subsystem Event Category: BizTalk Server 2006 Event ID: 23 Date: MM/DD/YYYY Time: 4:55:34 PM User: N/A Computer: BIZTALKSERVERDescription: Error encountered: ERROR (1030), interchangenr 10037 : COM_SendMessage(): Cant make a connection to BizTalk for document #10037. Errorcode is -1030 ()
Cause This can occur when you have not configured and enabled a receive location that uses the EDI transport. Resolution To resolve this issue, configure and then enable a receive location that is bound to the EDI transport. For more information about configuring a receive location using the EDI transport, see How to Configure a Base EDI Receive Location.
You receive a "Could not connect EDI Subsystem (StartDatabase returned -2) to Database" error message, and the BizTalk Base EDI service does not start
Problem When you try to start the BizTalk Base EDI service, you receive an error message that is similar to "Could not connect EDI Subsystem (StartDatabase returned -2) to Database" in the Application log and the Base EDI service does not start. Cause This problem occurs if the following conditions are true: The BizTalk Base EDI database is on a remote computer that is running Microsoft SQL Server 2000 or Microsoft SQL Server 2005. The SQL Server client tools are not installed on the computer that is running the Base EDI service. Resolution To resolve this problem, install the SQL Server client tools on the computer that is running the BizTalk Base EDI service. After you install the SQL Server client tools, you can successfully start the BizTalk Base EDI service. Note SQL Server client tools can be found on the SQL Server installation CD.
42
You receive an error in the event log similar to "index was outside the bounds of the array" when validating or sending an EDI document
Problem When you try to validate an EDI document or when you try to send an EDI document in Microsoft BizTalk Server 2006, an Error event that resembles the following may be logged in the event log:
Event Type: ErrorEvent Source: EDI TransmitterEvent Category: BizTalk Server 2006Event ID: 27Description:Transfer of message(s) to EDI Subsystem failed. Index was outside the bounds of the array.
Cause This issue occurs if one of the following conditions is true: The BizTalk Base EDI service and the BizTalk Server Host service do not use the same logon credentials. The logon account for the BizTalk Base EDI service and for the BizTalk Server Host service does not have the permissions that are required to access the BizTalkEDIDb database and the Configuration database. The user who configured the EDI adapter is not a member of the EDI Subsystem Users group and of the BizTalk Server Administrators group. Resolution The user account that is configured as the logon account for the BizTalk Server Host service must be a member of the EDI Subsystem Users group. If the user account that is configured as the logon account for the BizTalk Server Host service is not a member of the EDI Subsystem Users group, the EDI transmitter cannot connect to the EDI subsystem because of insufficient permissions. Therefore, the Error event in the event log states that there is a transmission failure. To resolve, try one of the following methods: Verify the service logon credentials. Verify that the BizTalk Base EDI service and the BizTalk Server Host service use the same logon credentials. Verify the database permissions. Verify that the user account that is configured as the logon account for the BizTalk Base EDI service and for the BizTalk Server Host service has the permissions that are required to access the BizTalkEDIDb database and the Configuration database. Verify the group membership. Verify that the user who configured the EDI adapter is a member of the EDI Subsystem Users group and of the BizTalk Server Administrators group.
43
File Adapter
The File adapter is in charge of reading and writing messages from files to and from the BizTalk Server MessageBox database.
44
Why won't the File adapter accept my file name and/or file mask?
The BizTalk File adapter file name and file mask properties are validated at design time using the following rules: Only one file mask or file name can be specified per receive location or send port. The file name and file mask cannot include a full or partial path specification. The fields are not case-sensitive. The file name cannot contain any of the following characters: < > : / | " ? * ; The file mask cannot contain any of the following characters: < > : / | " ;
You cannot use any of the reserved device names (CON, PRN, CLOCK$, NUL, LPT1, and so on) as the name of a file or as a file extension. Only the first three characters in a file mask extension are considered when matching files. This means "*.xml" will match "a.xml" and "b.xmlxyzabc"; the mask "*.xmlq" will match the same files. The total length of the file path, file mask, and file name must not exceed 256 characters. The file path cannot begin with "\\?". Mapped network drive letters cannot be used because they are user-session based. For more information about the restrictions of the File adapter, see Restrictions When Configuring the File Adapter.
FTP Adapter
The FTP adapter exchanges data between an FTP server and Microsoft BizTalk Server, and allows for the integration of vital data stored on a variety of platforms with line-ofbusiness applications.
45
Depending upon your FTP server software, you may be able to configure logging for the FTP servers connected to by the BizTalk FTP adapter. Check the documentation for your server to assess your options.
Common Errors
You receive a "Failure occurred in parsing the remote folder listing" error message when you try to retrieve documents from or send documents to an FTP server
Problem When you try to retrieve documents from or send documents to an FTP server by using the Microsoft BizTalk Server 2006 FTP adapter, you receive an error message that is similar to the following:
46
A failure occurred in parsing the remote folder listing. Cause You may receive this error message if the following conditions are true: The receive handler or the send handler for the BizTalk Server 2006 FTP adapter is configured to use a firewall mode of Passive. The target FTP server does not permit passive connections.
Resolution To resolve this behavior, use one of the following methods: Configure the receive handler or the send handler, or both, for the BizTalk Server 2006 FTP adapter to use a firewall mode of Active. Configure the target FTP server to permit passive connections. The FTP adapter can be used to connect to FTP servers on systems ranging from Solaris and Linux to AS/400. For more information about connecting to legacy systems, see Configuring an FTP Adapter to Work with Legacy Hosts.
FTP receive adapter fails to publish message if receive pipeline processing time exceeds server time-out
Problem A message received via the FTP adapter is not published to the MessageBox database. You may see errors similar to the following in the Application log for the BizTalk Server computer:
Event Type:Error Event Source:BizTalk Server 2006 Event Category:BizTalk Server 2006 Event ID:5719 Date:6/30/2006 Time:12:08:55 PM User:N/A Computer:BIZTALKSERVER Description: There was a failure executing the receive pipeline: "Microsoft.BizTalk.DefaultPipelines.PassThruReceive, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "Pipeline " Receive Port: "ReceivePort1" URI: "ftp://FTPSERVER:21/*.txt" Reason: Unable to receive the file "file.txt " from the FTP server.
and
Event Type:Warning
47 Event Source:BizTalk Server 2006 Event Category:BizTalk Server 2006 Event ID:5740 Date:6/30/2006 Time:12:08:56 PM User:N/A Computer:BIZTALKSERVER Description: The adapter "FTP" raised an error message. Details "Unable to receive the file "file.txt " from the FTP server. ".
Cause The time taken to complete pipeline processing exceeds the FTP connection time-out. Resolution Use one of the following methods to mitigate this problem: Increase the connection time-out value. Set the idle time-out value on the FTP server to be at least the amount of the time it takes to process the file. Use the Temporary Folder feature on the receive location. In this case, the FTP adapter copies the file to the temporary folder (typically the local disk). It typically takes less time to copy the file to the local disk than to run the message through the pipeline and persist it to the MessageBox database, which effectively reduces the idle time.
HTTP Adapter
The HTTP adapter is used to exchange information between Microsoft BizTalk Server and an application by means of the HTTP protocol. The HTTP adapter consists of two adaptersa receive adapter and a send adapter. The HTTP receive adapter is a Microsoft Internet Information Services (IIS) Internet Server Application Programming Interface (ISAPI) extension that the IIS process hosts, and it controls the receive locations that use the HTTP adapter. The HTTP send adapter controls the send ports that use the HTTP adapter.
48
%\system32\LogFiles\W3SVC1\ and the HTTPERR log files can be found in %WinDir %\system32\LogFiles\HTTPERR. Note The HTTPERR log file can only be found on a Windows Server 2003-based computer.
I am using the x64 edition of Microsoft Windows Server 2003. How do I use the 64-bit version of the HTTP adapter?
The 64-bit version of the HTTP receive adapter is installed to the <drive>\Program Files (x86)\Microsoft BizTalk Server 2006\HttpReceive64 directory of your BizTalk server by default. To run the 64-bit version of the HTTP receive adapter in 64-bit native mode you must execute the following script from a command prompt:
cscript %SystemDrive%\inetpub\AdminScripts\adsutil.vbs set w3svc/AppPools/Enable32bitAppOnWin64 0 C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50215>aspnet_regiis.exe -i
Common Errors
You receive error 405 (Method Not Allowed) on your HTTP receive location
Problem You are receiving error 405 (Method Not Allowed) when receiving messages through an HTTP receive location. Cause The virtual folder containing BTSHTTPReceive.dll does not have permissions to run scripts and executables. Resolution Verify that your virtual folder containing BTSHTTPReceive.dll has the Execute Permissions property value of Scripts and Executables. To verify this, right-click the virtual directory, click Properties, and then click the Virtual Directory tab.
49
You receive error 500 (Internal Server Error) on your HTTP receive location
Problem You are receiving error 500 (Internal Server Error) when receiving messages through an HTTP receive location. Cause There are two potential causes: The identity for the IIS out-of-process host has insufficient privileges to access BizTalk Server. The receive port that corresponds to the receive location has not been started in BizTalk Server. Resolution To resolve, try the following: Verify that the identity for the out-of-process host is set to a user that belongs to the BizTalk Isolated Host Users group. This user account must have access to the BizTalk Management database, so do not use the IWAM_<server name> user account (which is the default). Verify that the port corresponding to the receive location has been started.
50
Management Logging Provider. The <Trace element> switch is -management. Use -management to get any messages from the log that were generated during browsing of the server system. To use Event Trace for Windows, run the BizTalk Adapter for JD Edwards EnterpriseOne command, BTAJDEEnterpriseOneTrace.cmd. You use this command as follows:
BTAJDEEnterpriseOneTrace <Trace element> -start [-cir <MB>| -seq <MB>] [-rt] logfile BTAJDEEnterpriseOneTrace <Trace element> -stop
For more information about using JD Edwards EnterpriseOne providers with Event Trace for Windows, see Using Event Tracing for Windows.
After importing metadata, you can find the log file in the root directory with a name similar to YYYYMMDD.log; for example, if the log were created on February 2, 2006 the log file would have a name similar to "20060202.log".
Common Errors
JAR inconsistencies
Problem General connection problems when trying to connect to the JD Edwards EnterpriseOne system. Cause Incompatible JAR files.
51
Solution Generate JAR files in the environment from which you plan to access the JD Edwards EnterpriseOne system. Copying JAR files from one environment to another results in unpredictable behavior.
I-JDE0043 or I-JDE0027
Problem Logon failed. Cause There are many potential causes: The JD Edwards EnterpriseOne JAR files are missing. You have specified the wrong application server name, port number, environment, or path for the configuration file. Your logon credentials are incorrect. The ideinterop.ini file is bad or missing.
Resolution To resolve this problem, try the following: Verify your credentials and CLASSPATH setting. The CLASSPATH setting can be found on the Advanced tab of the System Properties dialog box. Click Environment Variables to review the current environment variables for your computer. Fix your logon credentials. Repair or replace the ideinterop.ini configuration file.
I-JDE0048
Problem The BizTalk Adapter for JD Edwards EnterpriseOne log contains entries about missing or empty jdearglist.txt file. Cause Jdearglist.txt is missing or empty. Resolution You must create jdearglist.txt using a text editor, with entries describing these parameters, and save it in the folder C:\Program Files\Microsoft BizTalk
52
Adapters\JDEEnterpriseOne\config. If this file does not exist or is empty, an informational message appears in the BizTalk Adapter for JD Edwards EnterpriseOne log when the adapter opens. For more information about the format of jdearglist.txt, see Handling String Values.
Common Errors
I-OAP0007
Problem You receive error I-0AP0007 when calling a method on a connection. Cause A call was made on a connection that was not created from the Login method of the session object. Resolution Create the connection by calling the Login method of the session object.
Messaging Engine failed to register the adapter for "Adapter" for the receive location "SomeName"
Problem Messaging Engine failed to register the adapter for the receive location. Cause You are using a receive port and have enabled the port before creating a port in your orchestration to handle the events. Resolution Verify that the receive location is valid, and that the isolated adapter runs under an account that has access to the BizTalk Server databases.
53
You are receiving error "HY104 : [Oracle][ODBC]Invalid precision or scale value" with the INSERT method
Problem You receive the error "HY104 : [Oracle][ODBC]Invalid precision or scale value" when you use the INSERT method. Cause Oracle treats literal numbers differently. Resolution Format the numbers with a semicolon instead of with a period. Consult your Oracle documentation for more information about the format of literal values.
IM-004
Problem While you are using the Add Generate Item Wizard you receive an error similar to the following: IM004 : [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed. Cause The ODBC driver manager cannot create an instance of the required database driver. Resolution Add the PATH to the ODBC driver client DLLs.
54
For more information about using PeopleSoft providers with Event Trace for Windows, see Using Event Tracing for Windows.
55
Common Errors
E-JNI0004
Problem A Java exception is thrown when trying to use the adapter. Cause Bad or missing psjoa.jar file. Resolution Verify the existence and location of the psjoa.jar file.
E-PSFT0030
Problem Failed to instantiate Component Interface Beans. Cause Bad or missing psjoa.jar file. Resolution Verify the existence and location of the psjoa.jar file.
E-PSFT0019
Problem Connection to PeopleSoft Application Server failed. Cause Unknown PeopleSoft host name was used. Resolution Verify the PeopleSoft host and user parameters.
E-PSFT0024
Problem Connection failed with an error message similar to "JavaClient is an Invalid User name, or you typed the wrong password".
56
Cause The wrong user name and password were used. Resolution Verify the user name and password you are using and ensure they are properly cased. PeopleSoft user names and passwords are case sensitive.
MQSeries Adapter
The MQSeries adapter serves as a bridge between Microsoft BizTalk Server and IBM MQSeries servers, enabling you to use a full range of options in creating your business processes.
57
Common Errors
Adapter raises error "Access Denied" when sending and receiving messages
Problem In Microsoft BizTalk Server 2004 and Microsoft BizTalk Server 2006, you may receive an error message that resembles one of the following when you use the BizTalk Adapter for MQSeries to send messages to and to receive messages from an MQSeries server: The adapter "MQSeries" raised an error message. Details "The adapter has encountered an 'Access Denied' error while attempting to contact the COM+ object on the MQSeries server. Ensure the BizTalk account is added to the Role on the MQSAgent COM+ application." The adapter failed to transmit message going to send port "MQS://servername/queuename". It will be retransmitted after the retry interval specified for this Send Port. Details: "The adapter has encountered an 'Access Denied' error while attempting to contact the COM+ object on the MQSeries server. Ensure the BizTalk account is added to the Role on the MQSAgent COM+ application." Additionally, when you try to create the receive location or the send port that is configured to use the BizTalk Adapter for MQSeries, you may receive the following warning message in Event Viewer: The adapter "MQSeries" raised an error message. Details "The adapter has encountered an 'Access Denied' error while attempting to contact the COM+ object on the MQSeries server. Ensure the BizTalk account is added to the Role on the MQSAgent COM+ application." Cause This issue may occur if one or more of the following conditions are true: The host account for the BizTalk Adapter for MQSeries does not have the required permissions for the MQSAgent COM+ application (MQSAgent2) or for the MQSAgent2 COM+ application on the MQSeries server. On a Microsoft Windows Server 2003 Service Pack 1-based server, the host account for the BizTalk Adapter for MQSeries is not a member of the Distributed COM Users group on the MQSeries server. Resolution To resolve this issue, try the following methods. You may have to try more than one method to resolve the issue.
58
Enable network COM+ access on the Microsoft Windows Server 2003-based computer. For details on enabling COM+ access, see How to enable network COM+ access in Windows Server 2003. Configure the Microsoft Distributed Transaction Coordinator (DTC) settings on the server where BizTalk Server is installed and on the server where the MSQAgent application or the MSQAgent2 application is running. Verify that the host account for the BizTalk Adapter for MQSeries is added to the role that was created in the MQSAgent COM+ application or in the MQSAgent2 COM+ application on the MQSeries server. You can verify this in Component Services. On a Windows Server 2003 Service Pack 1-based server, examine the group memberships of the host account for the BizTalk Adapter for MQSeries. Make sure that the account is a member of the Distributed COM Users group on the MQSeries server where the MQSAgent COM+ application or the MQSAgent2 COM+ application is installed. You can use MQSender.exe to send messages to and from remote computers and recreate scenarios for troubleshooting this issue.
MSMQ Adapter
The MSMQ adapter lets you use Microsoft Message Queuing 2.0 and Message Queuing 3.0 from BizTalk Server 2006.
Why doesn't the MSMQ adapter work with my dependent MSMQ client?
The Microsoft BizTalk Adapter for MSMQ is currently not supported when Microsoft Message Queuing (also known as MSMQ) is installed as a dependent client. The BizTalk Adapter for MSMQ checks for an existing installation of Message Queuing. If the existing installation of Message Queuing is configured as a dependent client, the BizTalk Adapter for MSMQ is not supported.
59
Microsoft.BizTalk.Adapter.MSMQ.MsmqAdapterProperties.dll located in the BizTalk Server 2006 installation directory. The MSMQ adapter context properties are exposed by this file rather then by Microsoft.BizTalk.GlobalPropertySchemas.dll to maintain backward compatibility with applications that were developed with BizTalk Server 2004.
60
You can use the following script to enable and disable RFC or CPIC tracing:
Set oShell = CreateObject("WScript.Shell") Set oUserEnv = oShell.Environment("SYSTEM") 'RFC_TRACE '0 = No trace '1 = Trace oUserEnv("RFC_TRACE") = 1 ' CPIC_TRACE ' 0 = No trace '1 = Write error messages in trace file '2 = Full trace '3 = Include trace data blocks oUserEnv("CPIC_TRACE") = 1 oUserEnv("RFC_TRACE_DIR") = "c:\RFCTrace"
Common Errors
Connection error occurs when you deploy an orchestration using a binding file
Problem When you deploy the orchestration project using a binding file, BizTalk Server displays the following connection error in Event Viewer:
61
The adapter failed to transmit message going to send port "sap://Ebizides620:00/800/<username>/en/". It will be retransmitted after the retry interval specified for this Send Port. Details: "Name or password is incorrect. Please re-enter." Cause The password was not assigned correctly to the password field of BizTalk Explorer. Resolution Correct the password by manually updating the binding file that is used for deploying on another computer.
Resolution Try the following to resolve the problem: Examine the list of sent IDOCs. Execute the we05 transaction to bring up a search page that you can use to query for IDOCs submitted within a certain time period. View the sm58 transaction output. Execute the sm58 transaction. If there are IDOC attempts listed here, then the SAP system is attempting and failing to send the IDOCs. Verify the BizTalk Server connection. Verify active connections to SAP by running the smgw transaction and then using the Goto menu to navigate to Logged on clients. Test the RPC connection. Use the sm59 transaction to list current RPC ports, and then test a port by clicking the Test Connection button on an individual port's details screen.
62
SQL Adapter
Debugging Stored Procedures
Programming errors in stored procedures can often be more easily identified by stepping through the code one statement at a time. This gives you the opportunity to not only verify stored procedure arguments and variables, but also check data in tables, error values, and other variables that are affected by the stored procedure. To debug a SQL Server stored procedure using Visual Studio 1. Open a BizTalk project using Visual Studio 2005. 2. On the Visual Studio View menu, click Server Explorer. 3. In the Server Explorer pane, right-click Data Connections and then click Add Connection. 4. On the Choose Data Source screen, click Microsoft SQL Server and then click Continue. 5. On the Add Connection screen, choose a server name from the drop-down list or type a server name, and choose a logon method. If you choose Use SQL Server Authentication, supply a User name and Password. Choose a database to connect to, and then click OK. 6. In the Server Explorer pane, expand the database and then expand Stored Procedures to expose the stored procedures. 7. Right-click one of the stored procedures and then click Step Into Stored Procedure. 8. On the Run Stored Procedure screen, enter values for each of your stored procedure arguments. 9. Step through the stored procedure using F10, breakpoints, and the other tools available in Visual Studio 2005.
Troubleshooting Deadlocks
A deadlock occurs when two or more tasks permanently block each other because each task has a lock on a resource that the other tasks are trying to lock. The SQL Server Database Engine automatically detects deadlock cycles within SQL Server; when a cycle is detected, one of the sessions is chosen as a deadlock victim and is terminated with an error to break the deadlock. The following types of resources can cause blocking that could result in a deadlock: Locks
63
Worker threads Memory Parallel query execution-related resources Multiple Active Result Sets resources
Although deadlocks cannot be completely avoided, they can be identified and minimized through debugging tools and defensive coding techniques.
Minimizing deadlocks
Minimizing deadlocks can increase transaction throughput and reduce system overhead because fewer transactions are rolled back or resubmitted. To minimize deadlocks in your application: Access objects in the same order. If all concurrent transactions access objects in the same order, deadlocks are less likely to occur.
64
Avoid user interaction in transactions. This is because the speed of batches running without user intervention is much faster than the speed at which a user can manually respond to queries, such as replying to a prompt for a parameter requested by an application. Keep transactions short and in one batch. Keeping transactions in one batch minimizes network roundtrips during a transaction, reducing possible delays in completing the transaction and releasing locks. Use a lower isolation level. Using a lower isolation level (such as read committed) holds shared locks for a shorter duration than a higher isolation level (such as serializable), and thus may reduce locking contention. Use a row versioning-based isolation level. This can minimize deadlocks that can occur between read and write operations. Use bound connections. Using bound connections, two or more connections opened by the same application can cooperate with each other. Any locks acquired by the secondary connections are held as if they were acquired by the primary connection, and vice versa. Careful testing of your solution under high-load conditions can reveal deadlock issues early in development. Make sure testing is a part of your solution!
How do I support the Euro symbol () when using the SQL adapter?
Due to a limitation in SQLXML 3.0 SP3, the SQL adapter does not support some currency types when using updategrams. Updategrams will work for most currency types, but some currency types, such as the euro, will not work. The workaround is to use a stored procedure and pass money values as strings. To use a stored procedure in an updategram 1. Create a stored procedure to wrap the insert.
Create proc InsertTestTB @pID int, @pPrice varchar(50), @pSymbol char(10) As insert into TestTable(ItemID, ItemPrice) values(@pID, @pSymbol + @pPrice)
2. Create an updategram that calls the stored procedure with the appropriate arguments.
<ns0:InRoot xmlns:ns0="http://Test ">
The currency symbol is passed as an argument into the stored procedure, which then inserts the value correctly.
How do I use a table that has one or more spaces in its name with the SQL adapter?
BizTalk Server does not support using spaces in SQL table names used by the SQL adapter. If you have existing tables whose names contain spaces, you should use an alias for the table name. For example, the following query is not supported by the SQL adapter:
SELECT FROM * [My Table]
If you modify the query to use an alias, it will work with the SQL adapter:
SELECT FROM My_Table.* [My Table] as My_Table
Common Errors
The SQL Transport Schema Generation Wizard closes unexpectedly in BizTalk Server 2006
Problem In Microsoft BizTalk Server 2006, the SQL Transport Schema Generation Wizard closes unexpectedly when you try to generate a schema for an SQL adapter send port. You may also receive an error message that resembles the following: Failed to execute SQL Statement. Please ensure that the supplied syntax is correct. New transaction cannot enlist in the specified transaction coordinator. Cause This problem occurs if you try to generate a schema for one of the following updategrams to update a database table in Microsoft SQL Server 2005: Insert Update Delete
66
The problem occurs when the database table contains a column that has one of the following datatypes: varbinary(MAX) varchar(MAX) nvarchar(MAX) xml
These data types are not supported by the SQL adapter in BizTalk Server. Resolution These data types are new data types in SQL Server 2005. When the database table contains a column that has one of these data types, do not use the SQL adapter in BizTalk Server to insert data into the database table or to retrieve data from the database table. Consider writing a custom component to insert and retrieve data.
You get error "Invalid 'name' attribute value" when compiling your solution
Problem You receive a compilation error similar to the following when compiling your BizTalk Server solution:
67
"Invalid 'name' attribute value: The '' character, hexadecimal value <hexadecimal value>, cannot begin with a name. An error occurred at file:/<file location>.xsd. Cause This problem can occur if the SELECT statement or stored procedure encountered illegal characters, as described in the System.Xml.XmlConvert class, for import in the Add Adapter Wizard. Resolution To resolve this error, modify the table or column names listed in the SELECT statement or stored procedure defined in the Add Adapter Wizard so that they contain legal values as defined by the System.Xml.XmlConvert class. For more information about characters supported by the XmlConvert class, see XmlConvert Class.
68
To download CIM Studio and the other WMI tools, see WMI Administrative Tools in the Microsoft Download Center. To open CIM Studio and browse the BizTalk Server namespace 1. Click Start, point to Programs, point to WMI Tools and then click WMI CIM Studio. This opens an instance of Internet Explorer containing the CIM Studio tool. Depending upon your browser security settings, you may need to allow the execution of scripts. 2. When the Connect to Namespace dialog box appears, click Cancel. This dialog box appears only the first time you open CIM Studio. Any time thereafter that you want to browse to a WMI namespace, you can click the button with the computer icon to the right of the Classes in dialog box in the main Internet Explorer window. 3. Click the button with the computer icon to the right of the Classes in dialog box. 4. In the Browse for Namespace dialog box, in the Machine name box, type \\ and the name of the computer on which BizTalk Server is installed. The default is the local computer name. 5. In the Starting namespace box, type root\MicrosoftBizTalkServer, and then click Connect. 6. In the WMI CIM Studio Login dialog box, click Options to view the entire dialog box. 7. If the computer you are connecting to lists you as an administrator, you can leave the Login as current user check box selected. If you are not listed as an administrator, clear the Login as current user check box and enter an administrator user name and password in the appropriate fields. 8. In the Impersonation level box, verify that Impersonate is selected. 9. In the Authentication level box, verify that Packet is selected. Select the Enable all privileges check box only if you want to be able to change properties using CIM Studio. 10. Click OK to connect. If an Access Denied error appears, check your user name and password to make sure they are correct. 11. Click OK to accept the MicrosoftBizTalkServer namespace on the Browse For Namespace screen. 12. The CIM Studio window loads all the classes for the BizTalk Server WMI provider in the left frame. Explore the namespace by expanding elements. You will be primarily interested in the MSBTS_Service and MSBTS_BTSObject nodes in CIM_ManagedSystemElement\CIM_LogicalElement and the
69
MSBTS_Setting node in CIM_Setting\. For more information about the core BizTalk Server classes, see Core Server Classes. 13. To view host instance information, expand CIM_ManagedSystemElement\CIM_LogicalElement\MSBTS_Service and click MSBTS_Host. Now click Instances above the right frame that looks like a window with two frames. If you are unsure which button you are looking at, let the mouse cursor hover over the button and Instances should pop up. This lists each host instance for this BizTalk server. You can also use the WMI Query Language to filter data exposed by the BizTalk Server WMI Provider. By filtering data with a query, you can quickly identify messages, hosts, ports, and other configuration instances of interest and can avoid using Health and Activity Tracking (HAT). The WMI queries you develop using CIM Studio can also be copied directly into your code. For example, the following statement finds all message instances with a message type equal to "http://HelloWorld.POSchema#PO":
SELECT * FROM MSBTS_MessageInstance WHERE MessageType = 'http://HelloWorld.POSchema#PO'
This code can be copied to the following script that iterates through each instance, printing property names and values:
on error resume next for each item in GetObject("winmgmts://MyMachine/root/MicrosoftBizTalkServer").ExecQuery("SELECT * FROM MSBTS_MessageInstance WHERE MessageType = 'http://HelloWorld.POSchema#PO'" ) WScript.Echo item.name for each propSet in item.Properties_ WScript.Echo " " & propSet.Name & " = " & propSet.Value next next
You can also use CIM Studio to discover the properties and methods available for specific objects and to display enumerated numerical values and descriptions. To learn about this functionality and other advanced topics, see Windows Management Instrumentation.
70
These issues can be resolved by trying the following: Verify the SQL Server collation and use mixed-case parameter values as required. Ensure the WMI service is running. Verify that you are a member of the BizTalk Administrators group and that it has appropriate permissions to WMI. Use WMI Control to confirm that you have security permissions to access WMI and the namespace that you require. Validate that your method calls are using the proper number and types of parameters.
71
Troubleshooting BAM
Business Activity Monitoring (BAM) is a collection of tools that allow you to manage aggregations, alerts, and profiles to monitor relevant business metrics (called Key Performance Indicators, or KPIs). Errors can occur in any of the BAM tools or in the code that calls the BAM API.
Errors in retrieving, connecting, enumerating, or opening objects in the Primary Import or BizTalk Management databases
If your SQL server is offline, unreachable, has remote connections disabled, or is otherwise unavailable, you will receive one or more of the following errors depending upon what you activities you are performing: Error retrieving activities from Primary Import Table Database Error retrieving tracking profile from Primary Import Table Database Failed to connect to the Primary Import Table Database Failed to enumerate assemblies in the BizTalk Management Database Failed to enumerate databases on the {0} server Failed to enumerate ports in the BizTalk Management Database Failed to enumerate schemas in the BizTalk Management Database Failed to open the messaging property schema
Unable to connect to the BAM Primary Import Table Database to enumerate BAM Activity Definitions. Use Set Management Database from the Tools menu to point to a different location or contact your administrator if the problem persists
72
To resolve, verify the connection using the SQL Server client utilities and then confirm your findings with appropriate network administration personnel.
73
This tracking profile does not contain some actions to which milestones or data items are mapped or contains invalid or missing port mappings
This error occurs when the tracking profile contains a data item that must be tracked from a port but does not have a port associated with it. To resolve, go through all of your mappings and ensure that each one has a port associated with it.
There is no active tracking profile for this activity definition. Would you like to import this activity definition instead?
This error occurs when you try to import an activity definition from a tracking profile that has not been applied. It can also occur when, in an environment with two BizTalk groups and two BizTalk Management databases but only one Primary Import database, you apply the tracking profile to the first management database and then try to import the tracking profile from the second management database. To resolve, verify that you have applied the tracking profile and that you are pointing to the correct instance of the BizTalk Management database.
74
The Continuation {0} does not have a matching ContinuationID. The activity will not complete if there is no corresponding ContinuationID defined elsewhere You can ignore the warning and apply the tracking profile provided that your code supplies the matching Continuation or ContinuationID through the BAM APIs.
The Tracking Profile Editor cannot start the activity from the location from which you have selected the ActivityID or ContinuationID because of scope constraints. Please check your tracking profile
You can encounter this error in either of the following cases: When you attempt to track data from an invalid shape (Message Assignment, Transform, Group, Suspend, Loop, Branch, Terminate, Throw Exception, Catch Exception, While) or from an orchestration that contains an invalid shape. Your mapping is sufficiently complex that the TPE cannot determine where an activity begins or ends. To resolve this error, try one or both of the following: Use the BAM API and custom code to track the data. Rewrite and simplify the complex orchestrations. For example, use a nontransactional Scope shape instead of the Group shape or wrap a While shape in a non-transactional Scope shape.
75
To fix this problem, ensure that the file is still encoded as UTF-16 and not UTF-8. Text editors often convert UTF-16 encoded files into UTF-8 encoded files when saving them to disk. This will cause the profile to fail validation.
Why are the times for my tracking data in the BAM portal incorrect?
BAM captures milestones for objects derived from Microsoft.BizTalk.Bam.EventObservation.EventStream in Coordinated Universal Time (UTC) format. When you send date/times to BAM using the APIs, they are received in the format sent with no conversion to UTC format. If you use local time, the times will not be converted to UTC format and will be out of sequence relative to UTC times that are recorded. To solve this problem, modify your data to make it conform to UTC format.
76
77
Common Errors
You receive an error message when you try to apply a tracking profile to an x64-based computer in the Tracking Profile Editor
Problem
When you apply a tracking profile to a BizTalk server running on an x64-based computer you receive the error "Failed to apply the tracking profile" along with one or more of the following exception details: System.Runtime.InteropServices.COMException: The transaction has already been implicitly or explicitly committed or aborted Communication with the underlying transaction manager has failed. (System Transactions) Unhandled Exception: System.InvalidOperationException: The Promote method returned an invalid value for the distributed transaction.
Cause
This issue can occur if one or more of the following conditions are true: The Microsoft Distributed Transaction Coordinator (MSDTC) service cannot be initialized. This occurs if a lightweight remote procedure call (LRPC) association contains an incorrect Service Principal Name (SPN) in its authentication information structure because of the Winspool.drv file. The Tracking Profile Editor tries to use RPC to connect to the MSDTC transaction coordinator. When this occurs, the interface may perform additional security checks.
Resolution
When the Tracking Profile Editor tries to connect to the MSDTC on the local computer, the interface that is used may perform additional security checks. Depending on the operating system version and service packs that are installed on the computer, RPC may perform these additional security checks when the interface does not have a registered security callback. There are two potential resolutions: Use the Group Policy Object Editor to disable the RestrictRemoteClients setting that the RPC configuration enforces.
78
Use the Registry Editor to disable the RestrictRemoteClients setting that the RPC configuration enforces. For important security information and more information about how to perform these tasks, see KB article 919216.
You receive a "TDDS failed to read from source database" error message in the application log of a computer that is running BizTalk Server
Problem
You receive an error message that is similar to the following in the application log of a server that is running Microsoft BizTalk Server: Reading error. Exception information: TDDS failed to read from source database. SQLServer: SQLSERVER, Database: BizTalkMsgBoxDb. You may also receive one of the following errors in the Application event log: Either another TDDS is processing the same data or there is an orphaned session in SQL server holding TDDS lock. SQL Server: SQLSERVER Database: BizTalkMsgBoxDb Either another TDDS is processing the same data or there is an orphaned session in SQL server holding TDDS lock. Cannot open database requested in login 'Login'. Login fails Either another TDDS is processing the same data or there is an orphaned session in SQL server holding TDDS lock.The ConnectionString property has not been initialized. SQLServer: SQLSERVER, Database: BizTalkMsgBoxDb
Cause
You may receive this error message for the following reasons: The user account that is specified as the Logon for a BizTalk Host instance for which tracking is enabled is not a member of the BizTalk Application Users group on the SQL server that houses the Health and Activity Tracking, Business Activity Monitoring, and MessageBox databases. An orphaned SQL Session is preventing the Tracking Data Decode Service (TDDS), also known as the BAM Event Bus Service, from starting.
Resolution
To resolve this problem, check the text of the error description that immediately follows the error text. Depending upon the error description, follow these steps:
79
If the error text that appears is similar to the following error message:
EXECUTE permission denied on object 'TDDS_Lock', table 'xxx', owner 'xxx'. SQLServer: xxx, Database: xxx. Make sure that the user account that is specified as the Logon for a BizTalk Host instance for which tracking is enabled is a member of the BizTalk Application Users group on the SQL server that houses the Health and Activity Tracking, Business Activity Monitoring, and MessageBox databases. Also make sure no other BizTalk servers process the same tracking data from the same BizTalk MessageBox database. If the error text that appears is similar to the following error message: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. You need to check for and remove orphaned sessions. For more information about dealing with orphaned sessions, see Orphaned Sessions. For more information about this issue, see KB article 841334.
You receive "Error 7105" when BizTalk Services tries to read data in the BizTalk Messaging Management database or in the BizTalk MessageBox database
Problem
The following error is thrown when one of the BizTalk Services attempts to read from the Management or MessageBox databases: DESCRIPTION: Error: 7105, Severity: 22, State: 6 Page (1:3507395), slot 5 for text, ntext, or image node does not exist.
Cause
This problem is most frequently caused by inconsistencies and corruption in the SQL Server databases.
Resolution
To work around this problem, you can delete the corrupted object according to DBCC CHECKDB suggestions. The DBCC CHECKDB command examines the allocation and the structural integrity of all the objects in the specified database. For example, to check the current database from within the Query Analyzer tool, use the following command:
DBCC CHECKDB
80
This will check for inconsistencies in database structures as well as look for hardwarerelated events that may be contributing to the problem. Warning We recommend that you run the DBCC CHECKDB command when the load on the server is light. If you run the DBCC CHECKDB command during heavy use, expect a performance hit on the transaction throughput and on the DBCC CHECKDB completion time. For more information about the DBCC CHECKDB command, see DBCC CHECKDB in the SQL Server 2000 online documentation.
Troubleshooting BAS
Business Activity Services (BAS) Web services provide an interface that enables Microsoft Windows SharePoint Services and Office tools to perform the core Business Activity Services functions. Most of the functionality is exposed through a Web server, and so many of the issues you may encounter will be Web related.
Enabling Trace
You can enable trace for the following BAS components: TpPubWS, the trading partner publishing Web service TpMgmtWS, the BAS trading partner management Web service StsWebService, the BAS Windows SharePoint Services Web service StsHandlers, the BAS Windows SharePoint Web application StsWebParts, the BAS Windows SharePoint custom Web parts
This is done by modifying the web.config file for each component. For more information about BAS component tracing, see Enabling Tracing in BAS.
81
Why do I get the error message, 'Failed to post the SOAP request to the Web Service...' when I click Submit Profile?
You tried to access the BAS site on a local computer instead of from a server. Make sure the BAS URL includes http://<server name> instead of http://localhost.
Why do I get the error message, 'InfoPath cannot create a new, blank form. InfoPath cannot find or cannot access the following file: ...' when I try to create or edit a partner profile?
BAS uses your logged-in account or the Internet Explorer Run As account credentials to determine if you have access to the BAS site. You must use credentials for an account that belongs to a BAS Windows user group either to log on to the computer from which you are accessing the BAS site, or to open Internet Explorer with the account credentials. To open an Internet Explorer browser window with a BAS user's credentials, right-click an Internet Explorer shortcut icon on your desktop and then click Run As.
Troubleshooting Maps
This section provides troubleshooting strategies and problem detail and resolution information for maps.
Troubleshooting Strategies
Validate your map
This may sound obvious, but you should always validate your map at different points throughout its development. This will help identify design, logic, and schema problems early in the development cycle when it is easier to fix them or find an alternative solution. To validate a BizTalk map 1. In Solution Explorer, open the map that you want to validate. 2. In Solution Explorer, right-click the map, and then click Validate Map. 3. In the Output window, verify the results
82
Note When you validate a map, your test instance data is not checked to see if it violates any data types defined in the schemas. You can check the instance data when you test the map or validate the instance data in BizTalk Editor.
83
84
When your map has a Database Lookup or Value Extractor functoid that is not behaving as expected. To see the error message, temporarily map the functoid to a field in the output schema. If your application expects different message content when database operations fail. You can use the Error Return functoid to detect an error and map the error message to an alternate structure so that downstream applications can react in a controlled manner. To avoid errors that are detected only at run time, make sure that the parameter 1 to the Error Return functoid is the output of a Database Lookup functoid and not the output of any other functoid in the Database category. For more information about using the Error Return functoid (including a sample), see
Common Errors
You receive error event ID 324 when parsing dates
Problem
When you use the Database Value Extractor functoid in a map to extract a date field, your document may fail validation against the outbound document definition. BizTalk Server may log a validation error similar to the following in the event log: Event Source: BizTalk Server Event Category: Document Processing Event ID: 324 Description: An error occurred in BizTalk Server. Details: ------------------------------
85
The XML document has failed validation for the following reason: Error parsing '10/12/1995' as date datatype. Suspended Queue ID: "{A1127909-CA36-4359-B672-7CBA8B60BDAF}"
Cause
The date format (as it is returned from the data source) is not in ISO 8601 format, which is the format required by XML.
Resolution
To resolve this issue, do one of the following: Edit your outbound document definition to use a string datatype instead of a date datatype. Create a custom Microsoft Visual Basic Script functoid that will convert the output of the Database Value Extractor functoid into the ISO 8601 format. For more information, see KB article 278737.
Troubleshooting Orchestrations
Debugging orchestrations can be a complex undertaking. Orchestrations are often complex with many moving parts and external dependencies. To make matters worse, business logic is often located throughout an orchestration with business processes distributed across multiple orchestrations, potentially on many servers. This section explores different ways to troubleshoot your orchestrations and provides detailed advice for solving many common errors.
86
To configure tracking for an orchestration 1. Click Start, point to Programs, point to Microsoft BizTalk Server 2006, and then click BizTalk Server Administration. 2. In the console tree, expand BizTalk Server 2006 Administration, expand the BizTalk group, expand Applications, and then expand the application containing the orchestration for which you want to configure tracking. 3. Click Orchestrations, right-click the orchestration for which you want to configure tracking, and then click Properties. 4. Click the Tracking tab, select the tracking options you want, as described in the following table, and then click OK. Option Track Events - Orchestration start and end Description Select this check box to track the orchestration instance before and after processing of the entire business process. Orchestration tracking enables you to see the instances in the reporting views of Health and Activity Tracking. Select this check box to track message send and receive events. This check box is available only if you select the Orchestration start and end check box. Select this check box when you need to debug orchestration instances in the Orchestration Debugger. When this check box is selected, the event list in the Orchestration Debugger is populated. This check box is available only if you select the Orchestration start and end check box.
87
Description Select this check box to save and track the actual message content before processing by the orchestration instance. This check box is available only if you select the Message send and receive check box. Select this check box to save and track the actual message content after processing by the orchestration instance. This check box is available only if you select the Message send and receive check box. Select this check box to track message receive events. You must select this option to track incoming message bodies. Select this check box to track message send events. You must select this option to track outgoing message bodies.
88
3. In the search results, right-click an orchestration service instance and then click Orchestration Debugger. This brings up the Orchestration Debugger as shown below:
4. Individual actions are listed on each row. Click a row to see the corresponding shape. The shape will be green for start actions and blue for completion actions. 5. Clicking the final initialization action will highlight the path a message took through the orchestration. This can be useful when an orchestration has one or more decision shapes. 6. To switch to the Message Flow views, click Debug | Switch to Message Flow. On the Message Flow screen, click the Orchestration Debugger link at the top of the flow to return to the Orchestration Debugger view. When viewing an orchestration in the Orchestration Debugger, you will see its state at the last commit point. If you want to see the actual state of the orchestration, you must attach to it by first suspending the instance and then resuming debug mode. You can then attach to the instance and see its current state.
89
90
situation. 3. In the search results, right-click an orchestration service instance and then click Orchestration Debugger. 4. In Orchestration Debugger, right-click one of the shapes and then click Set Breakpoint on Class or press F9. A red circle appears in the upper-left corner of the shape when a breakpoint is set as shown in the following screenshot:
Note Breakpoints are not supported for some orchestration shapes. You will be unable to toggle breakpoints on such shapes. 5. The breakpoint will be active for all subsequent messages. Messages can only be resumed through human interaction using the Orchestration Debugger. Warning Class-level breakpoints should be used with caution in production
91
92
When you continue the orchestration, execution will stop when the breakpoint is reached for that instance only. No other instances will be affected. If you have multiple breakpoints in your orchestration, remember to refresh the display as each new breakpoint is reached after execution is resumed. To refresh the display, click File on the Orchestration Debugger menu and then click Refresh to update the Tracked Events and Orchestration panes. Note The Orchestration Debugger does not automatically refresh the display. You should refresh the display as each new breakpoint is reached or when you think another process may have changed the state of the orchestration instance you are working with.
93
orchestrations. 4. Right-click an orchestration service instance from the search results and then click Orchestration Debugger. 5. From the Orchestration Debugger, click Debug and choose Attach. Once attached, you can view orchestration variables, save messages, set instance-level breakpoints, and perform other debugging tasks.
94
The Orchestration Debugger consists of three panes that are always present and two optional panes that appear when attached to an orchestration instance: The Service pane displays the instance service name and GUID that uniquely identifies the orchestration instance, debug mode, orchestration state, whether the Orchestration Debugger is attached, and service options. The Tracked Events pane lists the status of every action performed in the orchestration, such as whether it started or completed. As you select each of the rows in this pane, the corresponding shape in the Orchestration pane appears highlighted in green when the shape starts and blue when the shape finishes. The Orchestration pane is where a visual representation of the orchestration is rendered with all of its shapes. The Variable List pane appears when attached to an orchestration instance and displays the name, value, and type of the variable. The value indicates if the variable is null or, if not, then what kind of object it contains. Type is the Assembly.Namespace.Name of the object. The Variable Properties pane appears when attached to an orchestration instance and displays properties for the variable that vary according to the type of
95
object. For example, for messages this includes Message Parts (including Name, Properties, Size, Type, and Value) and Message Properties (including Context, Name, PartCount, Scope, Type, and Value). You will likely focus on the Orchestration, Variable List, and Variable Properties panes when debugging orchestration instances. Using the Orchestration pane, you can determine how a message is flowing through an orchestration, while the Variable List and Variable Properties panes show current variables and their properties, values, and types. This is useful for debugging decision shape errors, determining what content is reaching a port, seeing the "before" and "after" messages in a transform operation, and other tasks.
96
Right-clicking the corresponding Call event in the Tracked Event pane and then clicking View Called Orchestration causees the Orchestration Debugger to load the called orchestration. In the above orchestration, notice that the title bar displays the instance's GUID as well as #0. This number represents the orchestration being called; the original orchestration is always #0. When the called orchestration is brought up, it will be #1 and so on. You can return to the calling orchestration by clicking Debug and choosing View Calling Orchestration in the Orchestration Debugger. This works recursively so if your original orchestration (#0) calls another orchestration (#1) that in turn calls another orchestration (#2), you would need to choose Debug | View Calling Orchestration twice.
97
then click Health and Activity Tracking. 2. On the HAT tool menu, click Queries, and then choose Most recent 100 service instances or one of the other query choices as appropriate to your situation. 3. In the search results, right-click an orchestration service instance that is in the Suspended (Resumable) state and then click Orchestration Debugger. 4. From the Orchestration Debugger, click Debug and choose Resume in Debug Mode. The Orchestration Debugger opens the orchestration instance in debug mode as if a breakpoint had been reached. 5. Debug the orchestration.
98
4. Click OK.
99
Setting a breakpoint on a compensation block. You can set breakpoints on the actions inside of the compensation block. Setting a breakpoint on a catch block. You can set breakpoints on the actions inside of the catch block. You should also be aware of the following considerations when using the Orchestration Debugger: If you track an orchestration modified without changing the version number, you must restart all the host instances to which the orchestration is enlisted. This ensures that any shape change in the newly deployed version displays correctly as you step through the Orchestration Debugger When you attach to an instance in the Orchestration Debugger, any atomic scopes in the orchestration instance will cause gaps to appear in the tracked events list. This happens because events for the shapes inside atomic transactions do not get persisted until the scope commits and because the debugger reloads events onto the end of the list, so any gaps remain unfilled during the live session. Note You can eliminate gaps in the tracked events list by refreshing the view. If you need to capture detailed information about program flow, variable contents, versions, and other diagnostics, you may want to use Debug and Trace statements as explained below.
100
Note You should not write sensitive or confidential data using the Trace or Debug class libraries. Doing so will enable anyone with access to the BizTalk server to potentially capture and examine sensitive or confidential data. To use Trace and DebugView to debug an orchestration 1. Using Visual Studio 2005, open an existing orchestration. If you would rather work with an SDK sample, try the HelloWorld project in the <installation directory>\Orchestrations SDK directory. 2. Create a new Expression shape below the activation shape in the orchestration. For example, in the HelloWorld orchestration the shape would be placed below the ReceivePO shape.
3. In the properties pane, set the Name of the Expression shape to "Trace_Entering". 4. Double-click the new activation shape and enter the following code in the
101
expression editor:
System.Diagnostics.Trace.WriteLine("Entering HelloOrchestration");
5. Deploy the application. If you are using the HelloWorld project and have not deployed it, run Setup.bat in the HelloWorld directory; otherwise choose Build | Deploy on the Visual Studio 2005 menu. Note Remember to restart the host when redeploying your BizTalk application. 6. Start DebugView. 7. Activate your orchestration. If you are using the HelloWorld sample, copy the file SamplePOInput.xml into the In directory. DebugView will capture the orchestration trace statement as well as diagnostic output from internal BizTalk Server components.
8. To save the captured events, click Save on the File menu, and then choose an appropriate directory and file name.
102
(containing the orchestration) and uses it in a trace statement. The information can also be written to the event log or used as part of other debugging code. The first step is to add the appropriate orchestration variable declarations:
executingAssembly assemblyName
of type System.Reflection.Assembly
assemblyVersion
After these variables have been declared, add the following code to an Expression shape in your orchestration:
executingAssembly = System.Reflection.Assembly.GetExecutingAssembly(); assemblyName = executingAssembly.GetName(); assemblyVersion = executingAssembly.Version.ToString(); System.Diagnosics.Trace.WriteLine("Assembly " + assemblyName + " version: " + assemblyVersion);
The assembly version will be sent to active trace and debug listeners for capture and study.
of type string
of type System.Xml.XmlDocument
After these variables have been declared, add the following code to an Expression shape in your orchestration:
xmlMessage = myMessage; stringMessage = xmlMessage.OuterXml; System.Diagnostics.Trace.WriteLine(stringMessage);
When the orchestration is compiled and deployed, the XML contents of myMessage will be sent to active trace and debug listeners for capture and study.
103
You want to access application messages in a standard way using tools supplied by Windows. You want to archive information with other messages from the server environment for a more complete history. You want the ability to monitor your application using tools that interact with the event log.
If you are using a custom log, you should use the SourceExists method to ensure it exists before you write to it.
However, you should not assume that your code will be run under an account that has the security privileges to create a new event log. Creating an event log takes administrator privileges and should be done in a separate utility program or, ideally, as part of an .msi installation. For more information about using custom script with an exported .msi installation, see Using Pre- and Post-processing Scripts to Customize Application Deployment.
104
Why is my orchestration instance suspended with the status "Complete with Discarded Message"?
An orchestration ends with a status of Complete with Discarded Message when a new message is dispatched to the orchestration instance at the exact time a time-out from a Delay shape or scope time-out property occurs. Orchestrations in this state are also known as zombies. Zombie can result when your solution uses any of the following: Terminate control messages. This scenario uses a protocol that allows for a control message to be sent that cancels all currently running work in a specific orchestration instance. Human workflow-related designs tend to rely on this mechanism and typically want to terminate. Parallel listen receives. In this scenario the protocol waits for 1 of n messages before performing work on the collected messages and terminating. If a message is correlated, it is possible to terminate as a message is being received for a different branch of the parallel listen. Sequential convoys with non-deterministic endpoints. This scenario relies on a master schedule to handle all messages of a certain type in order to meet one or more protocol requirements. Typical examples include ordered delivery, resource dispensing, and batching. These are characterized by a while loop surrounding a listen with one branch having a Receive shape and the other having a Delay shape followed by a mechanism that sets a flag indicating when the loop should stop. This is non-deterministic and susceptible to creating zombies because a message could be delivered while the delay is triggered.
105
A recommended solution is to use WMI to listen for suspend events, and then find the message associated with the orchestration instance and resubmit it. To accomplish this, we can modify the script supplied in the topic Removing Zombie Orchestration Instances to save and terminate message instances that were not consumed by an instance. The resulting script is shown below with changes noted.
' 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. ' ' Impersonate the user account running the script to connect to BizTalk WMI objects. ' Set objWMIServices = GetObject("WinMgmts:{impersonationLevel=impersonate, (security)}\\.\root\MicrosoftBizTalkServer") ' Create the event sink object that receives the service instance suspended events. ' Set sinkSuspInst = WScript.CreateObject("WbemScripting.SWbemSink","SINK_INST_") objWMIServices.ExecNotificationQueryAsync sinkSuspInst, "select * from MSBTS_ServiceInstanceSuspendedEvent" ' Wait for the events to fire. ' while(true) WScript.Echo "Waiting for suspended service event..." WScript.Sleep(1000) wend ' Event handler subroutine for suspendend service event. ' Sub SINK_INST_OnObjectReady(objObject, objAsyncContext) On Error Resume Next Dim unconsumedMessageInstanceSet, objWMIServices, serviceInstanceSet ' Impersonate the user account running the script to connect to BizTalk WMI objects. ' Set objWMIServices = GetObject("WinMgmts:{impersonationLevel=impersonate, (security)}\\.\root\MicrosoftBizTalkServer") If Err <> 0 Then PrintWMIErrorThenExit Err.Description, Err.Number End If WScript.Echo WScript.Echo WScript.Echo Wscript.Echo ("") ("Entering the event handler for suspendend service instances.") ("Service instance id: " & objObject.InstanceID) ("Service status: " & objObject.ServiceStatus)
106
' Check if the service completed with unconsumed messages, status code 4. ' If not exit the event handler subroutine. ' if objObject.ServiceStatus <> 4 then WScript.Echo ("The service instance was not in the Compelted with un-consumed messages state.") WScript.Echo ("Service instance not terminated.") Exit Sub end if ' Search for message instances that were not consumed by the service instance. ' WScript.Echo("Searching for message instances not consumed by the service instance.") Query = "Select * from MSBTS_MessageInstance where ReferenceType = 8 and ServiceInstanceID =""" & objObject.InstanceID & """" WScript.Echo (Query) Set unconsumedMessageInstanceSet = objWMIServices.ExecQuery(Query) If Err <> 0Then WScript.Echo ("Query failed.") PrintWMIErrorThenExit Err.Description, Err.Number Exit Sub End If ' Exit the event handler subroutine if there were no unconsumed messages. ' if (unconsumedMessageInstanceSet.Count = 0) then WScript.Echo ("No unconsumed messages.") WScript.Echo ("Service instance not terminated.") Exit Sub end if ' (*) Removed message instance count; the loop below removes only ' specific message types so we don't care if there are multiples ' Loop over the set of unconsumed messages. ' The set should contain exactly one message instance at this point. ' For each messageInstance in unconsumedMessageInstanceSet ' ' If the message type is not http://YourSchema#YourRoot, move on to the next one. You should change messagetype to your type. ' ' (*) Modified to check for a specific message type and only process if ' a match is made. If (messageInstance.MessageType = "http://YourSchema#YourRoot") then ' Search for the service instance that needs to be terminated. ' WScript.Echo ("Querying for the service instance to be terminated.")
107 Query = "Select * from MSBTS_ServiceInstance where InstanceID = """ & objObject.InstanceID& """" WScript.Echo (Query) Set serviceInstanceSet = objWMIServices.ExecQuery(Query) If Err <> 0 Then PrintWMIErrorThenExit Err.Description, Err.Number Exit Sub End If ' Loop over the service instances found. ' Save each instance to file ' Call Terminate method on the service instance. ' For each serviceInstance in serviceInstanceSet serviceInstance.InvokeMethod "SaveToFile", "c:\" If Err <> 0 Then PrintWMIErrorThenExit Err.Description, Err.Number Else WScript.Echo "Service instance saved successfully." WScript.Echo ("Terminating instance "+ serviceInstance.InstanceID) serviceInstance.Terminate() If Err <> 0 Then PrintWMIErrorThenExit Err.Description, Err.Number else WScript.Echo "Service instance terminated successfully." End If End If Next End If Next End Sub ' ' Subroutine for displaying WMI errors. ' Sub PrintWMIErrorThenExit(strErrDesc, ErrNum) On Error Resume Next DimobjWMIError Set objWMIError = CreateObject("WbemScripting.SwbemLastError") If (TypeName(objWMIError) = "Empty") Then wscript.echo strErrDesc & " (HRESULT: "& Hex(ErrNum) & ")." Else wscript.echo objWMIError.Description & "(HRESULT: " & Hex(ErrNum) & ")." Set objWMIError= nothing End If End Sub
108
109
non-serializable object in a non-atomic scope); you can see part of the PersistenceException.
To avoid this error in a production environment, be sure to test all orchestrations and review the Application log for errors and other issues.
110
To use this class outside of non-atomic scope, you must remove the IDisposable interface along with explicitly implemented methods.
111
If you are using RetryTransactionException you can override the two-second default delay between consecutive retries by setting a different value for the DelayFor property. For more information, see RetryTransactionException.DelayFor Property. Note All variables will be reset when RetryTransactionException is thrown in an atomic scope.
112
Why do I get intermittent subscription errors when sending to a child orchestration that was just started by the parent?
The subscription error "could not find subscription" is a result of a race condition. A race condition occurs when the outcome of a process depends on the particular order in which the process takes place. In this case, the condition occurs when the child orchestration has not been started in time to receive the message sent by the parent. To avoid this problem, the child orchestration could send a message back to the parent when it has been started and is prepared to receive a message. In this way, the parent orchestration that started it would know that there is a receiver before sending a message.
However, to access promoted properties from the XLANGMessage interface in your code you have to use XLANGMessage:
// msg is an XLANGMessage object myID = msg.GetPropertyValue(typeof(BTS.MessageID)); msg.SetPropertyValue(typeof(MySchema.State)) = "TX";
Why do I get errors when I attach a dynamic send port to a logical port?
A dynamic port is not designed to inherit all of the attributes and characteristics of the port assigned to it. A dynamic port gets an address only; it does not inherit the other information associated with the logical port. For example, if you attach a dynamic send port to a logical port with Delivery Notification = Transmitted, the runtime will not deliver a delivery notification. The XLANGs runtime only listens for a delivery notification if the port has actually been set up that way statically. Note In XLANGs, ports will behave only as they have been configured statically.
Why aren't updates made to message fields inside an Expression shape showing up on the message I send out?
Messages are immutable in BizTalk Server. If you want to modify a message, you must use a Construct shape to create a new message, copy the original message to the new message, and then update the fields on the new message. In the following sample Construct shape code, a new message is created from an existing message and the Price field is updated:
// originalMsg and newMsg have been declared in the orchestration ewMsg = originalMsg; newMsg.Price = newMsg.Price + 1.00;
114
How can I retry a send when an exception occurs when calling a Web service with the SOAP sending adapter?
If you have a scenario in which an orchestration calls a Web service with the SOAP sending adapter and needs to retry if an exception occurs and suspends the orchestration as "Suspended (Not Resumable)", you can place the SOAP send inside a scope with an exception handler and let the exception handler catch the resulting SoapException. You can then retry the SOAP send by nesting the scope inside a while loop.
115
How can an orchestration be updated without bringing down the BizTalk Host?
It is possible to deploy an updated orchestration to your test or production environment without bringing down the host by updating the version number of the project containing the orchestration. After it is deployed, you can unenlist the original orchestration and then start the new orchestration. This can be useful when testing orchestrations that you are troubleshooting with inline debug code. For more information about updating BizTalk applications, see Updating BizTalk Applications.
116
ACK/NACK occurs at the end of the atomic scope's enclosing scope (for example, you do not get the delivery failure exception until all shapes in the enclosing scope have executed).
When I try to run my application after deploying an orchestration with custom components, why do I get the error "File or Assembly name or one of its dependencies not found"?
This error usually means the BizTalk orchestration engine cannot locate the custom component. You must install all assemblies included in a BizTalk application in the global assembly cache of the computer that hosts the application.
Common Errors
A "WrongBodyPartException" occurs when handling a multipart MIME message in an orchestration
Problem Receiving a multipart MIME message into an orchestration results in a WrongBodyPartException exception. Cause This error can occur if the order of the parts is specified incorrectly or messages do not conform to the part positions you have specified. For example, if you specify that the third part is a body part but messages arrive with a header part in the third position. Resolution Verify that the body part index setting is correct and then ensure that all messages arriving through the adapter are consistent with the setting. You can inspect the contents of MIME messages that fail inside an orchestration by stopping the orchestration (but keeping it enlisted); this will force the message to be published so you can examine it using the Administration console and verify the order of the parts.
117
The type or namespace name 'X' does not exist in the namespace 'Y' (are you missing an assembly reference?) Cause Any of the following could be the cause of this error. Your project does not reference one or more required assemblies. Your project has a map or other object type that has the same name as the project. Your project uses XML Schema definition language (XSD)-based Partner Interface Process (PIP) schemas and contains XSD schemas in a subfolder that is named System. Your project is using a Global Property whose namespace is a subset of the current project's namespace. For example, using the Global Property namespace "File.ReceivedFileName" in an orchestration contained in the project "Accounts.FILE". Resolution Depending upon the cause of the problem, the resolution could be any of the following: Add a reference to the missing assemblies your project requires. Change the name of the map or other object to something other than the project name. This can typically be done through the object's property page (for example, the Map property page contains a Name property). Change the namespace for the schemas in Visual Studio. To do this using Visual Studio, click Show All Files on the Project menu, and then expand the System node in Solution Explorer. Click each file in the System folder and in any subfolders, and then change the namespace entry in the Properties window so that any occurrence of System becomes _System. For example, change the MyProject.System.SubFolder namespace to the MyProject._System.Subfolder namespace. For more information about this issue, see KB article 916649. Remove the conflicting Global Property namespace from the project. Identifier 'X' does not exist in 'Y'; are you missing an assembly reference?
118
Cause There is a limitation in Windows 2000 that prevents BizTalk Server from allowing long properties to be promoted and manipulated. Resolution Deploy the solution onto a computer running Windows XP or Windows Server 2003. If you will be deploying to Windows 2000, change the property to another type.
An "AssemblyName context property was not valid" error occurs when submitting a document to a Web service via an orchestration
Problem Submitting a document to a Web service via an orchestration results in an "AssemblyName context property not valid" error. Cause The BizTalk application was originally designed using a "messaging" approach without an intervening orchestration. This type of solution uses a send port filter to link the receive port and the send port so that the document is passed through to the send port upon receipt. Later, the solution was modified to include an orchestration that was bound to the send port. Resolution Remove the filter on the send port. If you apply a filter to a send port that is bound to an orchestration, messages will often bypass the orchestration and cause the context property error.
You receive a "Message has not been initialized in construct statement" error when building your project
Problem When you compile your BizTalk application, you get the error "Message has not been initialized in construct statement". Cause When you construct a message, you specify all the message variables. Then you make assignments to the message or its parts. If part of a specific message assignment is included in a separate Construct Message shape, you may receive the initialization error message.
119
Resolution To resolve this behavior, make sure that you include all parts of a specific message assignment in the same Construct Message shape. For a related support issue, see KB article 870606. You can also resolve this behavior by creating your message in a Construct shape before using an instance of it in an Expression shape. For example, the following code will cause an error if placed in an Expression shape:
XMLDOM = new System.Xml.XmlDocument(); POAckMsg = XMLDOM;
To fix, create the instance of XMLDOM in a Construct shape, and then do the assignment in a downstream Expression shape.
You receive a "use of unconstructed message" error when building your project
Problem When you compile your BizTalk project, you receive the error "use of unconstructed message '<message>'". Cause This error occurs when an unconstructed message is used in a Send shape. Resolution To resolve this issue, add a Construct Message shape to the orchestration. Include the Construct Message shape before the Send shape that is bound to the Web service. For more information about this error and Web services, see KB article 921043.
120
Resolution You can resolve this problem by ensuring that your code retrieves only message parts that are within the range expected from the message source. In the case of a parsing issue, you should verify that the original MIME message is structurally sound and properly constructed. If you expect occasional parsing problems, ensure that your orchestration has appropriate exception handlers.
Project build results in the error "you must specify at least one already-initialized correlation set for a non-activation receive that is on a non-selfcorrelating port"
Problem When you compile your BizTalk project, you receive the error "you must specify at least one already-initialized correlation set for a non-activation receive that is on a nonselfcorrelating port". Cause This error can occur if your orchestration has no activating Receive shapes (Activate = true) or has no activating Receive shapes and is not called directly by another orchestration. Resolution If your orchestration is not called by another orchestration, you must configure one of the Receive shapes to be an activated receive. For more information about configuring the Receive shape, including links to correlation, see How To Configure the Receive Shape.
121
You receive the error "Assembly generation failed -- Referenced assembly '<assembly>' does not have a strong name" when building your solution
Problem You receive the error "Assembly generation failed -- Referenced assembly '<assembly>' does not have a strong name" when building your solution that has an orchestration. Cause This problem occurs when a type from an unsigned referenced assembly is used within an orchestration. Resolution Apply a strong name to the referenced assembly. If it is a custom assembly that you can recompile, use the strong name tool to create an .snk (key) file and then reference that key file in the assembly properties for the project. For more information about strong naming an assembly, see How .
You receive an "invalid property value" error when compiling your orchestration
Problem You receive the error dialog "Invalid property value" when building your orchestration. Cause One or more of the objects in your solution has the same name as another object. For example, a message name is the same as a port name. Resolution Ensure that every object in your solution has a unique name. You can minimize the risk of this error by adhering to a naming convention.
See Also
Troubleshooting Pipelines
Problems with pipelines can usually be traced back to issues with the configuration of individual components or, for custom-built components, specific programming logic. This section offers advice on how to identify and resolve common pipeline issues.
122
The first problem occurs when the number of components required per stage is less than the number of components in the stage. The second problem occurs when the execution
123
mode value defined for some stage in the policy file is None; only FirstMatch and All are allowed. To fix these errors, you must edit your custom policy file to include the proper values. For example, in the configuration below the number of components per stage must be adjusted:
<?xml version="1.0" encoding="utf-8"?> <Document xmlns:xsd="" xmlns:xsi="" CategoryId="" FriendlyName=""> <Stages> <Stage Name="Decode" minOccurs="5" maxOccurs="10" execMethod="All"></Stage> </Stages> </Document>
The Stage element attribute minOccurs must be changed to "1" as shown below.
<?xml version="1.0" encoding="utf-8"?> <Document xmlns:xsd="" xmlns:xsi="" CategoryId="" FriendlyName=""> <Stages> <Stage Name="Decode" minOccurs="1" maxOccurs="10" execMethod="All"></Stage> </Stages> </Document>
Why am I receiving parsing and validation errors in my receive pipeline when using my custom disassembler pipeline component?
When writing a custom disassembler pipeline component you should always: Read from the incoming data stream until no more bytes are read. Reset the data stream pointer to the start of the stream.
Failure to read all of the data in the incoming data stream could cause your component to process the data incorrectly or miss important data. If you fail to reset the data stream
124
pointer, the next component in the pipeline receives what appears to be an empty (or incomplete) stream. For example, this code illustrates logic to use the Seek method to point to the beginning of the stream before returning the stream:
myDataStream.Seek(0, SeekOrigin.Begin); return myDataStream;
Troubleshooting Schemas
This section offers advice on how to identify and resolve common schema issues.
125
Common Errors
You receive error 'Namespace:Element1 cannot be a member of substitution group with head element Namespace:Element2' when compiling your solution
Problem
You receive the error 'Namespace:Element1 cannot be a member of substitution group with head element Namespace:Element2' when compiling your BizTalk Server 2006 solution.
Cause
This issue occurs if the schema contains the substitutionGroup element. This primarily affects EAN, UCC, and EDI schemas.
Resolution
Modify the schema so that the schema does not contain the substitutionGroup element. If required, implement similar functionality directly in the XSLT by using a custom functoid or custom script.
You cant remove all data related with Cross-Referencing from the BizTalk Server database
Problem
When you delete all of the information related through cross-referencing from the BizTalk Server database, you receive an error.
Cause
The xref_IDXREF and xref_ValueXRef tables must have at least one empty row.
Solution
Insert one blank row into the xref_IDXREF and xref_ValueXRef tables using the following SQL script:
use BizTalkMgmtDb; set IDENTITY_INSERT xref_IDXRef ON insert xref_IDXRef (idXRefID, idXRef) values (1, '')
126 set IDENTITY_INSERT xref_IDXRef OFF set IDENTITY_INSERT xref_ValueXRef ON insert xref_ValueXRef (valueXRefID, valueXRefName) values (1, '') set IDENTITY_INSERT xref_ValueXRef OFF
General Troubleshooting
Enabling Web Services Publishing Wizard tracing
You can enable tracing to debug the BizTalk Web Services Publishing Wizard by uncommenting the <add> node in the BTSWebSvcWiz.exe.config file. For more information about obtaining trace information from the Web Services Publishing Wizard, see
127
Warning The inner exception may contain sensitive information. After debugging, you should set the ThrowDetailedError switch to False.
Using .NET Framework tracing to capture and log errors in the Web service
The .NET Framework System.Diagnostics.Trace class can be used to capture and write errors to a text file. To use the System.Diagnostics.Trace class to capture and write errors to a text file 1. Update the web.config file for the Web service to set the TRACE compiler directive to true and add a TraceSwitch value:
<?xml version="1.0"?> <configuration> <system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs" compilerOptions="/d:TRACE" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="1" /> </compilers> </system.codedom> <system.diagnostics> <switches> <add name="WebSvcTraceSwitch" value="2" /> <!-- Set to 0, 1, 2, 3, or 4, which corresponds to TraceLevel.Off, TraceLevel.Error, TraceLevel.Warning TraceLevel.Info, and TraceLevel.Verbose. --> </switches> </system.diagnostics> </configuration>
Note If the TRACE compiler directive is not set to true then no trace output will be generated. The TraceSwitch value can also be set in the calling class but is set here in the web.config file for convenience. Set the TraceSwitch value to the appropriate level for development purposes and change the value after development is complete to reduce or inhibit trace output. 2. Create an instance of the TraceSwitch and TextWriterTraceListener
128
classes and use a trycatch block in the Web service [WebMethod] call to trap and write errors to a trace output file. For example, the following code traps an error that is generated when attempting to set the integer variable s2 to a null instance of the object variable o2:
using using using using using System; System.Web; System.Web.Services; System.Web.Services.Protocols; System.Diagnostics;
[WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class Service : System.Web.Services.WebService { TraceSwitch WebSvcTraceSwitch = new TraceSwitch("WebSvcTraceSwitch", "Web Service Trace"); TextWriterTraceListener TestTracer = new TextWriterTraceListener("C:\\traceout.txt"); // Note that by default the local ASPNET account(IIS 5.x) or the // local NETWORK SERVICE account(IIS 6.0) needs write access to // this directory so that the instance of the // TextWriterTraceListener can write to the trace output file. ); public Service () { } [WebMethod] public string HelloWorld() { string h2 = "Hello World"; //object o2 = 1; object o2 = null; try { int s2 = (int)o2; //Error if o2 set to null return h2; } catch(Exception e) { Trace.Listeners.Add(TestTracer); Trace.WriteLineIf(WebSvcTraceSwitch.Level = TraceLevel.Warning,"Exception caught: " + e.Message); //Writes to the trace file if specified TraceLevel switch value (in web.config) >= 2 TestTracer.Dispose(); return "An error occurred in the Web service, please contact the web server administrator."; } }
129 }
Note This code is a modified version of the HelloWorld Web service that is generated by default when you create a new ASP.Net Web Service project in Visual Studio 2005. 3. Rebuild the Web service project. Now, if an error occurs in the Try statement the exception is handled in the Catch statement and an error is written to the trace output file.
I am receiving errors when consuming a Web service; how can I avoid them?
There are many details to consider when consuming a Web service, including the following: Avoid using two underscore characters in a parameter name. Use of the any element or the anyAttribute attribute is not supported in Web methods. Avoid using XLANG/s keywords as a Web service name or Web method name. Avoid using Web method parameter types that are not supported by XLANG/s.
Do not use element names that are C# keywords or will be invalid as a C# identifier in your schemas. Avoid Web Services Description Language (WSDL) files with multiple service or port type definitions. Web method parameters must be Xml Serializable. Avoid references to consumed Web services that contain multi-rooted schemas.
Avoid referencing Web services with Web methods expecting generic-based parameters such as nullable parameters. The WSDL import element is not supported. For more information about these and related considerations, see Considerations When Consuming Web Services.
130
Why am I getting errors publishing my schema that uses the <include> element?
Schemas cannot be published if they include circular references (the included schema has an include element to the including schema) or have an unresolved schemaLocation attribute. For more information about the limitation of the include element, see Include Element Binding Support. The Web Services Publishing Wizard has the same limitations as XSD.exe in .NET Framework 2.0; for more information, see Import Element Binding Support.
Clients of published Web services may not receive server script time-out errors
If Web clients that use .NET Framework 2.0 are calling a Web service generated with the BizTalk Server 2006 Web Services Publishing Wizard, it is possible that the client cannot receive server script time-out errors because the client request time-out occurs first by default. To resolve this problem you can do one of the following: Increase the client request time-out to a value greater than the server script timeout by increasing the value for the HttpWebRequest.Timeout property on the client. Reduce the server script time-out to a value less than the client request time-out by reducing the value for the HttpServerUtility.ScriptTimeout property on the server.
131
Common Errors
You receive 'Type messagename cannot be found in namespace servicename' error using the WSE adapter.
Problem
In some scenarios, the BizTalk Adapter for WSE Schema Generation Wizard may not generate an XML Schema definition language (XSD) schema or an orchestration as expected.
Cause
The wizard has a problem in the way it generates schemas and orchestrations.
Resolution
Obtain the Microsoft BizTalk Adapter for Web Services Enhancements (WSE) 2.0 Service Pack 2006 update. In addition to the problem stated above, it addresses the following issues: The BizTalk Adapter for WSE 2.0 now supports long schema names. Before you install this service pack, the BizTalk Adapter for WSE 2.0 uses the target namespace for the schema as the file name. Therefore, some Web services may not be usable because of long file names. After you install this service pack, the BizTalk Adapter for WSE 2.0 creates shorter file names that are unique. The BizTalk Adapter for WSE 2.0 now imports schemas correctly. This includes schemas that include the schemaLocation attribute. The BizTalk Adapter for WSE 2.0 now propagates information correctly if the response pipeline fails in solicit-response operations. The BizTalk Adapter for WSE 2.0 now returns an exception error message correctly when a pipeline failure occurs or when an unhandled pipeline exception occurs. The BizTalk Adapter for WSE 2.0 now follows the policy when a message is signed. For more information about the update, see KB article 916927.
132
Cause
This error can occur if ASP.NET is not installed and/or enabled on the IIS server that hosts the Web service.
Resolution
Ensure that ASP.NET is installed and enabled. Install the .NET Framework if it is not installed and/or run the aspnet_regiis.exe program located in the %WinDir %\Microsoft.NET\Framework\vXXX.XXX\ folder of the IIS server.
Cause
This error can occur if either of the following conditions is true: The worker process does not have permissions to read to the process Temp directory, and the worker process does not have permissions to write to the process Temp directory. There are compilation errors in the code that XmlSerializer generated.
Resolution
This error is documented in Microsoft Knowledge Base article 823196. Follow the steps in the Resolution section of this Knowledge Base article to resolve this error.