Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Ir al contenido
Cómo usar Correo de Recurso Confiable con lectores de pantalla
Búsqueda
Más
2 de aproximadamente 198
Carlos Escamilla
Archivos adjuntos20 abr. (Hace 3 días.)
para mí, Ana, Jose
Buenas tardes Oms,
Nos apoyas porfa a revisar este caso?, si es posible podemos generar una
conferencia,
Saludos !
---------- Mensaje reenviado ----------
De: Jose Maria Lamberto Perez Molero <jmariamolero@hotmail.com>
Fecha: 20 de abril de 2018, 10:39
Asunto: WebService Recurso Confiable
Para: "carlosescamilla@recursoconfiable.com" <carlosescamilla@recursoconfiable.com>
Hola Carlos,
Te envio un documento con la rutina que usamos en nuestro código para consumir el
webservice de Recurso Confiable. Es muy sencillo, es una pequeña rutina que llama
al webservice, de hecho tenemos otro proveedor al cual le pasamos la información
igual consumiendo un webservice, se llama Torre de Control y lo hace para
Kellogs...ya tenemos varios años usándolo...
Usuario = "avl_user_expressp"
Contra = "XOCpni23iv"
No me marca error pero no es el token que se supone me tendría que regresar para
que pueda pasarle los datos usando el método GPSAssetTracking. Parece que la
definición del arreglo Event no es el correcto....o algún otro problema con la
definicio de los métodos que se usan....
Saludos
BinaryDreams SA de CV
www.binarydreams.com.mx
Saludos
Usuario = "avl_user_expressp"
Contra = "XOCpni23iv"
'Contra = "deresereeee"
token = ws2.GetUserToken(Usuario, Contra)
Console.WriteLine("Valor de token " & token.ToString)
'app = "1,2,3,4,5,6,7,7"
'ws2.GPSAssetTracking("BRAD", app)
' que saque de cadena todos los valores que necesita para el webservice
de torre de control
'posi_geog = ""
'posi_geog = "$LAAF|" & Trim$(Str(Grupo)) & "." & Trim$(Str(compañía))
& "." & Trim$(Str(movil)) & "." & Trim$(Str(tipounidad)) & "|" & Trim$
(Str(tipo_comando)) & "|"
' 0 1
2
'posi_geog = posi_geog & status_char & "|" & Trim$(longitud) & "|" &
Trim$(latitud)
' ' 3 4
5
'posi_geog = posi_geog & "|" & Trim$(Str(Veloc)) & "|" & Trim$
(Str(rumbo)) & "|" & hora1 & "|" & fecha1 & "|" & Trim$(Str(Panico)) & "|" & Trim$
(nombre_movil) & "|" & Trim$(valor_estatus) & "|" & Trim$(temperatura) & "|"
' 6 7
8 9 10 11
12 13
'posi_geog = posi_geog & ubicacion & "|0|" & nombrecuenta & "|" & Trim$
(Str(eventoruta)) & "|" & Trim$(Str(numruta)) & "|" & Trim$(nombreconductor) & "|"
& Trim$(cadena_geocerca) & "|" & eventopunto_str & "|" & puerta & "|" & subieron &
"|" & bajaron & "|" & bateria & "|#"
' 13 14 15 16
17 18 19
20 21 22 23 24
25
Dim fecha As String = ""
Dim hora As String = ""
Dim arg1 As Integer = 0
Dim arg2 As Long = 0
'Dim arg3 As Long = 0
Dim arg3 As String = ""
Dim arg4 As String = ""
Dim arg5 As Date
Dim arg6 As Double
Dim arg7 As Double
Dim arg8 As Single = 0
Dim arg9 As Single = 0
Dim arg10 As String = ""
Dim arg11 As String = ""
fecha = "19/04/2018"
hora = "11:47:00"
'fecha = Trim$(GetParameter(cadena, 9, "|"))
'hora = Trim$(GetParameter(cadena, 8, "|"))
Dim fechaaux As String = ""
fechaaux = fecha & " " & hora
fechaaux = Format(CDate(fechaaux), "yyyy-MM-dd hh:mm:ss")
'fechaaux = Trim$(GetParameter(fechaaux, 0, " "))
arg1 = 2
arg2 = 702791
arg3 = deviceid
'arg3 = 1846109
arg4 = Trim$(GetParameter(cadena, 11, "|"))
arg5 = CDate(fechaaux) ' fecha y hora
arg6 = 0.0
arg7 = 0.0
If Double.TryParse(Trim$(GetParameter(cadena, 5, "|")), arg6) = True
Then
' que continue
Else
arg6 = 0.0
End If
If Double.TryParse(Trim$(GetParameter(cadena, 4, "|")), arg7) = True
Then
' que continue
Else
arg9 = 0.0
End If
If Single.TryParse(Trim$(GetParameter(cadena, 6, "|")), arg8) = True
Then
' que continue
Else
arg8 = 0.0
End If
If Single.TryParse(Trim$(GetParameter(cadena, 7, "|")), arg9) = True
Then
' que continue
Else
arg9 = 0.0
End If
'serv.altitude = "134.0"
'eventosRC = New ServiceReference2.Event
'For I = 0 To 8
'eventos(I).Equals(Nothing)
'Next
eventosRC = Nothing
eventosRC(0).altitude = "134.0"
eventosRC(1).asset = "134.0"
eventosRC(2).code = ""
eventosRC(3).customer.id = "Customer ID"
eventosRC(4).customer.name = "Nombre"
'serv.date = arg5
eventosRC(5).date = arg5
eventosRC(6).direction = arg5
eventosRC(7).latitude = arg6
eventosRC(8).longitude = arg7
Console.WriteLine("Se autentifico " & token.ToString())
apps = ws2.GPSAssetTracking(token.ToString, eventosRC)
Console.WriteLine(" resultado " & apps.ToString())
'If ws2.GetUserToken(Usuario, Contra) IsNot Nothing Then
'' se autentifico
'Try
'Console.WriteLine("Se autentifico " & token.ToString())
'apps = ws2.GPSAssetTracking(token.ToString, eventosRC)
'Console.WriteLine(" resultado " & apps.ToString())
'Catch exapps As Exception
'Console.WriteLine(" Error en LlamaWebServiceRecursoConfiable " &
exapps.Message)
'End Try
'apps.ToString()
' pasar los argumentos .....
'Else
'Console.WriteLine("Es nothing")
'End If
'ws2.GPSAssetTracking(token.ToString, eventosRC)
'serv.direction = ""
'serv.latitude = arg6
'serv.longitude = arg7
'serv.serialNumber = ""
Dim municipio As String = ""
' contar cuantos caracteres coma(,) vienen en la direccion y si son 4
el municipio esta en la posicion 2 y si vienen 3 esta en la posicion 1
municipio = Trim$(GetParameter(arg10, 2, ","))
Dim auxant() As String
auxant = arg10.Split(",")
If auxant.Length = 6 Then
municipio = Trim$(GetParameter(arg10, 3, ","))
End If
If auxant.Length = 5 Then
municipio = Trim$(GetParameter(arg10, 2, ","))
End If
If auxant.Length = 4 Then
municipio = Trim$(GetParameter(arg10, 1, ","))
End If
arg11 = municipio
Try
'ws1.Execute(2, 702791, 1846109, "2011-01-19 09:23:40.000", 19.72,
-99.19, "a 0.02 Km de CEDIS DCW SANTA BARBARA", 0.0, 0.0, "TEOLOYUCAN")
'ws1.Execute(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9,
arg10)
'ws2.Execute(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9,
arg10, arg11)
Console.WriteLine("Ejecuto Webservice
LlamaWebServiceRecursoConfiable")
Catch ex As Exception
Console.WriteLine("Error al ejecutar WebService
LlamaWebServiceRecursoConfiable " & ex.Message)
End Try
ws2 = Nothing
Catch exalt As AccessViolationException
Console.WriteLine("Error al ejecutar WebService
LlamaWebServiceRecursoConfiable " & exalt.Message)
Catch exglobal As Exception
Console.WriteLine("Error al ejecutar WebService
LlamaWebServiceRecursoConfiable " & exglobal.Message)
End Try
End Sub
------------------------------------------
App.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings"
type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="ServidorBDRMSMQ.My.MySettings"
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<applicationSettings>
<ServidorBDRMSMQ.My.MySettings>
<setting
name="ServidorBDRMSMQ_mx_com_torredecontrol_www_RecepcionPosicionesGPS"
serializeAs="String">
<value>http://www.torredecontrol.com.mx:8080/sidtorrecontrol/servlet/arecepcionposi
cionesgps</value>
</setting>
</ServidorBDRMSMQ.My.MySettings>
</applicationSettings>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="WsRecepcionPosicionGpsSoapBinding" />
<binding name="BasicHttpBinding_IRCService" />
</basicHttpBinding>
</bindings>
<client>
<endpoint
address="http://www.3pltc.com/servlet/awsrecepcionposiciongps"
binding="basicHttpBinding"
bindingConfiguration="WsRecepcionPosicionGpsSoapBinding"
contract="ServiceReference1.WsRecepcionPosicionGpsSoapPort"
name="WsRecepcionPosicionGpsSoapPort" />
<endpoint
address="http://gps.rcontrol.com.mx/Tracking/wcf/RCService.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IRCService"
contract="ServiceReference2.IRCService"
name="BasicHttpBinding_IRCService" />
</client>
</system.serviceModel>
</configuration>
-----------------------------------
RCService2.xsd
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="http://tempuri.org/" elementFormDefault="qualified"
targetNamespace="http://tempuri.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import schemaLocation="http://gps.rcontrol.com.mx/Tracking/wcf/RCService.svc?
xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/IronTracking" />
<xs:element name="GetUserToken">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="userId" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="password" nillable="true"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetUserTokenResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q1="http://schemas.datacontract.org/2004/07/IronTracking"
minOccurs="0" name="GetUserTokenResult" nillable="true"
type="q1:UserTokenResult" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GPSAssetTracking">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="token" nillable="true" type="xs:string" />
<xs:element xmlns:q2="http://schemas.datacontract.org/2004/07/IronTracking"
minOccurs="0" name="events" nillable="true" type="q2:ArrayOfEvent" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GPSAssetTrackingResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q3="http://schemas.datacontract.org/2004/07/IronTracking"
minOccurs="0" name="GPSAssetTrackingResult" nillable="true"
type="q3:ArrayOfAppointResult" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
LlamawebserviceRecursoConfiable.txt
Mostrando LlamawebserviceRecursoConfiable.txt