I've created my custom service, defined the xsd and generated the classes using xjc , but when I run the lsc.bat file I get an error in my service, stating that the configuration cannot be cast to the service type.
I can get a breakpoint to trigger inside my service so I know it's being called but it seems the configuration parser is not being able to determine the correct type. Here's what I've set, based on obm example: <lsc xmlns="http://lsc-project.org/XSD/lsc-core-2.1.xsd" xmlns:cs=" http://www.mycompany.com/XSD/lsc-mycompany-plugin-1.0.xsd" revision="0"> ...... <pluginDestinationService implementationClass="main.java.com.mycompany.lsc.service.MyCompanyApiService"> <name>mycompany-user-dst</name> <connection reference="mycompanyRestApi" /> <cs:mycompanyUserService> <name>callsign-user-ds2</name> <connection reference="mycompanyRestApi" /> <cs:writableAttributes> <string>commonname</string> <string>hidden</string> <string>id</string> <string>lastname</string> <string>mails</string> </cs:writableAttributes> </cs:mycompanyUserService> </pluginDestinationService> The exception is thrown here: public class MyCompanyApiService implements IWritableService { protected static final Logger LOGGER = LoggerFactory.getLogger(MyCompanyApiService.class); private final MyCompanyService service; private final Class<IBean> beanClass; private final PluginConnectionType connection; private final MyCompanyRestApiDao mycompanyDao; /** * Create the service * @param task the task in which the source service settings will be used * @throws LscServiceConfigurationException * @throws LscServiceCommunicationException */ @SuppressWarnings("unchecked") public MyCompanyApiService(final TaskType task) throws LscServiceConfigurationException, LscServiceCommunicationException { try { List<Object> serviceList = task.getPluginDestinationService().getAny(); if (serviceList == null || serviceList.size() != 1 || !((serviceList.get(0) instanceof CallsignUserService))) { throw new LscServiceConfigurationException("Unable to identify the service configuration " + "inside the plugin source node of the task: " + task.getName()); } ... serviceList length is 1 and contains the pluginDestinationService. Can it be due to the xsd url doesn't exist? But I've checked the one in OBM sample and it also returns 404. I'm not very confortable working with XSD and JAVA (.Net background) so any guidance is greatly appreciated. Thank you On Wed, Mar 23, 2016 at 11:05 AM, Gustavo Castelo <[email protected] > wrote: > Le 23/03/2016 10:38, Gustavo Castelo a écrit : > > >* Hi everyone, > *>>* I'm trying to setup a proof of concept between an LDAP instance and a > *>* rest API. > *>* I've read all the documentation on the site but haven't been able to > *>* find any information regarding support for REST APIs, so I take that I > *>* have to create a plugin to this. > *>>* That's fine, but there isn't much info, or an examples, on how to > *>* create one. I downloaded the 3 plugins to check out the code, but > *>* they're in Pearl. I can look into the jar files but I take it > *>* shouldn't be this hard? > *>>* Can you point me in the right direction on how to do this? > *>> You should look at OBM plugin source code:> * > http://lsc-project.org/wiki/documentation/plugins/obm> * > > http://tools.lsc-project.org/projects/lsc/repository/show/plugins/trunk/connectors/obm > > -- > Clément OUDOT> Consultant en logiciels libres, Expert infrastructure > > et sécurité> Savoir-faire Linux > > > That seems to do what I want. I'll have a look. > > Thank you Clément > > > On Wed, Mar 23, 2016 at 9:38 AM, Gustavo Castelo < > [email protected]> wrote: > >> Hi everyone, >> >> I'm trying to setup a proof of concept between an LDAP instance and a >> rest API. >> I've read all the documentation on the site but haven't been able to find >> any information regarding support for REST APIs, so I take that I have to >> create a plugin to this. >> >> That's fine, but there isn't much info, or an examples, on how to create >> one. I downloaded the 3 plugins to check out the code, but they're in >> Pearl. I can look into the jar files but I take it shouldn't be this hard? >> >> Can you point me in the right direction on how to do this? >> >> Best regards, >> >> > > > -- > Gustavo Castelo > AcrossGadget Unipessoal Lda > +351 91 1182566 > -- Gustavo Castelo AcrossGadget Unipessoal Lda +351 91 1182566
_______________________________________________________________ Ldap Synchronization Connector (LSC) - http://lsc-project.org lsc-users mailing list [email protected] http://lists.lsc-project.org/listinfo/lsc-users

