Getting a WSDL URL

 

+

Search Tips   |   Advanced Search

 

Once you have exposed a method as a web service, you may want to access the WSDL URL programmatically in a method or using a ${Java/...} indirect reference.

You can do this by using either the getActionURL() or getURL() methods on WebAppAccess and URLMapper objects, respectively.

To return the WSDL URL for the current model:

webAppAccess.getActionURL("getWSDL")

To return the WSDL URL for another model:

webAppAccess.getURLMapper().getURL(othermodelname, "getWSDL");

Both of these methods return a relative path to the WSDL document. To create absolute paths to the WSDL document, prepend the URL for the server to the result of the method calls above:

//WSDL URL for this model
String wsdlURL = webAppAccess.getRequestData().getContextURL() + webAppAccess.getActionURL("getWSDL");

//WSDL URL for another model
String wsdlURL = webAppAccess.getRequestData().getContextURL() + webAppAccess.getURLMapper().getURL(othermodelname, "getWSDL");

You may also want create an indirect reference to a WSDL URL for a builder call input. In both cases, you use the same API calls, but with the ${Java/...} syntax. For example, you could set the Tree Data input in a Tree builder call to:

${Java/webAppAccess.getRequestData().getContextURL() + webAppAccess.getActionURL("getWSDL")}

Parent topic: Web Service Enable builder


Library | Support |