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
BonaaBonaa 

CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element Name

Web service callout failed: Unable to parse callout response. Apex type not found for element Name
I am getting the above error when i tries the query() SOAP API Function
Code:
partnerSoapSforceCom.soap con = new partnerSoapSforceCom.soap();
con .SessionHeader = new partnerSoapSforceCom.SessionHeader_element ();
partnerSoapSforceCom.loginResult  loginResult = new partnerSoapSforceCom.loginResult();
loginResult =con.login('********************','*****************************');
con.endpoint_x =loginResult.ServerUrl;
con.Sessionheader.sessionid = loginResult.sessionid;
partnerSoapSforceCom.queryResult qr = new partnerSoapSforceCom.queryResult ();
qr=con.queryAll('SELECT Id,Name FROM Contact Limit 1');

if query is with ID only its not throwing the error.I tried the same from SoapUI.It works fine.
Error:EXCEPTION: System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element Name
Andy BoettcherAndy Boettcher
If you're trying to access your org's data, use the Enterprise API - not the Partner API.
Rajesh DhawanRajesh Dhawan
I am getting the same issue. If I pass the Id it doesnt throw the error. With other fields, it errors out.
I tried setting the soap request as a String and calling a HTTP request by setting all the headers and it works fine.