问题
I'm well aware of this question kSOAP2 double ID exception but for some reason its not working for me
The thing is, i have this process that works every 2 minutes sending new data on a separate thread, sends a pack with data, some gps data and receives if the packet was received, the gps data was stored and if the gps should be still active.
Here's the webService code
<WebMethod(Description:="Almacena una lectura, la posición del lecturista y revisa si sigue activo el servicio")> _
Public Function guardarDatos(ByVal Lecturas As Object, ByVal id_lec As String, ByVal usuario As String, ByVal sobrelectura As String, ByVal latitud As String, ByVal longitud As String, ByVal precision As String, ByVal pin As String) As Data.DataSet
Dim datos As New Data.DataSet
'Dim tabla As New Data.DataTable("datos")
'Dim columna As Data.DataColumn
Dim linea As Data.DataRow
datos.Tables.Add(New Data.DataTable("respuesta"))
datos.Tables("respuesta").Columns.Add(New Data.DataColumn("Lecturas", GetType(String)))
datos.Tables("respuesta").Columns.Add(New Data.DataColumn("GPS", GetType(String)))
datos.Tables("respuesta").Columns.Add(New Data.DataColumn("ActivoGPS", GetType(String)))
'columna = New Data.DataColumn("lecturas", "esto".GetType)
'tabla.Columns.Add(columna)
'columna = New Data.DataColumn("gps", "esto".GetType)
'tabla.Columns.Add(columna)
'columna = New Data.DataColumn("activoGps", "esto".GetType)
'tabla.Columns.Add(columna)
linea = datos.Tables("respuesta").NewRow
Dim respuesta As String = ""
If ingresarLecturas(Lecturas, id_lec, usuario, sobrelectura) Then
linea("Lecturas") = "1"
Else
linea("Lecturas") = "0"
End If
If guardaLocalizacion(id_lec, usuario, latitud, longitud, precision, pin) Then
linea("GPS") = "1"
Else
linea("GPS") = "0"
End If
If gpsActivo() Then
linea("ActivoGPS") = "1"
Else
linea("ActivoGPS") = "0"
End If
datos.Tables("respuesta").Rows.Add(linea)
datos.AcceptChanges()
Return datos
End Function
I create a dataSet with a table on which i store if the things are done right, and this is the response i get
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<guardarDatosResponse xmlns="http://www.agua.gob.mx/">
<guardarDatosResult>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="respuesta">
<xs:complexType>
<xs:sequence>
<xs:element name="Lecturas" type="xs:string" minOccurs="0" />
<xs:element name="GPS" type="xs:string" minOccurs="0" />
<xs:element name="ActivoGPS" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<NewDataSet xmlns="">
<respuesta diffgr:id="respuesta1" msdata:rowOrder="0">
<Lecturas>1</Lecturas>
<GPS>1</GPS>
<ActivoGPS>1</ActivoGPS>
</respuesta>
</NewDataSet>
</diffgr:diffgram>
</guardarDatosResult>
</guardarDatosResponse>
</soap:Body>
</soap:Envelope>
As you can see, i dont get any tags cuz i set the changes before the response, but still i'm getting that "double ID" exception. Any idea why?
来源:https://stackoverflow.com/questions/7812507/ksoap2-double-id