Reputation: 1103
I tried to integrate linkedin with mule. I successfully authorize user and also get my profile information.
But I couldn't change my current status.. And I couldn't get user updates. I got following error
Message : Could not find a transformer to transform "SimpleDataType{type=java.lang.String, mimeType='*/*'}" to "CollectionDataType{type=java.util.List, itemType=java.lang.Object, mimeType='*/*'}".
Code : MULE_ERROR-65237
--------------------------------------------------------------------------------
Exception stack is:
1. Could not find a transformer to transform "SimpleDataType{type=java.lang.String, mimeType='*/*'}" to "CollectionDataType{type=java.util.List, itemType=java.lang.Object, mimeType='*/*'}". (org.mule.api.transformer.TransformerException)
org.mule.registry.MuleRegistryHelper:268 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transformer/TransformerException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.api.transformer.TransformerException: Could not find a transformer to transform "SimpleDataType{type=java.lang.String, mimeType='*/*'}" to "CollectionDataType{type=java.util.List, itemType=java.lang.Object, mimeType='*/*'}".
at org.mule.registry.MuleRegistryHelper.lookupTransformer(MuleRegistryHelper.java:268)
at org.mule.module.linkedin.processors.AbstractExpressionEvaluator.transform(AbstractExpressionEvaluator.java:279)
at org.mule.module.linkedin.processors.AbstractExpressionEvaluator.evaluateAndTransform(AbstractExpressionEvaluator.java:202)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
My flow is as follow
<flow name="linkedinFlow">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8090" path="auth" doc:name="HTTP"/>
<linkedin:authorize config-ref="LinkedIn" doc:name="LinkedIn"/>
</flow>
<flow name="linkedinFlow2">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8090" path="userupdates" doc:name="HTTP"/>
<linkedin:get-user-updates config-ref="LinkedIn" doc:name="LinkedIn">
<linkedin:update-types ref="#[payload]"/>
</linkedin:get-user-updates>
<json:object-to-json-transformer doc:name="Object to JSON"/>
</flow>
How can I get user user updates??
I also Tried following code
<flow name="linkedinFlow3">
<http:inbound-endpoint exchange-pattern="request-response"
host="localhost" port="8090" path="userupdates1" doc:name="HTTP" />
<linkedin:get-network-updates config-ref="LinkedIn" start="10"
count="20"
showHiddenMembers="true"
startDate="2011-08-10T00:00:00-00:00"
endDate="2015-05-10T00:00:00-00:00">
<linkedin:update-types>
<linkedin:update-type>PROFILE_UPDATE</linkedin:update-type>
<linkedin:update-type>RECOMMENDATION_UPDATE</linkedin:update-type>
</linkedin:update-types>
</linkedin:get-network-updates>
</flow>
Then I got following error
Exception stack is:
1. Access to network denied (com.google.code.linkedinapi.client.LinkedInApiClientException)
com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient:2088 (null)
2. Failed to invoke getNetworkUpdates. Message payload is of type: String (org.mule.api.MessagingException)
org.mule.module.linkedin.processors.GetNetworkUpdatesMessageProcessor:189 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
I also change the scope rw_nus+r_basicprofile but got 403 error my page didn't authenticate
If I used rw_company_admin scope I can authenticate succesfully but didn't get success in geting user updates
How can I solve this problem?please help
Upvotes: 2
Views: 283
Reputation: 1220
I am having few suggestions for this problem:
Looks like you are not passing the expected Datatype, which is a List to some endpoint, instead you are passing a String
I will suggest you try to use a transformer inside the catch exception strategy and encapsulate there the logic that would consider the input and produce a writable payload.
Also try once by replacing payload.body
instead of just payload
Upvotes: 0