Importing REST services using API

I want to import a service/REST service to CS using API. With service and attached wsdl it works flawlessly, but fails when importing REST service. Checked on CS 9.6, 9.7 and 9.9.

Fails on code:

WebServiceRegistrator wsr = new WebServiceRegistrator(wsdl.getAbsolutePath(), hlp.getJAXR(), importParameters, null, null);

where “wsdl” is the part to actual wsdl file.

Error when importing REST service:
WSDLException (at /wsdl:description): faultCode=INVALID_WSDL: Expected element ‘{}definitions’.
javax.wsdl.WSDLException: WSDLException (at /wsdl:description): faultCode=INVALID_WSDL: Expected element ‘{}definitions’.
at com.centrasite.jaxr.webservice.WebServiceAbstractAnalyzer.getWSDLDefinition(
at com.centrasite.jaxr.webservice.WebServiceAnalyzer.(
at com.centrasite.jaxr.webservice.WebServiceRegistrator.(

I guess WebServiceRegistrator class is not supporting REST? Should I use different class? I tried to find suitable one but no luck.
Any ideas?

Hi Radek,

Usually, REST services are not specified via WSDL, but SWAGGER or RAML.

Also, AFAIK, REST support until 9.8 is not so great.

Best regards,
Vlad Turian

Could anyone please post sample code snippet of importing REST services in CS in bulk. CS version 9.8+
If this sample exist in any documentation pointer is appreciated as well