I've created a custom button on the opportunity layout which calls out to an external java app. It passes the session id and the partner API URL. The external app then creates a SOAP binding (leveraging the partner wsdl downloaded from Setup). The first thing I do with the binding is call SoapBindingStub.getUserInfo().

My org has the Communities feature enabled to allow partner users to log in through community portals. When I click the custom button coming from a community portal, the above fails and I see "Caused by: (411)Length Required" in the stack. It works just fine if I click the button coming from salesforce (rather than a community portal).

Any ideas what's causing the RemoteException? I'm using the same user for both scenarios. Here's the full stack trace:

Caused by: (411)Length Required at 
org.apache.axis.transport.http.CommonsHTTPSender.invoke(CommonsHTTPSender.java:218) at 
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at 
org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at 
org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at 
org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at 
org.apache.axis.client.Call.invokeEngine(Call.java:2784) at 
org.apache.axis.client.Call.invoke(Call.java:2767) at 
org.apache.axis.client.Call.invoke(Call.java:2443) at 
org.apache.axis.client.Call.invoke(Call.java:2366) at 
org.apache.axis.client.Call.invoke(Call.java:1812) at 

I'm wondering if the URL is the cause. Is there some setting/permission in communities that needs to be set in order to do this? Here are the URLS observed:

https://myCommunityDomainName.force.com/myCommunityName/services/Soap/u/28.0/00Di0000000eG2r -does not work

https://na15.salesforce.com/services/Soap/u/28.0/00Di0000000eG2r -works

2 Answers 2


Found an answer for this.

I used SOAP UI to try making these calls, and I got a more helpful error message: "API access is disabled for Communities". From there I was able to find a blog post with some details.

Apparently, when coming from a Community portal, the API.Parner_Server_URL should not be used to make API calls back to Salesforce (what?!). Salesforce support says to use the endpoint that would result from a standard salesforce user clicking the link (na15.salesforce.com/... as seen above, for example). They claim it is working as designed, which makes me wonder what the heck API.Parner_Server_URL is any good for when coming though a community portal.

Here's the blog post for reference: http://boards.developerforce.com/t5/APIs-and-Integration/API-Access-Disabled-for-Communities/td-p/644035

EDIT: See Dana's answer below; according to the author, support for this has been added as of Summer '15.

  • For some reason, security to Communities portals isn't handled the same as normal SF. SSO and other certain other protocols seem to be a version behind from what I've been reading in the docs. Its a though they released Communities just a bit before it was fully ready for prime time. I suspect we'll be seeing a lot of "new features" with each new SF release that arrives. ;)
    – crmprogdev
    Sep 6, 2013 at 18:02
  • That could be. Maybe using the URL provided through the community portal will work as expected in one of the coming releases. I hope. It seems silly to require a work-around from something like this.
    – CDelaney
    Sep 6, 2013 at 18:19
  • Did you ever have any success in actually getting this working? Did anything improve in the subsequent SF releases? Mar 7, 2014 at 0:22
  • I haven't tried since, but the Winter '14 release notes make it sound as if it is supported now. See the section titled "Improved Communities API Support" here: help.salesforce.com/help/pdfs/en/…
    – CDelaney
    Mar 8, 2014 at 1:16
  • @CDelaney, I am facing the same issue now. How did you manage to retrieve the Standard Salesforce user Api URL? Nov 3, 2016 at 1:13

I can confirm that as of Summer 15, the RESTful Identity URL returns a usable partner url:


Additionally, the API Enabled option must be selected on the community user's profile. From there I was able to access the API on behalf of a community user.

   "username":"[email protected]",
   "email":"[email protected]",
   "addr_street":"123 Some Street",

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .