Visualizzazione dei risultati da 1 a 2 su 2

Discussione: ws rest e xml in .net

  1. #1
    Utente di HTML.it
    Registrato dal
    Jun 2003
    Messaggi
    4,826

    ws rest e xml in .net

    ciao.
    Sto cercando di integrare in un applicativo prestashop tramite il suo webservice rest xml.
    La mia idea era di recuperare l'xml on tutte le entità , creare un .xsd con l'utility xsd.exe e quindi creare le entità sotto forma di classi e proprietà in vb.net o c# per serializzare/deserializzare i dati.
    Il problema è che non riesco a reperire tutti gli xml per creare un xml completo con tutte le entità, lo dovrei fare a mano , ma prima di farlo dato che ci si mettera piu o meno un giorno volevo chiedervi se si puo fare , e che tipo di xml è meglio usare :
    L'xml puo apparire verboso , cosi:
    codice:
    <address><id_customer format="isNullOrUnsignedId"/><id_manufacturer format="isNullOrUnsignedId"/><id_supplier format="isNullOrUnsignedId"/><id_warehouse format="isNullOrUnsignedId"/><id_country required="true" format="isUnsignedId"/><id_state format="isNullOrUnsignedId"/><alias required="true" maxSize="32" format="isGenericName"/><company maxSize="64" format="isGenericName"/><lastname required="true" maxSize="32" format="isName"/><firstname required="true" maxSize="32" format="isName"/><vat_number format="isGenericName"/><address1 required="true" maxSize="128" format="isAddress"/><address2 maxSize="128" format="isAddress"/><postcode maxSize="12" format="isPostCode"/><city required="true" maxSize="64" format="isCityName"/><other maxSize="300" format="isMessage"/><phone maxSize="32" format="isPhoneNumber"/><phone_mobile maxSize="32" format="isPhoneNumber"/><dni maxSize="16" format="isDniLite"/><deleted format="isBool"/><date_add format="isDateFormat"/><date_upd format="isDateFormat"/></address>
    o no , cosi:
    codice:
    <prestashop><address><id/><id_customer/><id_manufacturer/><id_supplier/><id_warehouse/><id_country/><id_state/><alias/><company/><lastname/><firstname/><vat_number/><address1/><address2/><postcode/><city/><other/><phone/><phone_mobile/><dni/><deleted/><date_add/><date_upd/></address></prestashop>

    quale è meglio usare con l'xsd.exe per generare l'xsd e le classi?
    grazie.

  2. #2
    Utente di HTML.it
    Registrato dal
    Jun 2003
    Messaggi
    4,826
    Quote Originariamente inviata da giuseppe500 Visualizza il messaggio
    ciao.
    Sto cercando di integrare in un applicativo prestashop tramite il suo webservice rest xml.
    La mia idea era di recuperare l'xml on tutte le entità , creare un .xsd con l'utility xsd.exe e quindi creare le entità sotto forma di classi e proprietà in vb.net o c# per serializzare/deserializzare i dati.
    Il problema è che non riesco a reperire tutti gli xml per creare un xml completo con tutte le entità, lo dovrei fare a mano , ma prima di farlo dato che ci si mettera piu o meno un giorno volevo chiedervi se si puo fare , e che tipo di xml è meglio usare :
    L'xml puo apparire verboso , cosi:
    codice:
    <address><id_customer format="isNullOrUnsignedId"/><id_manufacturer format="isNullOrUnsignedId"/><id_supplier format="isNullOrUnsignedId"/><id_warehouse format="isNullOrUnsignedId"/><id_country required="true" format="isUnsignedId"/><id_state format="isNullOrUnsignedId"/><alias required="true" maxSize="32" format="isGenericName"/><company maxSize="64" format="isGenericName"/><lastname required="true" maxSize="32" format="isName"/><firstname required="true" maxSize="32" format="isName"/><vat_number format="isGenericName"/><address1 required="true" maxSize="128" format="isAddress"/><address2 maxSize="128" format="isAddress"/><postcode maxSize="12" format="isPostCode"/><city required="true" maxSize="64" format="isCityName"/><other maxSize="300" format="isMessage"/><phone maxSize="32" format="isPhoneNumber"/><phone_mobile maxSize="32" format="isPhoneNumber"/><dni maxSize="16" format="isDniLite"/><deleted format="isBool"/><date_add format="isDateFormat"/><date_upd format="isDateFormat"/></address>
    o no , cosi:
    codice:
    <prestashop><address><id/><id_customer/><id_manufacturer/><id_supplier/><id_warehouse/><id_country/><id_state/><alias/><company/><lastname/><firstname/><vat_number/><address1/><address2/><postcode/><city/><other/><phone/><phone_mobile/><dni/><deleted/><date_add/><date_upd/></address></prestashop>

    quale è meglio usare con l'xsd.exe per generare l'xsd e le classi?
    grazie.

    ho omesso che farlo a mano vuole dire mettersi al browser e "sfogliare" gli href che sono dentro le risorse xml , ad ogni url corrisponde un xml , ad es se digito la risorsa addresses ottengo:
    codice:
    <addresses xlink:href="http://gf.etadue.net/prestashop/api/addresses" get="true" put="true" post="true" delete="true" head="true"><description xlink:href="http://gf.etadue.net/prestashop/api/addresses" get="true" put="true" post="true" delete="true" head="true">
    The Customer, Manufacturer and Customer addresses</description><schema xlink:href="http://gf.etadue.net/prestashop/api/addresses?schema=blank" type="blank"/><schema xlink:href="http://gf.etadue.net/prestashop/api/addresses?schema=synopsis" type="synopsis"/></addresses>
    e posso digitare gli href ottenendo un altro xml di un altra risorsa.per poi concatenare tutto in un xml con tutte le entità e usare xsd.exe sull'xml per generare l'xsd e quindi le classi.
    solo una cosa , nell'xml creato conterebbe l'ordine di apparizione delle risorse ?
    ciao.
    non è un lavoro immane ma neanche piccolo.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.