DOMANDA Interrogazione webservice asmx con javascript

Pubblicità

Skills07

Head of Development
Staff Forum
Utente Èlite
Messaggi
39,446
Reazioni
13,340
Punteggio
253
amici del foro

sto lavorando con dei servizi webservice asmx.
Praticamente ho una chiamata che restituisce questa roba:

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<DataSet xmlns="http://tempuri.org/">
<schema xmlns="http://www.w3.org/2001/XMLSchema">schema</schema>xml</DataSet>


sostanzialmente contiene questo xml:

Codice:
<DataSet><xs:schema id="NewDataSet"><xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"><xs:complexType><xs:choice minOccurs="0" maxOccurs="unbounded"><xs:element name="Table"><xs:complexType><xs:sequence><xs:element name="RagioneSociale" type="xs:string" minOccurs="0"/><xs:element name="Indirizzo" type="xs:string" minOccurs="0"/><xs:element name="CAP" type="xs:string" minOccurs="0"/><xs:element name="Localita" type="xs:string" minOccurs="0"/><xs:element name="CodFisc_IVA" type="xs:string" minOccurs="0"/><xs:element name="CodiceFiscale" type="xs:string" minOccurs="0"/><xs:element name="CCIA" type="xs:string" minOccurs="0"/><xs:element name="Tribunale" type="xs:string" minOccurs="0"/><xs:element name="Telefono" type="xs:string" minOccurs="0"/><xs:element name="Fax" type="xs:string" minOccurs="0"/><xs:element name="PostaElettronica" type="xs:string" minOccurs="0"/><xs:element name="NUMRUI" type="xs:string" minOccurs="0"/><xs:element name="NumREA" type="xs:string" minOccurs="0"/><xs:element name="IndirizzoWeb" type="xs:string" minOccurs="0"/><xs:element name="PEC" type="xs:string" minOccurs="0"/></xs:sequence></xs:complexType></xs:element></xs:choice></xs:complexType></xs:element></xs:schema><diffgr:diffgram><NewDataSet><Table diffgr:id="Table1" msdata:rowOrder="0"><RagioneSociale>PAVIA TICINO</RagioneSociale><Indirizzo>Corso ITALIA, 22/A</Indirizzo><CAP>27100</CAP><Localita>PAVIA</Localita><CodFisc_IVA>11418820152</CodFisc_IVA><CodiceFiscale>11418820152</CodiceFiscale><CCIA>MILANO 11111111</CCIA><Tribunale>MILANO 1111111</Tribunale><Telefono>02 1234567</Telefono><Fax>02 9876543</Fax><PostaElettronica>paviaticino@allianz.it</PostaElettronica><NUMRUI>A000333221</NUMRUI><PEC/></Table></NewDataSet></diffgr:diffgram></DataSet>


come faccio a leggerlo in javascript per prendere solo dati che servono a me'?
 
Non é necessario JavaScript per leggerlo.
Se non ho capito male, devi solo costryure un client per questo web services ? Basta una pagina asp net
 
no, infatti non devo costruire nessuna pagina asp.net, ma sto facendo un applicazione nativa per cellulari che necessita di javascript, come vedi sopra io ho già interrogato il webservice, ma non riesco a prendere i dati dalla risposta che il webservice mi manda
 
cross platform, sia android che ios ma stesso codice scritto con telerik progress platform, sono app web scritte nativamente in cordova.js etc etc
 
visto che usi javascript potresti restituire i dati in formato json, non xml. sarebbero più facili da leggere.. nelle chiamate ajax solitamente faccio così
 
il problema è che il webservice non l'ho scritto io è scritto da terzi(anche per me sarebbe più facile leggere un json)
 
Pubblicità
Pubblicità
Indietro
Top