SlideShare uma empresa Scribd logo
1 de 40
Web-Services
in Visual FoxPro 9.0
FoxPro User Group of German language
Rainer Becker
Presentation at SDN 15 Sep 2006
WEB
Working with WebServices
 Friday, 15.09.2006, 13:00 – 14:15
 Visual FoxPro is most often used for rapid application
development of Desktop-applications but also for
Client/Server applications, both sometimes running on
Terminal Services for ease of deployment.
 But you can also create WebServices with this powerfull
development environment without any problems!
 The fast database and string functions allow the creation of
fast services for distributed applications.
Rainer Becker
 dFPUG
 Online offers
 Loose Leaf Magazine
 VFP-DevCon
 VFP-Lokal/Develop
 Framework Visual Extend
 MVP, MCP, ISV
 Wizards & Builders GmbH
Where do I get VFP ?
 Update from 6.0, 7.0, 8.0 or VS 97
 Not for VFP 5.0 or older
 International or US/Canada-Version
 different pricing
 technical identical
 no problem in The Netherlands
 dFPUG offers localization
 we could create a Dutch version if someone is interested…
Topics
 Existing WebServices
 Calling WebServices
 Definitions and versions
 Preparation
 SOAP-Toolkit
 IIS-Configuration
 Additional hints
 Other ways to skin a cat
Remarks
 You always need a COM-Server!
 Creating COM-Servers is a different session…
 Please create a COM-Server first and test it…
 and maybe have a look at existing WebServices…
 The calling logic in the Internet is different in general.
Therefore business objects are not really usable if they are not
designed for one-time-calls. Separate COM-Servers are often
easier to use!
 WebServices have to be strongly typed which is only optional
for COM-Server, maybe create a separate PRG with
 For deployment you always need a Windows Webserver in the
Internet…
Existing WebServices
 Instead creating a WebService directly you should
