+ Start a Discussion
sathya82sathya82 

Custom Webservice

HI,

 

         I am working with a custom webservice here i want to insert multiple accounts at a time how can i develop a webservice can anyone provide sample code.

sf@143sf@143
Do you want to access the custom webservice with in the salesforce
sathya82sathya82

@sf@143

 

   Hi,

 

  actually i am getting the data from third party for that to map the third party fields i am developing a customwebservice,

 so the webservice have to access outside of sfdc.

sf@143sf@143
Global class TestWebService
{
Global webserivce static void TestMethod(sObject[] account)
{
}
}
sathya82sathya82

@sf@143

 

 

  HI,

 

      can you give me sample code for multiple account inserting and how can i map fields.

sf@143sf@143
global class TestApp
{
webservice static void AddAccount(sobject[] accounts)
{
List<Account> lstAccounts = new List<Account>();
integer i = 0;
for(sobject s : accounts)
{
Account a = (Account)s;
i = i++;
if(i == 200)
{
update lstAccounts;
i = 0;
lstAccounts = new List<Account>();
}
lstAccounts.Add(a);

}
}
}
sathya82sathya82

@sf@143

 

  HI,

 

            how can i map third party fields to account object.where should i have to map fields .

sf@143sf@143
access web method in third party app and pass the parameter for example account.name = thirdpartyobject.name
sathya82sathya82

@sf@143

 

  HI,

 

          May i know where should i want to update account.name = thirdpartyobject.name update this code in webservice program.

sf@143sf@143
in the thirdparty application you can cosume the web service right. from their you need to send the data by Creating the instance for the Account and assign the data to respective fields and send as parameter to the webserivce method
sathya82sathya82

@sf@143

 

 HI,

 

        can you calfiry me one doubt i am getting the data from third party, that records i want to insert into sfdc, for this we are decided to work with soap,

 

   1)     as per my work--> i want to develop a custom webservice and i want to give that to thirdparty, and partener,enterprise

based upon that they push the data into sfdc. this is correct procedure or not for start the soap,

 

    2)   or  third party developers develop a custom webservice they will give me wsdl.

 

    which procedure is correct  to start this integration. 1 or 2.

sf@143sf@143
As my understanding first apporach were third party is pushing data to Standard or custom objects of the salesforce object ask them to use the enterprise or partner wsdl.
sathya82sathya82

@sf@143

 

       Thanq For giving response

 

      I am getting accname.accnumber from third party may i know based upon these fields how can i implement my custom webservice.