Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Web service or ASP?
Message
From
06/12/2001 14:47:09
 
 
To
06/12/2001 12:26:52
General information
Forum:
Visual FoxPro
Category:
Web Services
Miscellaneous
Thread ID:
00589377
Message ID:
00590760
Views:
25
>Ah...This may be one of my problems. How can I tell if the SOAP Toolkit is installed right? When I try to run the VFP sample using the "showem.WDSL", I get an "OLE IDispatch exception code 0 ..." error. Any suggestions?

First, did you run the install from the CD?

>And BTW, I still don't think I have an understanding of what the VFP Web Services in VFP7 do and when to use them.

Here is goes, for the lurkers too:

To VFP developers a Web service is a non visual class that has methods. Lets take this one for example
DEFINE CLASS myclass AS session
	
	PROCEDURE GetOrderDate
		LPARAMETERS tcOrderNumber
		LOCAL ldReturn
		ldReturn = {}

		USE home(2) + "Tastrade\Data\orders.dbf"
		if seek(padl(tcOrderNumber, 6), 'orders', 'order_numb')
			ldReturn = order_date
		endif 
		USE
	RETURN ldReturn
ENDDEFINE
I can now call this class like this:
oClass = createobject('myclass')
?oClass.GetOrderDate(1075)
Now lets make this VFP specific class into a multi langauge COM object. I'm going to add the OLEPUBLIC keyword to the class defintion, plus, I'll use new VFP7 syntax to define what type of parameters and return values my method expects. Everything else will stay the same:
DEFINE CLASS myclass AS session OLEPUBLIC
	
	PROCEDURE GetOrderDate(tcOrderNumber AS string) AS date
		LOCAL ldReturn
		ldReturn = {}

		USE home(2) + "Tastrade\Data\orders.dbf"
		if seek(padl(tcOrderNumber, 6), 'orders', 'order_numb')
			ldReturn = order_date
		endif 
		USE
	RETURN ldReturn
ENDDEFINE
If I add this code to a project and compile the project as a DLL, I can now run my code from any COM enabled language (VB, Delphi, VFP, VBScript, ASP, ect.)

Here's how it could be called from VFP
oCOM = createobject('projectname.myclass')
?oCOM.GetOrderDate(1075)
Now, I can take my Class, and move it to the next level, Web services, by running the Web Service Publisher in VFP7. This will create some supporting files, like WSDL, and maybe an ASP page. Web services can be used by any platform that support HTTP and XML (I can't think of one that doesn't, since XML it just text with angle brackets around it < >).

When the WSDL is created, your class can now be called like this:
oWebService = CREATEOBJECT('mssoap.soapclient')
oWebService.mssoapinit('http://www.myserver.net/myclass.wsdl')
?oWebService.GetOrderDate(1075)
Anyone can call your class from anywhere in the world with an internet connection. So, if I had a URL to your WSDL file, I would call your Web Service with parameters, the class will execute completely on your computer, and the return value will be sent back to my computer, all through the internet.

Does that clear up anything?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform