
|
 |
 |
Introduction to the Microsoft® VBA Web
Service References Tool The Web Service
References Tool is designed to make it easier for applications
enabled with Microsoft® Visual Basic® for Applications
(VBA), such as CorelDRAW, to reference XML
Web services and quickly integrate them into custom solutions.
Within the context of creating customized applications,
it is best to think of XML Web services as prepackaged blocks
of functionality or information hosted on the Internet. The Web
Service References Tool lets developers find and select the blocks
that are best suited to a specific project. Rather than create
custom macros and add-ins from scratch, developers can use the
Web Service References tool to find and integrate equivalent XML
Web services, saving development time and money.
Say, for example, that you want to customize
CorelDRAW by adding a file conversion service. Using traditional
development methods you would have to create, test, and implement
code in order to add that custom functionality to the application.
With the Web Services Reference Tool, however, you can locate
a file conversion XML Web service that can be referenced in a
few quick steps from within the application, giving it the required
custom functionality in much less time and with much less effort.
Once you select an XML Web service, the Web
Services References tool creates a VBA proxy class that compiles
its methods and input and output parameters. You can then create
objects based on these classes and take advantage of IntelliSense,
which automatically corrects errors, and syntax checking.
Using the Web Service
References Tool
Install the Web Service References Tool from the second CD of
and the SOAP
Toolkit 2.0 SP2 redistributable files.
- Open CorelDRAW and click Tools >Visual Basic > Visual Basic Editor
- Click Tools > References.
- In the Available References list, enable
Microsoft Soap Type Library.
- Click Ok.
The Web Service References tool includes a number of important
items:
- Web Service Search area — allows you to perform an XML
Web service search using keywords or a business name against
a UDDI business registry
- Web Service URL area — allows you to search for an XML
Web service using a specific URL to WSDL or Visual Studio .NET
discovery (.vsdisco) file
- Search Results area — allows you to select available
XML Web services
- Test button — allows you to test an XML Web method you
select in the Search Results area if the method has been supplied
with a test
After you select one or more XML Web services and click Add,
the Web Service References Tool creates
- one class module (.cls) file for each selected XML Web service.
Each .cls file begins with the prefix “clsws” followed
by the name of the XML Web service. For example, if an XML Web
service is called FileConversion, the class name will be clswsFileConversion.
- one Private object variable in the .cls file. The object variable
begins with the prefix “sc” followed by the name
of the XML Web service. A private object would then be called,
for example, sc_FlightStatus.
- one Private constant in the .cls file that corresponds to
the URL of the XML Web service's WSDL. This constant is always
named c_WSDL_URL.
- one Public function in the .cls file for each Web method in
the XML Web service. The function begins with “wsm”
and is followed by the Web method's name and corresponding input
and output parameters.
For more information on integrating an XML Web
service into a custom CorelDRAW solution, please visit the Code
Samples & Downloads section.
© 2002 Corel Corporation. All rights reserved. Corel and
CorelDRAW are registered trademarks of Corel Corporation and/or
its subsidiaries in Canada, the U.S., and/or other countries.
Microsoft and Visual Basic are registered trademarks of Microsoft
Corporation in the United States and/or other countries. Other
product, font, and company names and logos may be trademarks or
registered trademarks of their respective companies.
irectly from within CorelDRAW.
|