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
Titre:
Return object from VFP Web Service
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01047082
Message ID:
01047082
Vues:
55
I am trying to create a web service that inserts an item into a table and then returns the item number and the price assigned to the item. The client is a compact framework application written in C#. There are several methods that I could use to accomplish this, such as combining them in a string or returning them in a cursor and pulling them into a dataset. What I want to do is return an object with the required properties, which I could then pull out using reflection. I generated the following code:
  FUNCTION AddTicketItem(nTransNum as Integer,;
                         cProductID as String) as Object;
  

* ... code to add record ...


*
* Return Value - Return the Item number assigned, and the price calculated
*    
    LOCAL loReturn as Empty
    loReturn = NEWOBJECT('Empty')

    ADDPROPERTY(loReturn, 'nItemNumber', tabledtl.item_nbr)
    ADDPROPERTY(loReturn, 'nPrice', tabledtl.price)

    RETURN loReturn
  ENDFUNC
My code works fine and compiles as a COM object. However, when I try to publish it as a web service I get a message "Error generating WSDL files." If I change the return type to String and return a string value, it all works. I plan on expanding the method that I am using in other situations to much more complex return types, so I would like to be able to use objects.

Is this possible, or should I just find another way to return the data.

Thanks,

Paul R. Moon
Business Software Solutions
Paul R. Moon
Business Software Solutions
paul@businessoftware.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform