O'Reilly logo

Firefox Hacks by Nigel McFarlane

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #67. Work with Mozilla WSDL Services

Want an easy way to use SOAP web services? WSDL might be the answer.

When scripting a web service with SOAP [Hack #65] , you create a proxy object in the browser to represent the object or service you're controlling on the server. Other scripts in the browser can use that proxy as if it were the actual server resource. This is an intuitive approach to web service scripting.

Creating your own proxies can be tedious, however. You must write methods to mirror all of the endpoint's methods that you plan to use. These methods will all do basically the same thing: stuff the input into SOAP parameters, invoke the SOAPCall , and extract the results. Some of this process can be abstracted, but for a web service with more than a couple of methods, you're going to spend a lot of time writing and testing your proxy.

Locate WSDL in Firefox

WSDL (Web Services Description Language) is an XML grammar to describe all of the methods, parameters, and faults (errors) of a web service. A WSDL file lists everything, including the endpoints that can be accessed, the methods available on those endpoints, the parameters and types expected by the methods, and the parameters and faults returned by the methods.

Given the URL to a WSDL file, Firefox can solve many of the tedious aspects of scripting web services for you. With just a few lines of JavaScript, it can create a complete proxy of the web service. Your scripts can then call the methods on that proxy as if they ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required