Luca Tonelli Member Licensed User May 3, 2018 #1 Hello I need to read the response of a webservices that provides data in a datatable The webservices is called correctly but I do not know how to read the data contained in the datatable.
Hello I need to read the response of a webservices that provides data in a datatable The webservices is called correctly but I do not know how to read the data contained in the datatable.
R ronell Well-Known Member Licensed User Longtime User May 3, 2018 #2 response is handled in Code: Sub JobDone (Job As String) Log("JobName = " & Job.JobName & ", Success = " & Job.Success) If Job.Success = True Then dim response as string response = job.getstring '<--- webservice response End Sub Upvote 0
response is handled in Code: Sub JobDone (Job As String) Log("JobName = " & Job.JobName & ", Success = " & Job.Success) If Job.Success = True Then dim response as string response = job.getstring '<--- webservice response End Sub
Luca Tonelli Member Licensed User May 3, 2018 #3 Job.getstring () returns an xml string. I would like to read the values of the individual rows by copying them into an array or a list. I return this: Code: <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap:Body> <LoginResponse xmlns="https://site.it"> <LoginResult> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="NewDataSet"> <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="Table" msdata:UseCurrentLocale="true"> <xs:complexType> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="Table"> <xs:complexType> <xs:sequence> <xs:element name="Id" type="xs:decimal" minOccurs="0" /> <xs:element name="Abilitato" type="xs:boolean" minOccurs="0" /> <xs:element name="Admin" type="xs:boolean" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element> </xs:schema> <diffgr:diffgram xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <NewDataSet xmlns=""> <Table diffgr:id="Table1" msdata:rowOrder="0"> <Id>1</Id> <Abilitato>true</Abilitato> <Admin>true</Admin> </Table> </NewDataSet> </diffgr:diffgram> </LoginResult> </LoginResponse> </soap:Body> </soap:Envelope> Upvote 0
Job.getstring () returns an xml string. I would like to read the values of the individual rows by copying them into an array or a list. I return this: Code: <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap:Body> <LoginResponse xmlns="https://site.it"> <LoginResult> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="NewDataSet"> <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="Table" msdata:UseCurrentLocale="true"> <xs:complexType> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="Table"> <xs:complexType> <xs:sequence> <xs:element name="Id" type="xs:decimal" minOccurs="0" /> <xs:element name="Abilitato" type="xs:boolean" minOccurs="0" /> <xs:element name="Admin" type="xs:boolean" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element> </xs:schema> <diffgr:diffgram xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <NewDataSet xmlns=""> <Table diffgr:id="Table1" msdata:rowOrder="0"> <Id>1</Id> <Abilitato>true</Abilitato> <Admin>true</Admin> </Table> </NewDataSet> </diffgr:diffgram> </LoginResult> </LoginResponse> </soap:Body> </soap:Envelope>
R ronell Well-Known Member Licensed User Longtime User May 3, 2018 #5 Luca Tonelli said: Job.getstring () returns an xml string. I would like to read the values of the individual rows by copying them into an array or a list. I return this: Click to expand... sorry i only know how to do this in PHP, but as @DonManfred said you can search it in forum with the right key Upvote 0
Luca Tonelli said: Job.getstring () returns an xml string. I would like to read the values of the individual rows by copying them into an array or a list. I return this: Click to expand... sorry i only know how to do this in PHP, but as @DonManfred said you can search it in forum with the right key
Luca Tonelli Member Licensed User May 4, 2018 #6 Thanks for the reply I looked at the Xml2Map class. with the code shown below : Code: Dim xm As Xml2Map xm.Initialize Dim root As Map=xm.Parse(job.GetString()) Dim Envelope As Map=root.Get("Envelope") Dim Body As Map=Envelope.Get("Body") Dim LoginResponse As Map=Body.Get("LoginResponse") Dim LoginResult As Map=LoginResponse.Get("LoginResult") Dim diffgram As Map =LoginResult.Get("diffgram") Dim NewDataSet As Map =diffgram.Get("NewDataSet") Dim Table As Map =NewDataSet.Get("Table") the map of the Table variable contains Code: (MyMap) {Attributes={id=Table1, rowOrder=0}, Id=1, Abilitato=true, Admin=true} I do not know how to extract the second part of the data Id=1, Abilitato=true, Admin=true Upvote 0
Thanks for the reply I looked at the Xml2Map class. with the code shown below : Code: Dim xm As Xml2Map xm.Initialize Dim root As Map=xm.Parse(job.GetString()) Dim Envelope As Map=root.Get("Envelope") Dim Body As Map=Envelope.Get("Body") Dim LoginResponse As Map=Body.Get("LoginResponse") Dim LoginResult As Map=LoginResponse.Get("LoginResult") Dim diffgram As Map =LoginResult.Get("diffgram") Dim NewDataSet As Map =diffgram.Get("NewDataSet") Dim Table As Map =NewDataSet.Get("Table") the map of the Table variable contains Code: (MyMap) {Attributes={id=Table1, rowOrder=0}, Id=1, Abilitato=true, Admin=true} I do not know how to extract the second part of the data Id=1, Abilitato=true, Admin=true
DonManfred Expert Licensed User Longtime User May 4, 2018 #7 Code: log($"${Table.Get("Admin")}"$) Upvote 0