You need to sign in to do that
Don't have an account?
Micky M
Web Service
Hi all,
Could anyone help me, i need to call a salesforce web method from java, ive got the code to connect to salesfroce and ive genterated the jars from my wsdl's using wsc. So im at the point where i can connect and run soql statements against salesforce and get results back and process them. But i need to be able to call a web method directly rather than run soql. Does anyone have any code to do this?
Thanks
Could anyone help me, i need to call a salesforce web method from java, ive got the code to connect to salesfroce and ive genterated the jars from my wsdl's using wsc. So im at the point where i can connect and run soql statements against salesforce and get results back and process them. But i need to be able to call a web method directly rather than run soql. Does anyone have any code to do this?
Thanks
You can use the "Retrieve()" call to get a single record using the record's ID, instead of the Query() call: http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_retrieve.htm#topic-title
Another way is to write your own APEX web service methods in salesforce: https://developer.salesforce.com/page/Apex_Web_Services_and_Callouts
QueryResult queryResult = connection.query("Select id, FirstName, LastName, Account.Name from Contact WHERE AccountId != null");
but ive written some web methods in apex and i want to call those methods from java.
com.sforce.soap.DataWarehouseContractIvoicesWebservice.GetContractIvoice_element do you know what the _element bit is rather then com.sforce.soap.DataWarehouseContractIvoicesWebservice.GetContractIvoice ?
thanks
try
{
com.sforce.soap.DataWarehouseContractIvoicesWebservice.SoapConnection soap = new com.sforce.soap.DataWarehouseContractIvoicesWebservice.SoapConnection(config);
soap.setSessionHeader(config.getSessionId());
System.out.println("Session header in query invoice = " + config.getSessionId());
MCS_Contract_Recurring_Service_Invoice__c results = soap.getInvoiceDetails("a2CM0000000GGyhMAG");
System.out.println(results.getId());
}
catch (ConnectionException ex) {
Logger.getLogger(SalesforceMethods.class.getName()).log(Level.SEVERE, null, ex);
}
but im getting this error?
com.sforce.ws.SoapFaultException: No operation available for request {http://soap.sforce.com/schemas/class/DataWarehouseContractIvoicesWebservice}getInvoiceDetails
any ideas?
thanks