简体   繁体   中英

WSO2 API Manager - subscriber email are not in AM database

I'm working with WSO2 am and I'm customising a subscription workflow to send an email at the user who are subscribing.

But to send an email, I should get the subscriber's email. When I call the method to get this email ( subs.getEmail() ), I have nothing :

Subscriber subs = apiMgtDAO.getSubscriber(username); System.out.println(subs.getEmail());

So, I watch in the WSO2_AM database, in the table AM_SUBSCRIBER and I discover that a column for email exit but it's empty for all my users.

TENANT_ID | EMAIL_ADDRESS | DATE_SUBSCRIBED
-1234 | | 2015-03-17 14:49:24.028 -1234 | | 2015-03-20 12:33:01.084 -1234 | | 2015-03-27 16:56:23.264 -1234 | | 2015-03-27 17:04:41.459 -1234 | | 2015-04-02 14:19:46.889

it's the good way to get the user email ? It's a bug ?

If someone can help me to get the user email in a custom workflow, will be really good.

Thanks a lot

all the details of that user will be stored as user profile(which is a feature of IS used in apimanger). So by admin service call you can get the user profile of a particular user and from there you can get the email address of that user.

here[1] you can find a sample User profile management service client.

1 . https://svn.wso2.org/repos/wso2/carbon/platform/trunk/platform-integration/test-automation-framework/org.wso2.carbon.automation.api/src/main/java/org/wso2/carbon/automation/api/clients/identity/UserProfileMgtServiceClient.java

actually what they have done is, they have used the UserProfileMgtService in UserProfileMgtService.java. So you can write your own client for that service.It is an admin service with in apimager .You can find the wsdl of that service by following this doc[2]. 'https://:8280/services/UserProfileMgtService?wsdl' using that wsld create the stub and invoke the service as you want. you can find the endpoints in the url l.username and password will be the username and password of the supper admin of apimager. 2. docs.wso2.com/display/AM160/WSO2+Admin+Services

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM