Skip to main content
6 votes

How can I deprecate/remove a webservice method/class in a Managed Package?

AFAIK you will have to leave the class/method there and just document somewhere that it should no longer be used. But bear in mind one or more of your customers may be using it without your knowledge. ...
Keith C's user avatar
  • 137k
6 votes
Accepted

Method does not exist or incorrect signature: void send(System.HttpRequest) from the type System.HttpRequest

You instantiate an Http instance, which has the send method. Incorrect HttpResponse response = HttpRequest.send(request); Correct HttpResponse response = new Http().send(request); The HttpRequest ...
Adrian Larson's user avatar
  • 151k
6 votes
Accepted

How to return List of a list in Apex Rest Get Method Using SOSL

Don't mix responseBody and a return value. Use one or the other. It's a lot easier to use the return value, and offers more functionality for no extra effort, such as supporting XML and JSON input and ...
sfdcfox's user avatar
  • 500k
5 votes
Accepted

HTTP callout to SOAP webservice

SOAP is a specialization of REST. In other words, a programming language or tool that only understands REST can be coerced into calling a SOAP endpoint, but a tool that only understands SOAP cannot ...
sfdcfox's user avatar
  • 500k
5 votes
Accepted

How to properly send a Json in the body of a POST request?

As the documentation states, setBody accepts a String argument. In this case, you need to serialize the model. JSON2Apex payload = new JSON2Apex(...); request.setBody(JSON.serialize(payload)); I'd ...
Adrian Larson's user avatar
  • 151k
4 votes
Accepted

Understanding authentication for Apex SOAP web service

Certificate-based authentication is possible via the JWT Oauth flow, and you're on the right track vis-a-vis how to implement it (you do create a Connected App and populate a certificate there). It's ...
David Reed's user avatar
  • 93.4k
4 votes
Accepted

Apex Callout HTTP POST with Named Credentials error

You've specified the Content-Type as application/json, but you're using a application/x-www-form-encoded encoding style. You need to make sure they agree with each other. // These do not agree with ...
sfdcfox's user avatar
  • 500k
4 votes
Accepted

Error Handling in REST Webservice

I don't believe that this code can throw any system exceptions at all. If no Accounts are found, or if the input is nonsensical, the class will simply return an empty list. You need to add more code ...
David Reed's user avatar
  • 93.4k
4 votes
Accepted

Apex function that returns a map

Seems like a minor typo in your method return type declaration. public static map liveChatCallout(){ ... } to public static Map<String,Object> liveChatCallout(){ ... }
TSmith's user avatar
  • 5,062
3 votes
Accepted

Accessing a Webservice Apex Method via SOAP-UI

You also need to generate one additional Enterprise or Partner WSDL to make login request. There you will supply your credentials and will get security token in response. Next you will use that ...
Tushar Sharma's user avatar
3 votes
Accepted

Loading a file form sftp location into salesforce

SFTP is not a protocol that Apex supports. If the external service cannot serve up the content by HTTP(S) you'll need something in the middle to mediate the file transfer.
Charles T's user avatar
  • 11.1k
3 votes
Accepted

Authentication for custom Apex SOAP web service

You need to pass in a Session ID that has API access. You can get this Session ID any way you want, including SOAP login() (see Setup > Develop > API for the WSDL files), SAML authentication via ...
sfdcfox's user avatar
  • 500k
3 votes

Rollback changes after future Webservice call in after trigger

Depending on the performance hit, you will have to model it in your environment Create a long text field JSON.serialize the trigger.old value, or class representing the data you are tracking, and ...
Eric's user avatar
  • 54.3k
3 votes

Rollback changes after future Webservice call in after trigger

As you realise, the trigger's transaction will have committed before the web service response fails. So you have to move into the area of compensating transactions i.e. providing a way to undo what ...
Keith C's user avatar
  • 137k
3 votes
Accepted

Need build webhooks in Saleforce to recieve third party server alerts

Salesforce support the way to get the request and provide the response from third party sites. It is RestResource. Pre-requisite: Authentication with Salesforce.OR You can setup force.con site and ...
Ashwani's user avatar
  • 22.6k
3 votes
Accepted

How to display list values in webservice class?

accist is a list in your code and your res.Name expecting string and you are trying to assign from list to string which is not possible. You need to get first index of your list item as shown in below ...
Himanshu's user avatar
  • 10.5k
3 votes
Accepted

pass set of IDs from javascript button to a web service

Thanks Keith. It worked. Now i feel stupid. It was something so simple. Overnight, i got it to work by using JSON.stringify() in the javascript button, and then deserializing it in my batch class. ...
user123's user avatar
  • 61
3 votes
Accepted

Importing Wsdl2Apex with multiple wsdl:part in a wsdl:message

Unfortunately I don't think you are going to be able to use wsdl2apex and the corresponding WebServiceCallout.invoke() to call these multipart methods. As you have observed, the init message is ...
Daniel Ballinger's user avatar
2 votes

Salesforce - Maximum simultaneous requests callout limit

This limit is there in API 39 but has vanished from the API 40 docs. (and the crowd rejoiced)
Dave Durant's user avatar
2 votes

Webservice @httpPost method authentication

This is the way i found out to do, I tried this with postman tool. First enter the below URL with respective parameters and make a request for access token Endpoint url = https://"yourOrgInstance"....
Jayanth B's user avatar
2 votes

External Data source through apex custom adapter

These examples were the most helpful for me (examples of SF Connect custom adapters for various web services including GitHub, Google Drive, and so on): https://developer.salesforce.com/docs/atlas.en-...
moth's user avatar
  • 454
2 votes
Accepted

how to get the session Id for web service calls to salesforce

First you need to set your endpoint of your server. Endpoint URL (Sandbox)-> https://test.salesforce.com/services/Soap/u/35.0 Endpoint URL (Production)-> https://login.salesforce.com/services/Soap/u/...
Rohit Mourya's user avatar
  • 3,881
2 votes

Salesforce webservice

Odds are the problem is related to these lines: Catch( Exception ex ) { System.debug('Error:'+ex.getMessage());// Create a advanced log here } Something is breaking the the webservice and the ...
Daniel Ballinger's user avatar
2 votes
Accepted

Getting null pointer exception in webservice class?

Inside this part you should declare the creator function to instantiate the lists of the class, otherwise when you are trying to add values there you get a null pointer since the responses lists ...
Alexander Aeons Torn's user avatar
2 votes

Does Apex (SOAP) WebService use HTTP POST method by default? Does it support other methods like GET, PUT etc.?

Following is my understanding (as of today): Salesforce standard SOAP APIs adhere and support HTTP 1.1 and SOAP 1.1 GET/PUT HTTP methods are not supported for Apex SOAP web services, as these APIs ...
Anshul's user avatar
  • 2,629
2 votes

API Request vs Callouts

API Requests are inbound calls, from external systems to Salesforce (for applicable limits, check the docs). Apex callouts are outbound HTTP/Webservice calls from Apex to external systems (for the ...
user254875486's user avatar
2 votes

{"message":"This session is not valid for use with the REST API","errorCode":"INVALID_SESSION_ID"}]

I beleive this RestApiIntegrationController is getting called from UI, LWC or Aura. So when you do a UserInfo.getSessionID(), it will fetch session Id of lightning domain. Which wont work for calling ...
Nagendra Singh's user avatar
1 vote

Error Handling in REST Webservice

I have created a valid test class for your code above. However, this is not bulkified. Also I would note that you are returning a list of accounts, however, you only seem to be passing in 1 Account Id....
Bryan Anderson's user avatar
1 vote
Accepted

TestMethod Doesn't Support Web Service Call Out Error For Trigger on delete

The code that you showed doesn't have any callouts, so I assume that either your Account or Customer Todo trigger have a web service callout in it. In order to write a test class for a class that has ...
Novarg's user avatar
  • 5,284
1 vote

Web Services - Getting JSONException while handling request from External System

The problem is Salesforce supports max up to 18 digit number, including decimal points. Even, in a real-time scenario, you won't need any number which is 21 digit see 21 digits ---> (...
Rahul Gawale's user avatar
  • 12.2k

Only top scored, non community-wiki answers of a minimum length are eligible