I am using Metadata API through Salesforce public site.

I am getting the following error from public site.

Web service callout failed: WebService returned a SOAP Fault: UNKNOWN_EXCEPTION: Site under construction faultcode=UNKNOWN_EXCEPTION faultactor=

Session Id is currently hardcoded. Anyone faced the same issue before?

  • 3
    Please share your code. Aug 9 '17 at 14:51
  • 1
    This can sometimes mean you're not referencing the site extension in the url, meaning using http://companyname.cs99.force.com/ when you need to be using http://companyname.cs99.force.com/publicsite Aug 9 '17 at 14:55

Adding the site prefix with '{!$Site.Prefix}' is the correct answer, but I found that creating another dummy community in salesforce with an empty path (so no /publicsite) also works. My guess is that each community site doesn't care that the site prefix matches, just that it exists.


This was because of the wrong site extension url.

By default MetaDataAPI endpoint was http://companyname.cs99.force.com/ instead of the actual site extension url http://companyname.cs99.force.com/publicsite.

I changed the EndPoint with actual site extension url and it worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.