You can do this in SOAP using the external identifier field of the parent type of the object, this will allow you to send the parent and child objects in one call and bind them automatically through the external values ββof the identifier field.
here's a sample in Java that creates an account and the contact associated with it at a time. the contact is associated with the account through the extId__c field.
public static void main(String[] args) throws Exception { // login to salesforce. PartnerConnection pc = Connector.newConnection(args[0], args[1]); // The new Account record we're going to create. SObject acc = new SObject(); acc.setType("Account"); acc.setField("Name", "My New Account"); acc.setField("extId__c", UUID.randomUUID().toString()); // The new Contact record we're going to create. SObject con = new SObject(); con.setType("Contact"); con.setField("FirstName", "Simon"); con.setField("LastName", "Fell"); // This Account object we build with the relationship to the account above based // on the extId__c field, and then we set it on the contact record // this is the standard FK lookup using ExternalIds feature. SObject parentAcc = new SObject(); parentAcc.setType("Account"); parentAcc.setField("extId__c", acc.getField("extId__c")); con.setField("Account", parentAcc); // Now we can insert both records at once SaveResult [] sr = pc.create(new SObject [] { acc, con} ); printSaveResult("Account result", sr[0]); printSaveResult("Contact result", sr[1]); } private static void printSaveResult(String label, SaveResult sr) { if (sr.isSuccess()) System.out.println(label + " success recordId is " + sr.getId()); else System.out.println(label + " failed, reason is " + sr.getErrors()[0].getMessage()); }
When I run this, it prints
Account result success recordId is 0013000001DFMRxAAP Contact result success recordId is 0033000001aEgskAAC
And when I enter the web application, I can see my new account entry and the contact record with children in the corresponding list. 
source share