Hi, I hope you are having a good afternoon
I write asking for help
I have the same problem
Ive tried severals DLLs but I got the same error
My application keeps throwing
I try pasting the nmsprovider-activemq.config everywhere but the problem
persist
As you can see
Id really appreciate your help
This is the code is just to test the connection
Imports System.Xml
Imports System.Data
Imports System
Imports Apache.NMS
Imports Apache
Imports Apache.NMS.Util
Imports System.Reflection
Public Class clsConfirmador
Dim objGeneral As clsGeneral
Dim strSQL As String
Dim strMensajeError As String
Const ID_RESPUESTA_COLA As Short = 0
Const OK_RESPUESTA_COLA As Short = 1
Const MENSAJE_RESPUESTA_COLA As Short = 2
Const REGISTRO_CON_ERROR_COLA As Short = 3
Sub New()
Me.objGeneral = New clsGeneral
End Sub
Public Function Consultar_Pagos_Sap(ByVal FechaIncio As Date, ByVal
FechaFinal As Date, ByRef MensajeError As String) As Boolean
Try
Dim objServicioSap As New wsConsultaSAP.WSTechnoCargoClient
Dim arrPagos As wsConsultaSAP.payment()
Dim dsPagosReportados As DataSet
Dim strError As String = ""
strSQL = "SELECT DISTINCT NumeroIdentificacionTercero FROM
V_Encabezado_Documento_Comprobantes"
strSQL += " WHERE EMPR_Codigo = " & Me.objGeneral.CodigoEmpresa
& vbNewLine
strSQL += " AND Fecha_Crea >= CONVERT(DateTime, '" &
Me.objGeneral.Formatear_Fecha_SQL(FechaIncio) & "',101)" & vbNewLine
strSQL += " AND Fecha_Crea <= CONVERT(DateTime, '" &
Me.objGeneral.Formatear_Fecha_SQL(FechaFinal) & "',101)" & vbNewLine
strSQL += " AND Interfaz_ERP = " & clsPagos.REGISTRO_GENERADO
dsPagosReportados = Me.objGeneral.Retorna_Dataset(strSQL,
strError)
For Each Registro As DataRow In dsPagosReportados.Tables(0).Rows
arrPagos =
objServicioSap.getAppliedPayments(Formatear_Fecha_SAP(FechaIncio),
Formatear_Fecha_SAP(FechaFinal),
Registro.Item("NumeroIdentificacionTercero"))
Next
Return True
Catch ex As Exception
Return False
End Try
End Function
Private Function Formatear_Fecha_SAP(ByVal Fecha As Date) As String
Dim strFecha As String = ""
Try
strFecha = Fecha.Year & "-" & Format(Fecha.Month, "#0") & "-" &
Format(Fecha.Day, "#0")
Catch ex As Exception
MsgBox("Error" & ex.Message)
End Try
Return strFecha
End Function
Public Function Verificar_Reportes_ActiveMQ() As Boolean
Try
Dim pathList As ArrayList = New ArrayList()
Dim currentDomain As AppDomain = AppDomain.CurrentDomain
Dim codeBase As String =
Assembly.GetExecutingAssembly().CodeBase
Dim uriBuilder As New UriBuilder(codeBase)
Dim assemblyPath As String =
Uri.UnescapeDataString(uriBuilder.Path)
pathList.Add(assemblyPath)
If Not IsNothing(currentDomain.BaseDirectory) Then
pathList.Add(currentDomain.BaseDirectory)
End If
If Not IsNothing(currentDomain.RelativeSearchPath) Then
pathList.Add(currentDomain.RelativeSearchPath)
End If
Dim conConexion As Uri
Dim cofConnector As IConnectionFactory
conConexion = New Uri("activemq:tcp://" &
Me.objGeneral.DireccionMQ & ":" & Me.objGeneral.PuertoMQ)
'conConexion = New Uri(Me.objGeneral.DireccionMQ & ":" &
Me.objGeneral.PuertoMQ)
cofConnector = New NMSConnectionFactory(conConexion)
Using objConexion As IConnection =
cofConnector.CreateConnection(Me.objGeneral.UsuarioMQ,
Me.objGeneral.ClaveMQ)
Using objSesion As ISession = objConexion.CreateSession()
Dim objDestino As IDestination =
SessionUtil.GetDestination(objSesion,
"queue://RESPONSE_TECHNOCARGO_SAP_SOFTTOOLS.BAR")
Using objConsumidor As IMessageConsumer =
objSesion.CreateConsumer(objDestino)
Using objProductor As IMessageProducer =
objSesion.CreateProducer
objConexion.Start()
Dim objSolicitud As ITextMessage =
objSesion.CreateTextMessage("Prueba SoftTools")
objSolicitud.Properties("NMSXGroupID") =
"Javier"
objSolicitud.Properties("myHeader") =
"Castañeda"
objProductor.Send(objSolicitud)
Dim objMensajeRespuesta As ITextMessage =
objConsumidor.Receive
If Not IsNothing(objMensajeRespuesta) Then
MsgBox("Mensaje Recibido = " &
objMensajeRespuesta.Text)
End If
End Using
End Using
End Using
End Using
Return True
Catch ex As Exception
MsgBox("Error" & ex.Message)
Return False
End Try
End Function
End Class
Cordial Saludo,
Javier Enrique Castañeda Gómez
Gerente de Proyectos
SoftTOOLS SAS.
TEL (571) 702 06 35 Ext: 114
Cl 93 B 18 12 Of 307
<mailto:[email protected]> [email protected]
<http://www.softtools.com.co/> Description: Description: Description:
cid:[email protected]
Este correo y sus archivos anexos son confidenciales, para uso exclusivo de
la persona o entidad de destino.
Si ha recibido este correo por error u omisión absténgase de utilizar,
copiar, imprimir o reenviar el contenido. En tal caso, por favor notifique
inmediatamente al remitente.
El contenido de este mensaje es de carácter informativo y no constituye
documento legal.