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
bs2bs2 

SObject Error When passing Custom Objects

I have an custom apex class with  2 webservice method defined as follows( i had to define these custom methods as i need to be able to provide cleint with capability of allowing partial success or not for batch inserts)
 
Webservice static void createCustomObject(sObject[] objectsToInsert,boolean trueOrFalse) {
 
        Database.Insert(objectsToInsert,trueOrFalse);   
}   
 
Webservice static void createCustomObject(CustomObject[] objectsToInsert,boolean trueOrFalse) {
 
        Database.Insert(objectsToInsert,trueOrFalse);   
}   
 
I generated the WSDL and my generated custom objects extend the generated SObject. From the java client class I call both methods and first one fails while second one is OK. Why is this happening? I need to be able to use the first one as I can pass in any custom object and reuse same method.
Any suggestions will be greately appreciated. Thx a lot