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



The information in this article applies to:

  • Microsoft BizTalk Server 2000

This article was previously published under Q278737

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

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.

    -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 the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site: For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:

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.

Modification Type:MajorLast Reviewed:6/23/2005
Keywords:kbdownload kbdownload kbfile kbgraphxlinkcritical kbpending kbprb KB278737 kbAudDeveloper