© 2004 Microsoft Corporation. All rights reserved.
Figure 1 Creating a Virtual Directory

Figure 1 Creating a Virtual Directory
Figure 2 Browser Query

Figure 2 Browser Query
Figure 3 BizTalk Editor

Figure 3 BizTalk Editor
Figure 4 BizTalk Mapper

Figure 4 BizTalk Mapper
Figure 9 Orchestration Designer

Figure 9 Orchestration Designer
Figure 11 SendUpdateGram Method from MUtilities.bas
Public Function SendUpdateGram(sURL As String, Optional sXMLFileName _
    As String = "", Optional oDOM As MSXML2.IXMLDOMDocument = Nothing) _
    As String
    'Dim xmlHttp As New MSXML2.XMLHTTP30
    Dim xmlHttp As New MSXML2.ServerXMLHTTP30

    Dim sErrorString As String
    Dim oDOMError As MSXML2.IXMLDOMDocument
    Dim oDOMGram As MSXML2.IXMLDOMDocument
    Dim sDebugInfo As String
    Dim iCodeMark As Integer
    Dim fso As New FileSystemObject
        
Const sMETHOD_NAME As String = "SendUpdateGram"
    
On Error GoTo Error_Handler

    If (oDOM Is Nothing) Then
        If (sXMLFileName <> "") Then
            If (fso.FileExists(sXMLFileName)) Then
                Set oDOMGram = GetDOMFromFile(sXMLFileName)
            Else
                Call Err.Raise(eERR_NO_DOCUMENT_EXISTS, msCLASS_NAME, _
                               "XML File Not Found")
            End If
        Else
            Call Err.Raise(eERR_FILE_PATHNAME_NOT_SPECIFIED, _
                           msCLASS_NAME, "File Path Not Specified.")
        End If
    Else
        Set oDOMGram = oDOM
    End If
    
    ' Post the template.
    ' THE NEXT THREE LINES ARE THE CODE THAT POSTS THE TABLE-SPECIFIC 
    ' CONTRACT DATA TO THE APPROPRIATE TABLE
    xmlHttp.Open "POST", sURL, False
    'xmlHttp.setRequestHeader "Content-type", "application/xml"
    xmlHttp.send oDOMGram
    
    'now determine if the response was an error, and if so 
    'raise the error and do something with it
    If InStr(1, xmlHttp.responseText, "MSSQLError") Then
        'for debugging only, can eventually raise the entire 
        ' xmlHttp.responseText
        Set oDOMError = GetDOMFromString(LCase(xmlHttp.responseText))
        sErrorString = oDOMError.selectSingleNode(".//root").xml
        Call Err.Raise(eERR_INVALID_UPDATE_GRAM, msCLASS_NAME, _
                       sErrorString)
    ElseIf InStr(1, xmlHttp.responseText, "ERROR") Then
        Call Err.Raise(eERR_INVALID_XML, msCLASS_NAME, _
                       xmlHttp.responseText)
    End If
        
    'send back response either way
    SendUpdateGram = xmlHttp.responseText

Error_Handler:
    Set oDOMGram = Nothing
    Set oDOMError = Nothing
    
    If Err.Number <> 0 Then
        Call HandleError(True)
    End If
    
End Function

Home
Current Issue
Topics
Issues
Columns
Downloads
Subscribe
Contact Us

MSDN Magazine