Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Document Fails Validation on Date Field after Being Mapped Using Database Value Extractor Functoid


View products that this article applies to.

Symptoms

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 the following validation error in the event log:
Event Source: BizTalk Server
Event Category: Document Processing
Event ID: 324
Description:
An error occurred in BizTalk Server.

Details:
------------------------------
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}"

↑ Back to the top


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.

↑ Back to the top


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.

    -or-

  • Create a custom Visual Basic Script functoid that will convert the output of the Database Value Extractor into the ISO 8601 format.
Use the following sample code from the Date Functoid to convert the date:
Function FctConvertDate(DateIn)
Dim dt
Dim y
Dim m
Dim d

dt = DateIn
y = CStr(Year(dt))
m = CStr(Month(dt))
d = CStr(Day(dt))

If Len(m) = 1 Then
     m = "0" & m
End If
If Len(d) = 1 Then
     d = "0" & d
End If

'ISO 8601 format
FctConvertDate = CStr(Year(dt)) & "-" & m & "-" & d
End Function
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs.
If you have limited programming experience, you may want to contact a Microsoft Certified Partner or Microsoft Advisory Services. For more information, visit these Microsoft Web sites:

Microsoft Certified Partners - https://partner.microsoft.com/global/30000104

Microsoft Advisory Services - http://support.microsoft.com/gp/advisoryservice

For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

↑ Back to the top


More information

The following file is available for download from the Microsoft Download Center:
Map.exe is an example BizTalk map that makes use of the scriptor contained in the "Resolution" section of this article.

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

↑ Back to the top


Keywords: KB278737, kbprb, kbpending, kbgraphxlinkcritical, kbfile, kbdownload, kbdownload

↑ Back to the top

Article Info
Article ID : 278737
Revision : 9
Created on : 11/23/2006
Published on : 11/23/2006
Exists online : False
Views : 332