Abhijith12 / linkedin-j

Automatically exported from code.google.com/p/linkedin-j
0 stars 0 forks source link

Problem with posting share #77

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi!

I have been using linkedin-j lib for publishing message from our application 
for last 6 months without any problem. Suddenly i started getting the following 
exception while posting a shared message.

com.google.code.linkedinapi.client.LinkedInApiClientException: Internal API 
server error
 [STDERR]  at com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient.createLinkedInApiClientException(BaseLinkedInApiClient.java:3906)
2011-11-04 10:25:05,906 ERROR [STDERR]  at 
com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient.callApiMethod(Base
LinkedInApiClient.java:3846)
2011-11-04 10:25:05,906 ERROR [STDERR]  at 
com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient.postShare(BaseLink
edInApiClient.java:1936)
2011-11-04 10:25:05,906 ERROR [STDERR]  at 
com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient.postShare(BaseLink
edInApiClient.java:1901)
2011-11-04 10:25:05,907 ERROR [STDERR]  at 
biz.whispir.wsdl.services.linkedin.LinkedInPush.doPush(LinkedInPush.java:142)
2011-11-04 10:25:05,907 ERROR [STDERR]  at 
biz.whispir.wsdl.services.linkedin.LinkedInPush.processPush(LinkedInPush.java:61
)
2011-11-04 10:25:05,907 ERROR [STDERR]  at 
biz.whispir.wsdl.services.linkedin.LinkedInPush.execute(LinkedInPush.java:37)
2011-11-04 10:25:05,907 ERROR [STDERR]  at 
biz.whispir.wsdl.services.push.PushService.executeInternal(PushService.java:26)
2011-11-04 10:25:05,907 ERROR [STDERR]  at 
org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:8
6)
2011-11-04 10:25:05,908 ERROR [STDERR]  at 
org.quartz.core.JobRunShell.run(JobRunShell.java:203)
2011-11-04 10:25:05,908 ERROR [STDERR]  at 
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)

my code is as follows

LinkedInApiClientFactory factory = 
LinkedInApiClientFactory.newInstance(companyFeedSettingsWS.getConsumerKey(),comp
anyFeedSettingsWS.getConsumerSecret());
        LinkedInApiClient client = factory.createLinkedInApiClient(companyFeedSettingsWS.getToken(),companyFeedSettingsWS.getTokenSecret());

client.postShare(messageBody, "", "", null, VisibilityType.ANYONE);

Please let me know if i need to change some thing with the code

Original issue reported on code.google.com by qatadaAb...@gmail.com on 3 Nov 2011 at 11:28

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
This is a problem with how an empty <content> element is interpreted by 
LinkedIn. It's a bug in their system, but since they've been unwilling to 
address it, it's probably easier to deal with in the client code.

This produces an error:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<share>
<content/>
<visibility>
<code>anyone</code></visibility>
<comment>My Comment</comment>
</share>

This does not:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<share>
<visibility>
<code>anyone</code></visibility>
<comment>My Comment</comment>
</share>

Original comment by teropaan...@gmail.com on 9 Dec 2011 at 10:09