I am facing the same problem .The object permission is Read/Write and public but still getting below error
System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element urn:sobject.partner.soap.sforce.com=Name
A QueryResult object is generated as part of the callout that has an element that is a list of sobjects, called sobject_x (since there's reserved word clash), so in my sobject_x subclass in my main WSDL-generated class (in this case 'PartnerMatrixWS') I add a new variable for each field I'm calling out for. Here's, I've added the Account 'BillingCity':
public class sObject_x {
public String type_x;
public String[] fieldsToNull;
public String Id;
public String BillingCity;
private String[] type_x_type_info = new String[]{'type','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
private String[] fieldsToNull_type_info = new String[]{'fieldsToNull','http://www.w3.org/2001/XMLSchema','string','0','-1','true'};
private String[] Id_type_info = new String[]{'Id','urn:partner.soap.sforce.com','ID','1','1','true'};
private String[] BillingCity_type_info = new String[]{'BillingCity','urn:partner.soap.sforce.com','ID','1','1','true'};
private String[] apex_schema_type_info = new String[]{'urn:sobject.partner.soap.sforce.com','true','false'};
private String[] field_order_type_info = new String[]{'type_x','fieldsToNull','Id'};
}
With the newly added lines being:
public String BillingCity;
private String[] BillingCity_type_info = new String[]{'BillingCity','urn:partner.soap.sforce.com','ID','1','1','true'};
Now, when I iterate through the sobject_x that are returned by the QueryResult, I can reference them directly as a property:
string soqlStatement = 'select id, BillingCity from Account'
PartnerMatrixWS.QueryResult qr =new PartnerMatrixWS.QueryResult();
qr = pmwsSOAP.query(soqlStatement);
for (PartnerMatrixWS.sObject_x obj : qr.records){
system.debug('BillingCity===============: ' + obj.BillingCity);
}
Which prints out the BillingCity returned in the query in the debug log.
ya u have to use that when u want to make a api call from one organization to other org....
Error:
Web service callout failed: Unable to parse callout response. Apex type not found for element urn:sobject.partner.soap.sforce.com=Name
I tried using the Partner Wsdl login was successful.
I can query ID on any object but when i am including other fields it is give the above error
Could be off, but may need to check the sharing/security of the object and associated WSDL (if you've written a class for it).
I am facing the same problem .The object permission is Read/Write and public but still getting below error
System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element urn:sobject.partner.soap.sforce.com=Name
Did anyone get solution with this ?
This is how I fixed it for my SF callout:
A QueryResult object is generated as part of the callout that has an element that is a list of sobjects, called sobject_x (since there's reserved word clash), so in my sobject_x subclass in my main WSDL-generated class (in this case 'PartnerMatrixWS') I add a new variable for each field I'm calling out for. Here's, I've added the Account 'BillingCity':
With the newly added lines being:
Now, when I iterate through the sobject_x that are returned by the QueryResult, I can reference them directly as a property:
Which prints out the BillingCity returned in the query in the debug log.
HTH-
Kevin
I tried this also but for this we have to hardcode the fields. Since we want to use partner wsdl I guess it isnt wise.
I am also at the same point now.. I was able to query the Account object by adding new fields in sobject_x class.
But as mentioned above, since we are using Partner WSDL , we should have a way to use generic fields.instead of any specific Object.
It would be great if there is a way to solve this problem.
Otherwise, it is not possible to use this concept for all objects...
Regards,
Chellappa