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
Arvind010Arvind010 

How to call the webservice method(with parameters as account and contact objects) using S-control?

I have an apex class with a webservice method with parameters as account and contact objects.I need to call this webservice method using S-control.I created an object in S-control and i tried to call.But it is not working.It is not even creating a log in the debug log.I dont know how to check for the error.If i use individual parameters instead of having object,it is creating account and contact.
In the webservice method i am assigning the fields.

Code:
global class SPP_Registration_WS
{
webService static String createAccountandContact(Account account,Contact contact)
Account newaccount = new Account();
newaccount.Name = account.Name;
newaccount.DBA__c = account.DBA__c;
newaccount.BillingStreet = account.BillingStreet;
newaccount.BillingCity = account.BillingCity;............
insert newaccount;
}
 This is the S-control where i am calling the webservice method

Code:
<html>
<head>
<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/11.0/connection.js"></script>
<script src="/soap/ajax/11.0/apex.js"></script>
<script>
function demo() {
Account account = new Account();
account.Name = "Salesforce";
account.DBA__c = " ";
account.BillingStreet ="xxxx";
account.BillingCity = "yyyyy";............

Contact contact = new Contact(); contact.BPAS_User_ID__c = "wwwww"; contact.Mktg_Salutation__c = " "; contact.FirstName = "aaaaa"; contact.LastName = "aaaaa";............... var result = sforce.apex.execute("SPP_Registration_WS","createAccountandContact",{account,
contact}); document.getElementById('userNameArea').innerHTML = ' ' + ' ' + result; } </script> </head> <body onload=demo()> <div id=userNameArea> </div> </body> </html>

 Please provide me the solution to call the webservice using S-control.