first have a look at existing WebServices, e.g.:
 FoxWiki (http://fox.wikis.com)
 Universal Thread (http://www.universalthread.com)
 ProFox (http://www.leafe.com)
 FoxCentral (http://www.foxcentral.com)
 Google, Amazon, eBay, FedEx, WhoIs, CurrencyConverter,
BabelFish, Headline News
 dFPUG-Portal (see http://apf.dfpug.de)
 dFPUG-Forum (see Visual Extend example)
And Again: The TaskPane!
Client for WebServices
 Interactive Testing with the Taskpane
 Integration into your own forms:
 Open the Form
 Open the Toolbox
 Drag & Drop the class WebService onto the form
 Select the object with the mouse
 Right mouseclick for Builders
 Call the XML WebService Builders
WebService-class in your form
 Enter parameters
 View results as XML
 View results in Grid
Testing:
Match parameters and output
Use complex data
Thats it for calling a WebService
 Since Visual FoxPro 8.0 there are powerfull tools that
support developers in calling WebServices…
 Before creating your first own WebSerivce have a
look…
 This could easily fill a another complete session…
 There are multiple articles available as well as the
updatebook for Visual FoxPro 8.0!
Definitions
 WSDL: Web Service Description Language
 XML-description similar to a COM-server definition
 WSML: Web Service Meta Language
 COM-Reference, see Program FilesMSSOAPSOAP.CHM
 UDDI: Universal Description, Discovery, Integration
 List of available WebServices, seldomly really used
 SOAP: Simple Object Access Protocoll
 SOA: Service Oriented Architecture
Version History
 Introduction of WebServices in:
Visual FoxPro 7.0 with SOAP-Toolkit 2.0
 Current: Visual FoxPro 9.0 mit SOAP-Toolkit 3.0
 Lifecycle-Support
 Visual FoxPro 9.0 till 2014
 SOAP-Toolkit till 2013 (for VFP ONLY!)
 In the future: WebServices via INDIGO
 With WinFX as AddOn for XP as well as in Vista
 encapsulates VFP-WebServices completly in .NET
 this even includes runtime file inclusion/distribution/registration
Usefull WebServices in Apps
 Examples from the Framework Visual Extend 9.5:
 Posting of messages in Support-Forum
 Sending of error messages to error database
 Registration of users for trial version
 Orders of users (update from trial to full version)
 Download of Updates
 If Internet or WebServices (Firewalls!!!) not available
eMail is used instead…
 No WebService needed for VFX-Taskpane…
 Active FoxPro Pages used instead, see http://afp.dfpug.de
Prepare a COM-Server
 Creation option:
Multi-Threaded
COM-Server
 Minimum
1x OLEPUBLIC
 1 WebService per
OLEPUBLIC
 Max. 1 Webservice
WebService Creation
 Projektinfo Servers:
 Multi-Use
 Project Name
 Multi-Threaded and
Multi Use: needed
for Internet due to
RAM constraints!
WebService Publishing Wizard
 Call the WebService-
Builders in project 
 Check the path
 Opt. Select a class
 Opt. additional options
Extended Options
 Optionally use
extended options:
Switch to ASP
 ProjectHook
 Wsphook in
_webservices
 Save in table
FOXWS.DBF in
_FOXCODE
 Create IntelliSense-
Script
Virtual directory in IIS
 Created auto-
matically for you
 Differences
between Path,
virtual directory
and startup
directory!
 Ask you
administrator <g>.
Builder Results
 .WSDL
(Description)
 .WSML
(Meta/COM)
 Opt. additional
ASP-page
 will be called
directly
 ProjectHook for re-
generation each
time you change
Register at IntelliSense
 Register the class under Types / Web Services in the
IntelliSense- Manager
Call the WebServices
 IntelliSense creates the needed Code for you:
 and shows all methods that can be called…
What can go wrong?
 Potential problems (OLE-error messages):
 with paths:
Windows/System32
(Runtime)
 CD JUSTPATH(
_VFP.ServerName)
 Problemes with SOAPISAP.DLL (install or use ASP)
Registration of Listener (1)
 Registration of
SOAPISAP.DLL for
performant ISAPI-
Listeners:
1. Default-Website,
Properties, Home
Directory
2. Button Configuration
3. Select the extension
.WSDL
Registration of Listener (2)
 Select C:Program FilesCommon
FilesMSSoapBinariessoapisap.dll
 If not visible:
Select e.g. INI
and change it
 NOT on WinXP…
Alternate Call: SOAP-Client
 Instead of using the classes of Visual FoxPro you can
also directly access WebServices via SOAP-Client:
 Code example:
lows = NEWOBJECT("MSSOAP.SoapClient30")
lows.MSSoapInit(
"http://dlab.homeip.net/webservices/dlab.wsdl")
? lows.timechecker()
 Much easier way to call but you have to do it yourself
Integrating minimum security
 Internet Information Services
 Properties of virtual directory
 Page Directory Security
 Disable anonymous access
 Enable standard authentication
 Or extend the above code example:
lows.ConnectorProperty("AuthUser") = "username"
lows.ConnectorProperty("AuthPassword")= "password"
Type declaration important!
 Strong typing required for parameters/return value
 can only be done programmatically, see COM
 FUNCTION getnews (ldDate as Date) as String
 Re-Publish via Wizard necessary so that
<message name='hwpclass.getnews'>
</message>
 is changed to the correct new definition for you:
<message name='hwpclass.getnews'>
<part name='ldDate' type='xsd:dateTime'/>
</message>
Call COM-Server indirectly
 Create a programm to call the COM-Server
DEFINE CLASS MyCOMInterface AS Custom OLEPUBLIC
FUNCTION MyMethod (MyParm AS String) AS String
LOCAL o AS myclass
o = CREATEOBJECT("myclass")
RETURN o.MyMethod(MyParm)
ENDDEFINE
 Now you can change the COM-Server as often as you like
without having to republish it (if interface remains the same)
Creation: Release the DLL
 Computer Mgmt:
Restart IIS
 or: IISRESET at the
DOS-Prompt
 or: KILL.EXE to
remove DLL from
memory without
questions asked
In a lot of case you can have
an easier start
Multiple examples available at
http://afp.dfpug.de
Creation of AFP-Pages
 Using Visual FoxPro as a script language in HTML-
Pages with Active FoxPro Pages (AFP/AFX):
<% FoxPro-Code %>
 See examples at http://afp.dfpug.de
 Create pre-formatted HTML-tables with parameters
 Return RSS
 Return XML
 See usage examples at http://portal.dfpug.de
Web applications:
VFX–AFX Wizard
 Internet-forms via mouse click!
Prerequisites:
 VFX 9.5 and VFP 9.0 SP1
 AFX
 like ASP, but based on VFP
 IIS
 FoxPro-version under creation for AFX
Scalability:
 via AFP for multipel parallel users / AFX for 10 users
Articles
 02-16 Creation of WebServices in Visual FoxPro
 06-15 Program your Data
 06-32 Searching with WebServices
 06-35 Publish your first WebService 1
 06-36 Publish your first WebService 2
 06-37 Publish your first WebService 3
 07-16 Search with VFP in Google
 01-03 Working with WebServices in VFP7 (New18)
 Extensions of COM and WebServices in VFP 8.0
 Whats New in Visual FoxPro 7.0 Chapter 15
Additional material
 Visual FoxPro 9.0
 Update book
 Visual FoxPro 8.0
 Update book
 Articles
 FoxTalk
 FoxPro Advisor
 FoxX Professional (German)
Thank you very much!
Send questions hotline@dfpug.de
or (better) http://forum.dfpug.de
Visit our websites: http://www.dfpug.de, http://portal.dfpug.de,
http://forum.dfpug.de, http://newsletter.dfpug.de,
http://devcon.dfpug.de, http://roadshow.dfpug.de,
http://www.visualextend.de, http://www.linuxtransfer.de,
http://www.visualfoxpro.de
Riddle of the day
? CHRTRAN(CHRTRAN('S6O1 W2S634G 5789',
'6789', 'TIME()'), '12345','PAINT()')

Mais conteúdo relacionado

Semelhante a Working with WebServices.ppt

Selje_Amazing VFP2C32 Library.pdf
Selje_Amazing VFP2C32 Library.pdfSelje_Amazing VFP2C32 Library.pdf
Selje_Amazing VFP2C32 Library.pdfEric Selje
 
Developing RIAs... 10 reasons to use Adobe Flex
Developing RIAs... 10 reasons to use Adobe FlexDeveloping RIAs... 10 reasons to use Adobe Flex
Developing RIAs... 10 reasons to use Adobe FlexMatthias Zeller
 
Uncovering Windows - Silverlight Seminar
Uncovering Windows - Silverlight SeminarUncovering Windows - Silverlight Seminar
Uncovering Windows - Silverlight SeminarAbram John Limpin
 
A Microsoft primer for PHP devs
A Microsoft primer for PHP devsA Microsoft primer for PHP devs
A Microsoft primer for PHP devsguest0a62e8
 
Afik Gal @alphageeks: Flex Intro
Afik Gal @alphageeks: Flex IntroAfik Gal @alphageeks: Flex Intro
Afik Gal @alphageeks: Flex IntroAlphageeks
 
Windows Azure & How to Deploy Wordress
Windows Azure & How to Deploy WordressWindows Azure & How to Deploy Wordress
Windows Azure & How to Deploy WordressGeorge Kanellopoulos
 
Dot Net Training Dot Net35
Dot Net Training Dot Net35Dot Net Training Dot Net35
Dot Net Training Dot Net35Subodh Pushpak
 
Aspnet2.0 Introduction
Aspnet2.0 IntroductionAspnet2.0 Introduction
Aspnet2.0 IntroductionChanHan Hy
 
Development In ASP.NET by Tanzim Saqib
Development In ASP.NET by Tanzim SaqibDevelopment In ASP.NET by Tanzim Saqib
Development In ASP.NET by Tanzim Saqibguestf8f959
 
NET Event - Migrating WinForm
NET Event - Migrating WinFormNET Event - Migrating WinForm
NET Event - Migrating WinFormRaffaele Garofalo
 
XAML: One Language to Rule Them All
XAML: One Language to Rule Them AllXAML: One Language to Rule Them All
XAML: One Language to Rule Them AllFrank La Vigne
 

Semelhante a Working with WebServices.ppt (20)

Selje_Amazing VFP2C32 Library.pdf
Selje_Amazing VFP2C32 Library.pdfSelje_Amazing VFP2C32 Library.pdf
Selje_Amazing VFP2C32 Library.pdf
 
Developing RIAs... 10 reasons to use Adobe Flex
Developing RIAs... 10 reasons to use Adobe FlexDeveloping RIAs... 10 reasons to use Adobe Flex
Developing RIAs... 10 reasons to use Adobe Flex
 
Silverlight Training
Silverlight TrainingSilverlight Training
Silverlight Training
 
Uncovering Windows - Silverlight Seminar
Uncovering Windows - Silverlight SeminarUncovering Windows - Silverlight Seminar
Uncovering Windows - Silverlight Seminar
 
Php On Windows
Php On WindowsPhp On Windows
Php On Windows
 
A Microsoft primer for PHP devs
A Microsoft primer for PHP devsA Microsoft primer for PHP devs
A Microsoft primer for PHP devs
 
Web tech
Web techWeb tech
Web tech
 
Web techh
Web techhWeb techh
Web techh
 
Web tech
Web techWeb tech
Web tech
 
Web tech
Web techWeb tech
Web tech
 
Lamp Zend Security
Lamp Zend SecurityLamp Zend Security
Lamp Zend Security
 
Afik Gal @alphageeks: Flex Intro
Afik Gal @alphageeks: Flex IntroAfik Gal @alphageeks: Flex Intro
Afik Gal @alphageeks: Flex Intro
 
Windows Azure & How to Deploy Wordress
Windows Azure & How to Deploy WordressWindows Azure & How to Deploy Wordress
Windows Azure & How to Deploy Wordress
 
Dot Net Training Dot Net35
Dot Net Training Dot Net35Dot Net Training Dot Net35
Dot Net Training Dot Net35
 
Aspnet2.0 Introduction
Aspnet2.0 IntroductionAspnet2.0 Introduction
Aspnet2.0 Introduction
 
Development In ASP.NET by Tanzim Saqib
Development In ASP.NET by Tanzim SaqibDevelopment In ASP.NET by Tanzim Saqib
Development In ASP.NET by Tanzim Saqib
 
NET Event - Migrating WinForm
NET Event - Migrating WinFormNET Event - Migrating WinForm
NET Event - Migrating WinForm
 
Asp.netrole
Asp.netroleAsp.netrole
Asp.netrole
 
XAML: One Language to Rule Them All
XAML: One Language to Rule Them AllXAML: One Language to Rule Them All
XAML: One Language to Rule Them All
 
Adobe Air
Adobe AirAdobe Air
Adobe Air
 

Último

WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 

Último (20)

WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 

Working with WebServices.ppt

  • 1. Web-Services in Visual FoxPro 9.0 FoxPro User Group of German language Rainer Becker Presentation at SDN 15 Sep 2006 WEB
  • 2. Working with WebServices  Friday, 15.09.2006, 13:00 – 14:15  Visual FoxPro is most often used for rapid application development of Desktop-applications but also for Client/Server applications, both sometimes running on Terminal Services for ease of deployment.  But you can also create WebServices with this powerfull development environment without any problems!  The fast database and string functions allow the creation of fast services for distributed applications.
  • 3. Rainer Becker  dFPUG  Online offers  Loose Leaf Magazine  VFP-DevCon  VFP-Lokal/Develop  Framework Visual Extend  MVP, MCP, ISV  Wizards & Builders GmbH
  • 4. Where do I get VFP ?  Update from 6.0, 7.0, 8.0 or VS 97  Not for VFP 5.0 or older  International or US/Canada-Version  different pricing  technical identical  no problem in The Netherlands  dFPUG offers localization  we could create a Dutch version if someone is interested…
  • 5. Topics  Existing WebServices  Calling WebServices  Definitions and versions  Preparation  SOAP-Toolkit  IIS-Configuration  Additional hints  Other ways to skin a cat
  • 6. Remarks  You always need a COM-Server!  Creating COM-Servers is a different session…  Please create a COM-Server first and test it…  and maybe have a look at existing WebServices…  The calling logic in the Internet is different in general. Therefore business objects are not really usable if they are not designed for one-time-calls. Separate COM-Servers are often easier to use!  WebServices have to be strongly typed which is only optional for COM-Server, maybe create a separate PRG with  For deployment you always need a Windows Webserver in the Internet…
  • 7. Existing WebServices  Instead creating a WebService directly you should first have a look at existing WebServices, e.g.:  FoxWiki (http://fox.wikis.com)  Universal Thread (http://www.universalthread.com)  ProFox (http://www.leafe.com)  FoxCentral (http://www.foxcentral.com)  Google, Amazon, eBay, FedEx, WhoIs, CurrencyConverter, BabelFish, Headline News  dFPUG-Portal (see http://apf.dfpug.de)  dFPUG-Forum (see Visual Extend example)
  • 8. And Again: The TaskPane!
  • 9. Client for WebServices  Interactive Testing with the Taskpane  Integration into your own forms:  Open the Form  Open the Toolbox  Drag & Drop the class WebService onto the form  Select the object with the mouse  Right mouseclick for Builders  Call the XML WebService Builders
  • 11.  Enter parameters  View results as XML  View results in Grid Testing:
  • 14. Thats it for calling a WebService  Since Visual FoxPro 8.0 there are powerfull tools that support developers in calling WebServices…  Before creating your first own WebSerivce have a look…  This could easily fill a another complete session…  There are multiple articles available as well as the updatebook for Visual FoxPro 8.0!
  • 15. Definitions  WSDL: Web Service Description Language  XML-description similar to a COM-server definition  WSML: Web Service Meta Language  COM-Reference, see Program FilesMSSOAPSOAP.CHM  UDDI: Universal Description, Discovery, Integration  List of available WebServices, seldomly really used  SOAP: Simple Object Access Protocoll  SOA: Service Oriented Architecture
  • 16. Version History  Introduction of WebServices in: Visual FoxPro 7.0 with SOAP-Toolkit 2.0  Current: Visual FoxPro 9.0 mit SOAP-Toolkit 3.0  Lifecycle-Support  Visual FoxPro 9.0 till 2014  SOAP-Toolkit till 2013 (for VFP ONLY!)  In the future: WebServices via INDIGO  With WinFX as AddOn for XP as well as in Vista  encapsulates VFP-WebServices completly in .NET  this even includes runtime file inclusion/distribution/registration
  • 17. Usefull WebServices in Apps  Examples from the Framework Visual Extend 9.5:  Posting of messages in Support-Forum  Sending of error messages to error database  Registration of users for trial version  Orders of users (update from trial to full version)  Download of Updates  If Internet or WebServices (Firewalls!!!) not available eMail is used instead…  No WebService needed for VFX-Taskpane…  Active FoxPro Pages used instead, see http://afp.dfpug.de
  • 18. Prepare a COM-Server  Creation option: Multi-Threaded COM-Server  Minimum 1x OLEPUBLIC  1 WebService per OLEPUBLIC  Max. 1 Webservice
  • 19. WebService Creation  Projektinfo Servers:  Multi-Use  Project Name  Multi-Threaded and Multi Use: needed for Internet due to RAM constraints!
  • 20. WebService Publishing Wizard  Call the WebService- Builders in project   Check the path  Opt. Select a class  Opt. additional options
  • 21. Extended Options  Optionally use extended options: Switch to ASP  ProjectHook  Wsphook in _webservices  Save in table FOXWS.DBF in _FOXCODE  Create IntelliSense- Script
  • 22. Virtual directory in IIS  Created auto- matically for you  Differences between Path, virtual directory and startup directory!  Ask you administrator <g>.
  • 23. Builder Results  .WSDL (Description)  .WSML (Meta/COM)  Opt. additional ASP-page  will be called directly  ProjectHook for re- generation each time you change
  • 24. Register at IntelliSense  Register the class under Types / Web Services in the IntelliSense- Manager
  • 25. Call the WebServices  IntelliSense creates the needed Code for you:  and shows all methods that can be called…
  • 26. What can go wrong?  Potential problems (OLE-error messages):  with paths: Windows/System32 (Runtime)  CD JUSTPATH( _VFP.ServerName)  Problemes with SOAPISAP.DLL (install or use ASP)
  • 27. Registration of Listener (1)  Registration of SOAPISAP.DLL for performant ISAPI- Listeners: 1. Default-Website, Properties, Home Directory 2. Button Configuration 3. Select the extension .WSDL
  • 28. Registration of Listener (2)  Select C:Program FilesCommon FilesMSSoapBinariessoapisap.dll  If not visible: Select e.g. INI and change it  NOT on WinXP…
  • 29. Alternate Call: SOAP-Client  Instead of using the classes of Visual FoxPro you can also directly access WebServices via SOAP-Client:  Code example: lows = NEWOBJECT("MSSOAP.SoapClient30") lows.MSSoapInit( "http://dlab.homeip.net/webservices/dlab.wsdl") ? lows.timechecker()  Much easier way to call but you have to do it yourself
  • 30. Integrating minimum security  Internet Information Services  Properties of virtual directory  Page Directory Security  Disable anonymous access  Enable standard authentication  Or extend the above code example: lows.ConnectorProperty("AuthUser") = "username" lows.ConnectorProperty("AuthPassword")= "password"
  • 31. Type declaration important!  Strong typing required for parameters/return value  can only be done programmatically, see COM  FUNCTION getnews (ldDate as Date) as String  Re-Publish via Wizard necessary so that <message name='hwpclass.getnews'> </message>  is changed to the correct new definition for you: <message name='hwpclass.getnews'> <part name='ldDate' type='xsd:dateTime'/> </message>
  • 32. Call COM-Server indirectly  Create a programm to call the COM-Server DEFINE CLASS MyCOMInterface AS Custom OLEPUBLIC FUNCTION MyMethod (MyParm AS String) AS String LOCAL o AS myclass o = CREATEOBJECT("myclass") RETURN o.MyMethod(MyParm) ENDDEFINE  Now you can change the COM-Server as often as you like without having to republish it (if interface remains the same)
  • 33. Creation: Release the DLL  Computer Mgmt: Restart IIS  or: IISRESET at the DOS-Prompt  or: KILL.EXE to remove DLL from memory without questions asked
  • 34. In a lot of case you can have an easier start Multiple examples available at http://afp.dfpug.de
  • 35. Creation of AFP-Pages  Using Visual FoxPro as a script language in HTML- Pages with Active FoxPro Pages (AFP/AFX): <% FoxPro-Code %>  See examples at http://afp.dfpug.de  Create pre-formatted HTML-tables with parameters  Return RSS  Return XML  See usage examples at http://portal.dfpug.de
  • 36. Web applications: VFX–AFX Wizard  Internet-forms via mouse click! Prerequisites:  VFX 9.5 and VFP 9.0 SP1  AFX  like ASP, but based on VFP  IIS  FoxPro-version under creation for AFX Scalability:  via AFP for multipel parallel users / AFX for 10 users
  • 37. Articles  02-16 Creation of WebServices in Visual FoxPro  06-15 Program your Data  06-32 Searching with WebServices  06-35 Publish your first WebService 1  06-36 Publish your first WebService 2  06-37 Publish your first WebService 3  07-16 Search with VFP in Google  01-03 Working with WebServices in VFP7 (New18)  Extensions of COM and WebServices in VFP 8.0  Whats New in Visual FoxPro 7.0 Chapter 15
  • 38. Additional material  Visual FoxPro 9.0  Update book  Visual FoxPro 8.0  Update book  Articles  FoxTalk  FoxPro Advisor  FoxX Professional (German)
  • 39. Thank you very much! Send questions hotline@dfpug.de or (better) http://forum.dfpug.de Visit our websites: http://www.dfpug.de, http://portal.dfpug.de, http://forum.dfpug.de, http://newsletter.dfpug.de, http://devcon.dfpug.de, http://roadshow.dfpug.de, http://www.visualextend.de, http://www.linuxtransfer.de, http://www.visualfoxpro.de
  • 40. Riddle of the day ? CHRTRAN(CHRTRAN('S6O1 W2S634G 5789', '6789', 'TIME()'), '12345','PAINT()')