Check that the Profile of the User you are using has at least Read Acess to the sObjects you are missing. Also I believe Assets need to be enabled by enabling Products, so worth checking that Products are enabled.
Also you are missing all the standard CRM objects like Account and Contact so worth checking what type of license is assigned to your user, you would need a Salesforce (CRM) license to be able to access the CRM objects.
Additionally, similar to Assets, certain objects become available only when the associated features are enabled eg Product Schedules
Have you recently registered a namespace prefix in the Org your are running the SOQL query against? If so, you will need to add the prefix to all custom object and field names.
E.g.
SELECT abc__zAsset__c, abc__zContract__r.abc__Support_Code__c
FROM abc__ContractAsset__c
WHERE abc__zAsset__r.SerialNumber = 'ABCD'
Otherwise, from the CPAN project page you linked to I found my way over to a Github repo p5-salesforce/WWW-Salesforce. It's been many years since I've attempted anything with Perl.
I did find Constants.pm. What is really weird about that file is it has a number of custom objects and fields defined in it. E.g.
'customobject1__c' => {
'contact__c' => 'xsd:string',
'createdbyid' => 'xsd:string',
'createddate' => 'xsd:dateTime',
'field1__c' => 'xsd:string',
'lastmodifiedbyid' => 'xsd:string',
'lastmodifieddate' => 'xsd:dateTime',
'lead__c' => 'xsd:string',
'name' => 'xsd:string',
'ownerid' => 'xsd:string',
'systemmodstamp' => 'xsd:dateTime',
},
'customer__c' => {
'createdbyid' => 'xsd:string',
'createddate' => 'xsd:dateTime',
'lastmodifiedbyid' => 'xsd:string',
'lastmodifieddate' => 'xsd:dateTime',
'name' => 'xsd:string',
'ownerid' => 'xsd:string',
'systemmodstamp' => 'xsd:dateTime',
}
Perhaps you need to add any additional custom objects you want to use in that file?
That said, the error message you are getting back appears to be a standard Salesforce response when they API user doesn't have access to the sObject in question or it out right doesn't exist. I'd expect the full message to be more like:
INVALID_TYPE:
zContract__r.Support_Code__c FROM ContractAsset__c WHERE zAsset__r.SerialNumber
^
ERROR at Row:1:Column:53
sObject type 'ContractAsset__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.
Full Query: SELECT zAsset__c, zContract__r.Support_Code__c FROM ContractAsset__c WHERE zAsset__r.SerialNumber = 'ABCD'
Double check that the API user that is making the call has access to the custom objects you are querying.
Best Answer
Try below callout URL:
With Id:
It works perfect in workbench. You may be providing binding in wrong way. Check that as well.