function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Apex SOAP Callouts - Web service callout failed

Could you guys tell me how to fix this issue? I appreciate any tip in advanced, thank you very much. I would like to describe the issue as below

I have tried the example in Trailhead for Apex SOAP Callouts.

Downloaded this xml file:

Added this end point to remote site too:

But unfortuanlly, when I ran the sample code, I got this error: 
Line: 142, Column: 1
System.CalloutException: Web service callout failed: Unexpected element. Parser was expecting element '' but found ':html'

Follow the error log, I got this explaination: 
20:59:09:000 CALLOUT_RESPONSE               <p>There is no app configured at that hostname.<br/>Perhaps the app owner has renamed it, or you mistyped the URL.</p>

User-added image
SandhyaSandhya (Salesforce Developers) 

You say that you are trying Apex SOAP call outs, but Animalscallout class is in REST call out example.And you are getting an error for Animalscallout class.

Please check if you have done  Authorize Endpoint Addresses step.

Hope this helps you!

Please mark it as solved if this helps you so that it will make available for others as a proper solution.

Thanks and Regards
Hi Sandhya, thank you for you reply, the background class in image AnimalCallouts wasn't the target. I was trying to run the following code in Execute Anonymous Window
calculatorServices.CalculatorImplPort calculator = new  calculatorServices.CalculatorImplPort();
Double x = 1.0;
Double y = 2.0;
Double result = calculator.doAdd(x,y);

I am really sorry for the misunderstand image. 
This issue have fixed for both calculator sample and challenge by change the end point in the related apex classes which is generated by WSDL. 
(the same for trail head challenge in case anyone meet the same issue like me)