Sub SendReportRequest() 'Test of Report Request and result. 'Job number comes from the "File Path" text box as XDN:MRN(CR) 'This code is common for all commands: Dim XOA As EMsgAPIReport200810.XOA = New EMsgAPIReport200810.XOA Dim request As EMsgAPIReport200810.Request = New EMsgAPIReport200810.Request Dim authentication As EMsgAPIReport200810.Authentication = New EMsgAPIReport200810.Authentication Dim xddsauth As EMsgAPIReport200810.XDDSAuthType = New EMsgAPIReport200810.XDDSAuthType ' Set the URL XOA.Url = GetRequestUrl() ' Build the SOAP Header xddsauth.RequesterID = API_Demo.txtUserID.Text 'UID xddsauth.Password = API_Demo.txtPassword.Text 'Password authentication.XDDSAuth = xddsauth request.Authentication = authentication request.ReceiverKey = GetRequestUrl() request.ResultRequired = EMsgAPIReport200810.RequiredType.yes request.RequestID = "Test User" XOA.RequestValue = request If API_Demo.chkUseProxyTrace.Checked Then XOA.Proxy = New System.Net.WebProxy("http://localhost:8080") End If Dim CustomerReference As New EMsgAPIReport200810.EncodableStringType CustomerReference.Value = "XOA MessageREACH Job" 'Specific code for this command: Dim myReportResult As New EMsgAPIReport200810.ReportResult Dim myReportRequest As New EMsgAPIReport200810.ReportRequest Dim myJobId As EMsgAPIReport200810.JobIdType = New EMsgAPIReport200810.JobIdType Dim i As Integer Dim nLocColon As Integer Dim sTemp As String = API_Demo.txtRelativePath.Text.Trim If sTemp.Length <> 0 Then sTemp = API_Demo.txtRelativePath.Lines(i) nLocColon = sTemp.IndexOf(":") myJobId.XDN = sTemp.Substring(0, nLocColon) myJobId.MRN = sTemp.Substring(nLocColon + 1) Dim myJobReports As EMsgAPIReport200810.ReportRequestJobReports myJobReports = New EMsgAPIReport200810.ReportRequestJobReports Dim myReport() As EMsgAPIReport200810.JobReportType ReDim myReport(1) myReport(0) = New EMsgAPIReport200810.JobReportType myReport(0).ReportJobId = New EMsgAPIReport200810.JobIdType myReport(0).ReportJobId = myJobId myReport(0).ReportType = EMsgAPIReport200810.AllReportTypeEnum.detail 'myReport(0).ReportTemplate = "default_html" 'myReport(0).ReportTemplate = "me_default_html" Dim myReportAddress() As EMsgAPIReport200810.InternetType ReDim myReportAddress(1) myReportAddress(0) = New EMsgAPIReport200810.InternetType myReportAddress(0).Email = "tammy.gargiulo@pgi.com" myReport(0).ReportAddress = myReportAddress myReport(0).ReportReason = "TEST" myReport(0).reportOptionSpecified = True myReport(0).reportOption = EMsgAPIReport200810.ReportOptionEnum.senttofriend myJobReports.Report = myReport myReportRequest.SubmitId = "12345" myReportRequest.Item = myJobReports XOA.AllowAutoRedirect = True XOA.RequestValue = request Dim response As EMsgAPIReport200810.Response = New EMsgAPIReport200810.Response XOA.ResponseValue = response Try myReportResult = XOA.Report(myReportRequest) Catch ex As Exception MsgBox("ReportRequest error:" & ex.Message) Return End Try ' populate list view If myReportResult.Status Is Nothing Then API_Demo.txtResult.Text = "Error" Exit Sub End If If (myReportResult.Status.StatusCode = 0) Then If (myReportResult.ReportRecStatus(0).RecStatus.code = 0) Then API_Demo.txtResult.Text = ("Report Request was successful. Request JobID = " & myReportResult.ReportRecStatus(0).JobId.XDN & ":" & myReportResult.ReportRecStatus(0).JobId.MRN) Else API_Demo.txtResult.Text = "Error Requesting Report. Code = " & myReportResult.ReportRecStatus(0).RecStatus.code & " (" & myReportResult.ReportRecStatus(0).RecStatus.Value.ToString & ")" End If Else API_Demo.txtResult.Text = ("Error: Job Result=" & myReportResult.Status.StatusCode & vbCrLf & myReportResult.Status.StatusMessage) End If End If End Sub