Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WS wrapper not working
Message
De
15/11/2001 11:38:03
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Web Services
Titre:
WS wrapper not working
Divers
Thread ID:
00582158
Message ID:
00582158
Vues:
60
I have a class called VFPXML. Its intended use is to act as a data service that accesses vfp tables and returns results in XML format. For example, the VFPXML.Query method accepts a Where clause and Table name. Based on those two parameters, the VFPXML object executes the query and returns the result of the query in the form of an XML string. It is stateless.

Then, I built a wrapper around this VFPXML class and called the wrapper "DataServ". The intention here is to build the wrapper into a web service. The Wrapper has a property that is a reference to the VFPXML object. Then, there are also methods in the wrapper that simply pass requests thru to the VFPXML object. The Init method of the wrapper instantiates the VFPXML object and saves it to the DataService property of the wrapper.

When I run the wrapper as a com server, works great.

When I consume the webservice, however, any attempts to execute the Query method fail with a "dataservice: unknown member" error. I added an ErrorMsg property and GetErrorMsg method which confirms that the VFPXML object never instantiates because the GetErrorMsg method returns "Could not load dataservice"

BTW, I realize that this isn't exactly stateless since I added the ErrorMsg property and method to return the contents of the ErrorMsg. But, I just added this property to help me debug this problem. :)

Here is the class definition for the wrapper... its pretty simple. (how can I "embed" code samples like this in my UT thread and have it formatted, different back ground color etc?)

DEFINE CLASS DataServ AS Session OLEPUBLIC
PROTECTED DataService,ErrorMsg

DataService=NULL
ErrorMsg=''

FUNCTION Init

This.DataService=NEWOBJECT('VFPXML','MyLib.vcx')

IF TYPE('This.DataService')#'O'
This.ErrorMsg='Could not load dataservice'
ENDIF


ENDFUNC

FUNCTION Query (tcWhere AS String, tcDataAlias AS String) AS String
RETURN This.DataService.Query(tcWhere,tcDataAlias)
ENDFUNC

FUNCTION GetErrorMsg AS String
RETURN 'Error Encountered : '+This.ErrorMsg
ENDFUNC

ENDDEFINE
Répondre
Fil
Voir

Click here to load this message in the networking platform