Software AG Products 10.11 | CentraSite for Developers | Importing Objects Using API | Invoking Importer from Java Program | Importing Web Service
 
Importing Web Service
 
Setter Methods
Importing Web Service from URL
The basic input when importing a web service is a WSDL file describing one or more services. There are also some setter methods for additional parameters out of which the organization (per object or per name) parameter must be set while other parameters are optional. If a WSDL imports includes WSDLs or schemas, then the referenced files are also imported and the according CentraSite objects will be created.
The following example illustrates how to register a web service to CentraSite:
import com.centrasite.jaxr.JAXRAccessor;
import com.centrasite.jaxr.webservice.WebServiceRegistrator;
 
String dbURL = "http://localhost:53307/CentraSite/CentraSite";
String organizationName = "MyOrganization";
String wsdlFile = "c:/temp/MyService.wsdl";
String user = ...;
String password = ...;
 
JAXRAccessor jaxr = new JAXRAccessor(dbURL, user, password);
 
try
{
WebServiceRegistrator wsr = new WebServiceRegistrator(wsdlFile, jaxr);
wsr.setOrganization(organizationName);
wsr.register();
}
catch (Exception e)
{
// handle error
}
finally
{
jaxr.close();
}