@Nuwan and @Malaka, I'm using LDAP Connector <https://docs.wso2.com/display/ESBCONNECTORS/LDAP+Connector> not a endpoint mediator itself. I tried with messageType but it didn't work. Thus I tried with the following as well without success:
<property name="messageType" value="application/json" scope="axis2" type="STRING"/> <property name="ContentType" value="application/json" scope="axis2" type="STRING"/> <property name="CONTENT_TYPE" value="application/json" scope="axis2" type="STRING"/> Does it apply to Connectors? In my case wouldn't be better using Script Mediator <https://docs.wso2.com/display/ESB480/Script+Mediator> to change the LDAP answer? On Tue, Apr 26, 2016 at 5:11 AM, Nuwan Pallewela <nuw...@wso2.com> wrote: > Hi Willian, > > Do you want to change the message structure? > > If you don't need to change the message structure, you can change the > axis2 messageType property to "json/application" and esb formatters will > convert it to JSON. > Eg: > > <property name="messageType" value="application/json" scope="axis2"/> > > If you want to change the message structure you can use FastXSLT mediator [1] > and then formatter to convert it to JSON as mention above. > Performance of FastXSLT mediator in transforming messages is also better as > you can see in the [2]. > > You can find more information abount JSON support in [3]. > > [1] https://docs.wso2.com/display/ESB481/FastXSLT+Mediator > [2] > http://soatutorials.blogspot.com/2016/01/wso2-esb-performance-tuning-for-xslt.html > [3] > https://docs.wso2.com/display/ESB481/JSON+Support#JSONSupport-ConvertingapayloadbetweenXMLandJSON > > Thanks, > Nuwan > > On Tue, Apr 26, 2016 at 2:47 AM, Willian Antunes < > willian.lima.antu...@gmail.com> wrote: > >> Hello everyone, >> >> One I consult my internal LDAP using LDAP Connector to retrieve the >> details regarding some user I receive a huge response. For example (I'm >> omitting anothers groups contained in memberOf): >> >> <soapenv:Body xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"> >> <ns:result xmlns:ns="http://org.wso2.esbconnectors.ldap"> >> <ns:entry> >> <ns:dn>CN=Willian Lima Antunes,OU=Users,OU=Online,OU=DU >> Editorial,DC=aqlbras,DC=com,DC=br</ns:dn> >> <ns:displayName>Willian Lima Antunes - Tecnologia Digital - Editora >> Globo</ns:displayName> >> <ns:givenName>Willian</ns:givenName> >> <ns:mail>wantu...@willianantunes.com.br</ns:mail> >> <ns:sn>Lima Antunes</ns:sn> >> >> <ns:memberOf>CN=grupoedgfuncionarios,CN=Users,DC=aqlbras,DC=com,DC=br</ns:memberOf> >> >> <ns:memberOf>CN=EgspPRINT_6A1-new,CN=Users,DC=aqlbras,DC=com,DC=br</ns:memberOf> >> >> <ns:memberOf>CN=EgspPRINT_9A3,CN=Users,DC=aqlbras,DC=com,DC=br</ns:memberOf> >> >> <ns:memberOf>CN=EgspPRINT_8A1,CN=Users,DC=aqlbras,DC=com,DC=br</ns:memberOf> >> <ns:memberOf>CN=aws,OU=Groups,OU=Online,OU=DU >> Editorial,DC=aqlbras,DC=com,DC=br</ns:memberOf> >> <ns:memberOf>CN=Ecommerce,OU=Groups,OU=Online,OU=DU >> Editorial,DC=aqlbras,DC=com,DC=br</ns:memberOf> >> <ns:memberOf>CN=Grupo E-commerce - >> TI,CN=Users,DC=aqlbras,DC=com,DC=br</ns:memberOf> >> >> <ns:memberOf>CN=EgspUTLFILE_TRN02CP,CN=Users,DC=aqlbras,DC=com,DC=br</ns:memberOf> >> </ns:entry> >> </ns:result> >> </soapenv:Body> >> >> What is the fastest way to change it to JSON? I know a way to do it >> through Payload Factory mediator, but the work to map each value in a >> variable is hard-working and the response may vary. >> >> Can I configure to receive a JSON instead of SOAP at the LDAP Connector >> side? >> >> Any suggestions would be appreciated. >> >> Thanks. >> >> _______________________________________________ >> Dev mailing list >> Dev@wso2.org >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > ---------------------------------------------------------- > > *Nuwan Chamara Pallewela* > > > *Software Engineer* > > *WSO2, Inc. *http://wso2.com > *lean . enterprise . middleware* > > Email *nuw...@wso2.com <nuw...@wso2.com>* > Mobile *+94719079739 <%2B94719079739>@* > > > -- Yours sincerely, Willian Antunes
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev