webserviceNew

Creates a web service proxy object, a reference to a remote webservice. This function is a replacement for createObject("webservice",...).

webserviceNew(url) → returns function

Member Function Syntax

This function requires Lucee 5 and up.  Not supported on Adobe ColdFusion, etc.

Argument Reference

url string
Required

URL of the Webservice

arguments struct

Additional arguments
(URL params are not allowed in url itself and must be set here)

Examples
Sample code invoking the webserviceNew function

Get country by country code and output country name

ws = webserviceNew('http://www.webservicex.net/country.asmx?wsdl');
country = ws.GetCountryByCountryCode('us');
writeOutput(XMLParse(country).NewDataSet.Table.name.XmlText);

Expected Result: United States

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub