Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Web Services for the common VFP Developer
Message
 
À
31/03/2002 12:39:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Web Services
Divers
Thread ID:
00637482
Message ID:
00639303
Vues:
18
>Thierry,
>
>I haven't read the article in question, but here's what I think about what WebServices should return ... XML only. You start returning other types of data and your WebService may or may not be useable for other platforms.
>
>But, that's just *my* opinion ...

True to some degree, but the Object format is fairly well defined in the SOAP spec and even if a client fails to retrieve the object as an object he should always be able to retrieve the XML string directly as a NodeList (SOAP toolkit) or DOM root node (wwXML) for example.

Same goes for other types like a DataSet result - which is really just XML as well when persisted into SOAP.

I think if you use .NET it makes sense to utilize the technology to its fullest and let the clients worry about how to retrieve the data. Most SOAP clients will be able to pick up the XML either way.

That actually reminds me to update wwSOAP to work more cleanly when passing back object parameters <g>...

+++ Rick ---


>~~Bonnie
>
>>In the article "Web Services for the common VFP Developer" (UT Mag, December 4, 2001) there is an example of a web service used to transfer files between a client and the server.
>>The FileService class has 2 methods: GetFile() to transfer a file from the server to the client and a SaveFile() method which lets the client save a file on the server.
>>
>>The relevant code from the article is at the end of this message.
>>
>>The code does not work as is but needs to be modifed:
>>1) RETURN FILETOSTR(cFileName) needs to be replaced by RETURN CREATEBINARY(FILETOSTR(cFileName))
>>2) The WSDL file needs to be edited so that the datatype of the respond type of GetFile() is 'base64Binary' rather than 'string' and the datatype of the cFileStr parameter of SaveFile() is also 'base64Binary' and not 'string'.
>>
>>When I call these methods from a client which uses the web service:
>> - GetFile() works fine even with 3 MB files.
>> - SaveFile() works fine with 30 KB files but fails with 100KB or more files.
>>
>>
>>Does anyone undestand why SaveFile() does not work with the larger files?
>>
>>Here is the relevant code from the article
>>
>>DEFINE CLASS BaseCom AS Session
>>	PROCEDURE Init
>>		SYS(2335 ,0) && Turn unattended mode on
>>	ENDPROC
>>
>>	PROCEDURE Error(nError, cMethod, nLine)
>>		LOCAL lcMessage AS String
>>		lcMessage = 'Error: ' + TRANSFORM(nError) + ' - ' + MESSAGE()
>>		*
>>		* If we have an error call COMRETURNERROR this will raise an error on SOAP
>>		* that will raise an error on the client.
>>		*
>>		COMRETURNERROR(This.Class, lcMessage)
>>	ENDPROC
>>ENDDEFINE
>>
>>DEFINE CLASS FileService AS BaseCom OLEPUBLIC
>>	FUNCTION GetFile(cFileName AS String) AS String
>>		IF FILE(cFileName)
>>			RETURN FILETOSTR(cFileName)
>>		ELSE
>>			COMRETURNERROR('FileService', 'File ' + cFileName + " doesn't exist")
>>		ENDIF
>>	ENDFUNC
>>
>>	FUNCTION SaveFile(cFileName AS String, cFileStr AS String, lOverwrite AS Boolean) AS Boolean
>>		
>>		IF !FILE(cFileName) OR lOverwrite
>>			STRTOFILE(cFileStr, cFileName)
>>			RETURN FILE(cFileName)
>>		ELSE
>>			COMRETURNERROR('FileService', 'File ' + cFileName + ' already exist')
>>		ENDIF
>>	ENDFUNC
>>	*
>>	* This lines are only taken in considuration
>>	* if this is called over COM and not over SOAP.
>>	* for SOAP calls all the parameters must be pass
>>	*
>>	DIMENSION SaveFile_COMATTRIB[5]
>>	SaveFile_COMATTRIB[3] = 'SaveFile' && Proper capitalization
>>	SaveFile_COMATTRIB[5] = 2 && Specifie the number of required parameters
>>ENDDEFINE
>>
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform