West Wind Web Service Proxy Generator
for Visual FoxPro                                                                               

WsdlGenerator Logo

Making Web Service Calls from FoxPro Easy

Need to access Web Services from Visual FoxPro? Then you probably found that FoxPro doesn't make this task easy as native tools to call Web Services are dated and deprecated. .NET provides an up to date platform to access Web Services, but interfacing with it is not always easy from FoxPro.

The Web Service Proxy Generator makes calling Web Services from FoxPro easy by using a fully auto-generated .NET proxy as an intermediary to calling Web Services. An easy to use Wizard generates a FoxPro class and .NET proxy assembly simply by providing a URL to the WSDL service description. The Wizard does the rest. Once generated you can use a plain FoxPro class and methods to call the Web service. If you need to access more complex .NET types from the proxy for results or parameters, our .NET helper tools (wwDotnetBridge) make it easy to manipulate and access this data from FoxPro.

Here's what the wizard looks like. Enter a WSDL URL, press Resolve to lookup the service definitions, then press Generate to create the FoxPro and .NET proxies:

Once generated, you can integrate the proxy into your FoxPro code as easy as this:

Usage Example

Web Service Proxy Generator Features

  • Works with complex Web Services
  • Uses an easy to use Web Service Wizard to create your service proxy
  • Creates .NET Web Service Proxy Assembly (pre-compiled and optional source code)
  • Creates a FoxPro Web Service Proxy class as a plain PRG file
  • Provides for Service Error trapping
  • Provides wwDotnetBridge to allow easy access to .NET code
  • Provides for simplified .NET type handling (Arrays, DataSet, Binary types, Statics, Generics,Structures)
  • Provides ComArray wrapper to manipulate .NET Arrays easily from FoxPro
  • Works with .NET types not supported natively through COM Interop
  • Lets you browse the generated .NET assembly with .NET Reflector
  • Requires no .NET code or use of Visual Studio
  • Requires no COM registration of .NET components
  • Works with just about any SOAP 1.x service. Note: Does not support WS* services.

Using this tool is a snap and you can be up and running making Web Service calls reliably in minutes.

How it works

The Web Service Proxy Generator lets you access most SOAP 1.x Web services. It works by using the .NET WSDL client generator tool create a .NET Web Service client Proxy which is then accessed from Visual FoxPro using wwDotnetBridge. The idea is that you can use the rich support of the .NET WSDL client generator tool (WSDL.exe) to generate the .NET proxy and then call it from Visual FoxPro. The Proxy Generator facilitates this process by creating a FoxPro proxy client class that maps each of the methods in the .NET proxy generated. The FoxPro proxy code generated uses wwDotnetBridge to provide the FoxPro to .NET interoperability in order to avoid COM registration of components and allow easier access to complex types supported by .NET and that are exposed in common Web Service scenarios.

The process of calling a service is very simple:
LOCAL loProxy as WebStoreServiceProxy
loProxy = CREATEOBJECT("WebStoreServiceProxy")

*** Call a Service method
loItem = loProxy.DownloadInventoryItem("WWHELP40")

*** Create a new item -  use full .NET typename (look up in Reflector)
loItem = loProxy.oBridge.CreateInstance("WebStoreService.wws_itemsRow")
loItem.Sku="NEWITEM"
loItem.Descript = "New Item Added from Client"

lcResult = loProxy.UploadInventoryItem(loItem) 

*** Retrieve an array of items
loItems = loProxy.DownloadInventoryItems("")

*** Result is a ComArray object - wrapper around a .NET array
? loItems.Count

*** .NET Arrays are 0 based so count from 0
FOR lnX = 0 to loItems.Count -1
    loItem = loItems.Item(lnX)
    ? loItem.Sku + " - " + loItem.Descript
ENDFOR

*** Update an item
loItem = loItems.Item(0)
loItem.Descript = loItem.Descript + " Updated"

*** Upload changed array back to the service
loProxy.UploadInventoryItems(loItems)

The Web Service Proxy Generator Wizard

One of the main features of this tool is an automating Wizard that creates a .NET proxy assembly from the specified Web Service and a FoxPro PRG class that calls this .NET component without requiring COM registration as shown above.

This tool automates the creation of Web Service clients utilizing the .NET framework called from Visual FoxPro to make SOAP/WSDL Web Service calls. It provides a Wizard (and class interface) that auto-generates the .NET Proxy Web service assembly to handles the Web Service interaction. It also creates a Visual FoxPro proxy class that maps each of the Web Service methods to a FoxPro method that can then be called to interact with the Web service. The base service implementation is provided as a simple FoxPro class in a PRG file that can be used in your applications. You simply include the PRG file plus a couple of DLLs and FoxPro classes and you're on your way.

Easy Generation - Easy Usage

Once generated easy tools let you browse the generated .NET assembly and FoxPro class, as well as provide you an easy way to create a ready-to use set of files that can be integrated into your own application. All files are self contained and no extra registration is required to run the Web Service - simply copy the files into your project and reference them with SET PROCEDURE TO (or DO YourServiceProxy.prg) You don't need to write any .NET code or use Visual Studio - the Wizard manages the .NET and FoxPro proxy generation for you. We've also provided a quick way to browse the generated .NET assembly for discovery of the Web Service message types (ie. objects used as parameters or return values) that usually go along with the actual service implementation class.

wwDotNetBridge - Calling .NET without COM Registration

wwDotnetBridge allows access to .NET components without requiring them to be registered in the registry. This powerful tool hosts the .NET runtime in Visual FoxPro and then loads .NET types from within this runtime. wwDotnetBridge also   provides a host of helper functions that allow access to any .NET type and feature like static method invokation, enumeration access, array management, DataSet to XmlAdapter mapping and conversion of many common types to and from .NET types. Using wwDotnetBridge greatly facilitates creating .NET type instances of Web Service related objects and manipulating them from Visual FoxPro.

Limitations

This tool works with SOAP 1.1 and SOAP 1.2 Web Services and should be able to access just about any service you throw at it. .NET's WSDL technology can successfully import just about any SOAP 1.1 and 1.2 service and work with them without issues, but there may be some oddball service implementations (especially old some Java Services) that don't work using the generic tools. In these rare cases manual importing and generated service proxy fixup may be required.

The Proxy Generator does not work with WS-* Web Services. WS-* services are extended SOAP services that use certificates, custom headers, digital signatures and various other security and verification protocols as part of Web Service calls (collectively known as WS* protocols). Services that use these features are not supported by the .NET WSDL importer used by this tool, and even if it did they would be too complex for generically generated solution. It's recommended you use Windows Communication Foundation (WCF) as a client in .NET and manually interface FoxPro via COM Interop or wwDotnetBridge.

We can help

If you need help with any custom Web Service integration scenario we can help you with custom consulting to provide guidance or support. We specialize in trouble shooting and integration of Web Services both from FoxPro and .NET code for accessing and also for publishing of Web Services.

Try it out for Yourself

If you're accessing Web Services with Visual FoxPro, .NET is a safe choice for making sure you are building service clients that are future proof. Unlike the obsolete SOAP Toolkit or even our own wwSoap, .NET is updated frequently to support the latest Web Service standards. The proxy generator lets you take advantage of this standard platform to handle complex Web services with relative ease.

Check out this tool - it's a big time saver if you need to build Web services and don't want to figure out the technology and interaction from scratch. Download now.

If you want a deeper understanding of how Web Service interaction between FoxPro and .NET works you can read our Whitepaper on the subject which shows the traditional way of accessing Web services through .NET. Using the Proxy generator automates the processes described in this article drastically.

Download the shareware copy of the Proxy Generator and try it on your Web Services today and see how quick and easy Web Service access from FoxPro can be...

 


© West Wind Technologies, 2004-2014

newVersion 1.30 - Sept 30th, 2014
Download the latest version of the Web Service Proxy Generator. The shareware version is fully functional, but pops up shareware nag screens.
This tool requires .NET Framework Version 2.0 or later.
To remove nag screens and redistribute the generated components with your own applications, register in our online store.
The full documentation for these tools are available online. You can also find this documentation provided as a CHM file with the full download of the toolkit. You can also watch the video walk through that demonstrates the core features.