在搜索中使用 Mule ESB 的 LDAP 连接器获得一致的响应



我正在尝试使用Mule ESB的LDAP连接器。我能看到一些结果,但我无法对此做任何事情,因为回复没有任何形式。

我想做的是将响应转换为某种CSV,但这不是主要问题。

我的主要问题是我不知道如何处理我的回复——网上没有太多关于这方面的信息。

这是我回应的一部分,这是机密信息,所以我不能透露太多,但你会明白的。

��sr java.util.ArrayListx����一�Isizexp w sr"org.mule.module.ldap.api.LDAPEntry���5.���L属性测试。Lorg/mule/module/ldap/api/LDAPEntryAttributes;LdntLjava/lang/String;xpsr,org.mule.module.ldap.api.LDAPEntryAttributesf�&f�Lattributest Ljava/util/Map;xpsrjava.util.HashMap���`�FloadFactorI阈值xp@w tstreetaddresssr6org.mule.module.ldap.api.LDAPSingleValueEntryAttribute"�k�eLaluetLjava/lang/Object;xr+org.mule.module.ldap.api.LDAPEntryAttribute�C�ؠJ�Lnameq~xpt街道地址85,街道iashdapsdpostalcodesq~t邮政编码邮政编码mailsq~q~tuser.user@org.orgttitlesq~q~t标题物理交付办公室名称q~t物理交付办公室名tPLACETsnsq~t名称departmentsq~q~#t服务givenname q~t givenName用户名sq~*t城市tsq~q~-tSTATEt电话号码sq~t电话号码t9789 987 987xtACN=姓氏,OU=myou,OU=myou,OU=myou,DC=mydc

以下是我的流程:

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:wmq="http://www.mulesoft.org/schema/mule/ee/wmq" xmlns:http="http://www.mulesoft.org/schema/mule/http"
    xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ldap="http://www.mulesoft.org/schema/mule/ldap"
    xsi:schemaLocation="http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/ldap http://www.mulesoft.org/schema/mule/ldap/current/mule-ldap.xsd
http://www.mulesoft.org/schema/mule/ee/wmq http://www.mulesoft.org/schema/mule/ee/wmq/current/mule-wmq-ee.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd">
    <ldap:config name="ldapConf" url="ldap://host.host.host:389/" authDn="user@host.host" authPassword="secret" doc:name="LDAP"/>
    <flow name="activedirectoryGetUsers">
        <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP (Deprecated)" path="activeDirectory"/>
        <ldap:search config-ref="ldapConf" doc:name="LDAP" baseDn="OU=myOu,DC=myDC, DC=myDC" filter="(&amp;(objectClass=user)(Company=*mycompany))" scope="SUB_TREE">
        <ldap:attributes>
                <ldap:attribute>dn</ldap:attribute>
                <ldap:attribute>GivenName</ldap:attribute>
                <ldap:attribute>sn</ldap:attribute>
                <ldap:attribute>mail</ldap:attribute>
                <ldap:attribute>telephonenumber</ldap:attribute>    
                <ldap:attribute>Department</ldap:attribute> 
                <ldap:attribute>Title</ldap:attribute> 
                <ldap:attribute>physicalDeliveryOfficeName</ldap:attribute> 
                <ldap:attribute>l</ldap:attribute>     
                <ldap:attribute>st</ldap:attribute>
                <ldap:attribute>postalCode</ldap:attribute>
                <ldap:attribute>streetAddress</ldap:attribute>                     
        </ldap:attributes>          
    </ldap:search>
    </flow>
</mule>

谢谢你的帮助。

您收到的是org.mule.module.ldap.api.LDAPEntryList,这正是用户指南中所期望的:

<ldap:search>

执行LDAP搜索,返回包含所有结果LDAP条目的列表。

然后,可以使用变换器或组件中的MEL表达式处理该列表,或者使用collection-splitter拆分该列表,或使用for-each作用域迭代该列表。

最新更新