0

I am getting the below error for a callout with the external system soon after the after the expiry of self signed certificate in salesforce and it has been replaced with new one with the same name. Prior to the certificate expiry the callout was working fine. The error received is as follows: Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found 'http://www.w3.org/1999/xhtml:html'

Could you please help on how this issue can be debugged?

  • 2
    Can you edit your post to include your code? – Adrian Larson Sep 16 '16 at 17:46
  • May also help if you share a response sample, seeing the returned response may not be what your code is expecting. Do you understand the error message ? – Samuel De Rycke Sep 17 '16 at 10:06
  • Hi all, we are consuming a WSDL and then initiating the callout in the normal way as we do for SOAP API. This callout was working perfectly fine until the expiry of CSR Refund Request certificate (type=self signed) and its subsequent replacement with new one with the same name. No code changes or configuration changes have been done on both the sides. – SFDC Learner Sep 19 '16 at 6:20
2

This error means that your code was expecting a SOAP response, but got back an HTML response instead. Most likely a 4XX or 5XX error (e.g. not authorized, bad request, etc). Check your debug logs for errors. Consider changing the callouts debug level to "finest" (Developer Console > Debug > Change Log Levels...) so that you can see the request and response data directly in the log file. You may also need to contact your service provider/server admin to figure out what's going on.

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.