Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return object from VFP Web Service
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Web Services
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01047082
Message ID:
01047111
Vues:
14
Paul,

I would return a XML string. From your example:
  FUNCTION AddTicketItem(nTransNum as Integer,;
                         cProductID as String) as Object;


*
* Return Value - Return the Item number assigned, and the price calculated
*
    local lcReturn as string 
    m.lcReturn = "" 

    select item_nbr, ;
       price ;
       from tabledt1 ;
       where [your condition] ;
       into cursor curitem nofilter

    if used('curitem') and ;
       reccount('curitem')>0 ;
    then 
        CURSORTOXML("curItem","lcReturn",1,32,0,"1")=0 ;
    endif 

    RETURN lcReturn
  ENDFUNC
Then, in your service client which is the c# app, you can create dataset from that XML string.
DataSet yourdataset = new DatSet();
string sReturnedFromSebService = yourservice.AddTicketItem(nTransNum,sProductID);
yourdataset.ReadXml(new StringReader(sReturnedFromSebService),XmlReadMode.Auto);
HTH
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform