Adding a reference to a .asmx Web service to a VBA project

Adding a reference to a .asmx Web service to a VBA project

I am doing a project in VBA. I want to add the .asmx Web service created in .NET to my Office Word 2000 VBA Application. The asmx Web service is in my virtual directory. I have already installed the Web Service Reference Toolkit in my System. However, it allows me to add only WSDL and VSDISCO files in my project as a class module but not an asmx file. How can I add a reference to the Web service in my current VBA Project?

    Requires Free Membership to View

    When you register, you'll begin receiving targeted emails from my team of award-winning writers. Our goal is to keep you informed on recent service-oriented architecture (SOA) and SOA-related topics such as integration, governance, Web services, Cloud and more.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchSOA.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSOA.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

When you add a reference to a Web service using the toolkit it will generate a local proxy class that wraps the functionality necessary to invoke the service you reference. Using the toolkit interface, you can add a reference to the .asmx file, and .NET will automatically generate a WSDL contract for the service. For example, if you type the URL to the .asmx in the browser, with a "wsdl" query string as follows:

http://www.somedomain.com/yourservice.asmx?wsdl

You'll see the service WSDL contract. You can save this WSDL contract to a file and make it available as a file from your Web site:

http://www.somedomain.com/yourservice.wsdl

and either syntax will work from the Web Services Reference Tool, Web Service URL section. This is also documented at the following MSDN link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxpwst/html/odc_ofwsrt.asp

This was first published in February 2004