Hi Willian, By looking at the error it seems this is generated from ldap.authenticate rather than ldap.init.
Please make sure you have given dn and password parameters in ldap.authenticate configuration as mentioned in [1] Further you can investigate using the source code found in [2] [1] https://docs.wso2.com/display/ESBCONNECTORS/Working+with+User+Authentication+in+LDAP [2] https://github.com/wso2-extensions/esb-connector-ldap On Sat, Apr 23, 2016 at 4:23 AM, Willian Antunes < willian.lima.antu...@gmail.com> wrote: > Chanaka, thank you very much for your tip! > > I have an issue during the execution time and I believe that the connector > maybe has a problem with its parameters for ldap.init > <https://docs.wso2.com/display/ESBCONNECTORS/Configuring+LDAP+Operations>. > During the execution of this component an error is gotten by the fault flow: > > [2016-04-22 18:08:24,089] INFO - LogMediator To: > /SampleContextLdapContext, MessageID: > urn:uuid:bd9a9e05-84eb-48d9-8cef-6eff06b6f64d, Direction: request, DEUPAU = > An error has been gotten, messageFaultError = Error occured in the > mediation of the class mediator, messageFaultCode = 0, > messageFaultException = , messageFaultDetail = > org.apache.synapse.SynapseException: Error occured in the mediation of the > class mediator at > org.apache.synapse.mediators.ext.ClassMediator.mediate(ClassMediator.java:82) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:48) > at > org.apache.synapse.mediators.template.TemplateMediator.mediate(TemplateMediator.java:97) > at > org.apache.synapse.mediators.template.InvokeMediator.mediate(InvokeMediator.java:129) > at > org.apache.synapse.mediators.template.InvokeMediator.mediate(InvokeMediator.java:78) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81) > at > org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:48) > at > org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:149) > at org.apache.synapse.rest.Resource.process(Resource.java:297) at > org.apache.synapse.rest.API.process(API.java:378) at > org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:97) > at > org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:65) > at > org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:266) > at > org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:83) > at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) at > org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:317) > at > org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:363) > at > org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:142) > at > org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) > at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at > java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at > java.lang.Thread.run(Unknown Source) Caused by: > java.lang.NullPointerException at java.util.Hashtable.put(Unknown Source) * > at > org.wso2.carbon.connector.ldap.Authenticate.connect(Authenticate.java:55)* > at > org.wso2.carbon.connector.core.AbstractConnector.mediate(AbstractConnector.java:32) > at > org.apache.synapse.mediators.ext.ClassMediator.mediate(ClassMediator.java:78) > ... 22 more > > > > > > asd > > It seems that I missed some parameter. Look at line 55 in the GitHub > <https://github.com/DImuthuUpe/esb-connectors/blob/master/ldap/ldap-connector/ldap-connector-1.0.0/org.wso2.carbon.connector/src/main/java/org/wso2/carbon/connector/ldap/Authenticate.java#L55> > and > now on a part of my XML: > > <api context="/SampleContextLdapContext" name="SampleLdapName" xmlns=" > http://ws.apache.org/ns/synapse"> > <resource methods="POST" protocol="http"> > <inSequence> > <log description="" separator=","> > <property name="Message Flow" value="LDAP SAMPLE TEST"/> > <property expression="//myvar/text()" name="myVarValue"/> > </log> > <ldap.init> > <*providerUrl*>ldap://192.168.2.10:389/</*providerUrl*> > <*securityPrincipal*>aqlbras\willian</*securityPrincipal*> > <*securityCredentials*>SamplePassword</*securityCredentials*> > </ldap.init> > > When I don't configure *providerUrl *the error occurs at line 54, it > means that the name parameter is correct for this tag but it's incorrect > for securityPrincipal tag (you can see in GitHub > <https://github.com/DImuthuUpe/esb-connectors/blob/master/ldap/ldap-connector/ldap-connector-1.0.0/org.wso2.carbon.connector/src/main/java/org/wso2/carbon/connector/ldap/Authenticate.java#L44> > to > make sure). > > Have you ever tested it or I am missing something? > > Thank you for your attention again! > > On Thu, Apr 21, 2016 at 10:55 PM, Chanaka Fernando <chana...@wso2.com> > wrote: > >> Hi William, >> >> You don't need do such hard things. >> >> 1. Create a REST API in WSO2 ESB to accept the request payload with your >> preferred path. You can refer [1] for REST support in ESB. >> >> 2. Use the LDAP connector available in WSO2 connector store at [2] to >> communicate with your LDAP. >> >> That's all you need to do. No custom code, No WSO2 AS involvement. >> >> [1] >> http://wso2.com/library/articles/2013/12/restful-integration-with-wso2-esb/ >> >> [2] >> https://store.wso2.com/store/assets/esbconnector/6e86496f-431e-43e2-bded-caedd10c4cb9 >> >> Cheers, >> Chanaka >> >> On Fri, Apr 22, 2016 at 5:14 AM, Willian Antunes < >> willian.lima.antu...@gmail.com> wrote: >> >>> Hello everyone, >>> >>> I'm used to work with Apache Camel and I'm new with WSO2 solutions. I >>> have the following requirement: >>> >>> *- Create a rest web service which receives an username and password.* >>> *- Use the parameters to authenticate in a LDAP directory and return >>> some of the user properties.* >>> >>> For Apache Camel I would use LDAP and CXF components in order to >>> implement it. Would be quiet easy. >>> >>> But how can I do with WSO2? According to my research: >>> >>> *1 - Use WSO2 AS to implement a JAX-RS which has the logic to >>> communicate with a LDAP directory (develop a pure Java code instead of a >>> component bundled).* >>> *2 - Create a Proxy (like Camel) or BPEL which will use the JAX-RS >>> previously created to deliver (or not) the LDAP user properties.* >>> >>> Am I right? Is there another way to do it? >>> >>> Thank you. >>> >>> _______________________________________________ >>> Dev mailing list >>> Dev@wso2.org >>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>> >>> >> >> >> -- >> Thank you and Best Regards, >> Chanaka Fernando >> Senior Technical Lead >> WSO2, Inc.; http://wso2.com >> lean.enterprise.middleware >> >> mobile: +94 773337238 >> Blog : http://soatutorials.blogspot.com >> LinkedIn:http://www.linkedin.com/pub/chanaka-fernando/19/a20/5b0 >> Twitter:https://twitter.com/chanakaudaya >> >> >> >> >> > > > -- > Yours sincerely, > > Willian Antunes > > _______________________________________________ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Best Regards, Malaka Silva Senior Tech Lead M: +94 777 219 791 Tel : 94 11 214 5345 Fax :94 11 2145300 Skype : malaka.sampath.silva LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77 Blog : http://mrmalakasilva.blogspot.com/ WSO2, Inc. lean . enterprise . middleware http://www.wso2.com/ http://www.wso2.com/about/team/malaka-silva/ <http://wso2.com/about/team/malaka-silva/> https://store.wso2.com/store/ Save a tree -Conserve nature & Save the world for your future. Print this email only if it is absolutely necessary.
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev