Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [apex-webservice]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
36 views

Compare two maps and update child records

I am working on a web service callout in Apex which returns some child data for the Asset object. I can represent a class to depict the structure of the data that I am receiving. [{ "Id":...
user avatar
-1 votes
1 answer
16 views

Web service to get related opportunity Ids based on converted lead records

I am trying to setup a web service where I call to get a list of opportunity records based on converted leads from a specific source. I am trying to create a list of opportunity ids based on a SOQL ...
user avatar
  • 5
2 votes
1 answer
113 views

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

I tried make this restapex code, and tried to using SOSL to find value this is my apex code when i used SOQL and it works well. @RestResource(urlMapping='/Account/*') global with sharing class ...
user avatar
0 votes
0 answers
34 views

add custom Names space in wsdl generated from Apex soap webservice class

requirement: i need to expose the Soap service(from salesforce) and give the wsdl to client to consume/call my service. created global Apex class and webservice method : global with sharing class ...
user avatar
  • 2,517
1 vote
0 answers
49 views

Marketing Cloud Connector errors: fail to find the remote site settings

Getting this error when I select start Wizard. However, my remote site settings are there (MetaDataAPI url is in the org). When I use to set up manually (after conducting all the additional steps) it ...
user avatar
  • 11
0 votes
0 answers
41 views

Custom Apex SOAP Webservice - How to add specific namespace?

So here is a curly one... I need to create a custom SOAP webservice, that has some specific namespace attributes included and follows specific formatting. Here is what I need: I send the below request:...
user avatar
-3 votes
1 answer
236 views

inserting records using Apex Web service [closed]

The user has access to apex class.I am trying to insert accounts using apex web service. and making a callout using apex. This is my code.but it seems that the apex web service is not receiving the ...
user avatar
0 votes
1 answer
86 views

How to allow an external system to update a field on quote object after a callout [closed]

I have a question please ,i did a callout (Rest) to an externel system ,i send some informations of a quote record ,when the response is ok ,the external system will update a custom field in my quote ....
user avatar
0 votes
1 answer
40 views

API Request vs Callouts

Reference: Trailhead I understand that Apex callouts is a way to fetch data from external system. I am confused as to how API Request differ from Apex Callouts. Can someone please explain with example?...
user avatar
0 votes
1 answer
214 views

Improve code coverage on model class

I am working on a making a callout to a third party webservice that provides information about some of the fields on the Accounts. The webservice response is huge and the corresponding model class is ...
user avatar
0 votes
1 answer
686 views

I get the error "Unable to tunnel through proxy" in one sandbox and not in other sandbox

We have a button on Account and it makes a web service callout. The callout works fine in QA Sandbox but gives an error in developer sandbox. Error: IO Exception: Unable to tunnel through proxy. Proxy ...
user avatar
  • 1,004
0 votes
1 answer
231 views

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

Consider an apex class exposed as SOAP service (like the sample code shown below): global with sharing class MySOAPWebService { webservice static Account getRecord(String id) { // Add your ...
user avatar
  • 4,432
2 votes
1 answer
1k views

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

I'm trying to do the same I accomplish with postman but with Apex and I'm not being able to do so: I need to send a POST request to this example endpoint: https://cccccccccccccc/api_jsonrpc.php This ...
user avatar
1 vote
1 answer
160 views

add custom headers for my custom Soap Apex webservice

i created below custom Apex Soap Webservice then i am able to get wsdl and shared to client for call SF, but i want to add some custom headers to my apex soap webservice, so that client must be add ...
user avatar
  • 2,517
4 votes
1 answer
296 views

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

I am trying to import a WSDL in salesforce which contains Multi-part messages. Multi-part messages are not supported by the wsdl2Apex tool. The suggested workaround is to modify the WSDL to generate ...
user avatar
  • 3,229
0 votes
1 answer
180 views

JSON Generator generate the JSON with backslash

I am using the JSON Generator class to create the JSON. but in response backslash get added. Result: "{\"Id\":\"a171j000000WDQCAA4\",\"Name\":\"Q-00123\"}&...
user avatar
0 votes
0 answers
74 views

Access Named Credentials with merge fields [duplicate]

I am on a task where I need to call an external webservice that takes the username and password in the request body, not as part of Authorization header. I did setup the username and password using ...
user avatar
0 votes
1 answer
92 views

how to parse JSON response and store it on contact

{ "data":[ { "status":"found", "contact":{ "salesforceId":"{id}" "firstName": "First (first)...
user avatar
0 votes
1 answer
2k views

Apex function that returns a map

I have to call an external web service, so i created an Apex class to achieve this. However, something seems to go wrong with my return type. I want to return the response from the web service. How ...
user avatar
-1 votes
3 answers
718 views

FATAL_ERROR System.QueryException: List has no rows for assignment to SObject : Need a solution for this

I was working on the trailhead challenge https://trailhead.salesforce.com/content/learn/modules/apex_integration_services/apex_integration_webservices The Apex class AccountManager is shown below: ...
user avatar
1 vote
2 answers
2k views

HTTP callout to SOAP webservice

I am referring this trailhead unit which has below text- Apex callouts come in two flavors. Web service callouts to SOAP web services use XML, and typically require a WSDL document for code ...
user avatar
0 votes
1 answer
385 views

How to pull data from SQL Server 2016 to Salesforce [closed]

Basically I need to fetch data from SQL Server 2016 and insert fetched data into salesforce. Can we do it by writing Salesforce REST API or Web Services API without using any third party tools or ...
user avatar
  • 15
0 votes
2 answers
767 views

I am getting error Unable to retrieve object while using PageReference.getContentAsPdf() . I am getting this error only for partner community user

WebService static String send_InvoicePdf(String invid){ try{ if(String.isNotBlank(invid) ){ String query = 'SELECT '; for(String s : fields(Invoice__c....
user avatar
0 votes
1 answer
295 views

Problem with Rest Webservice Code coverage [duplicate]

I have the following set of lines in my code RestRequest req = RestContext.request; RestResponse res = RestContext.response; AreaRequestWrapper areaRequestRecord = (AreaRequestWrapper)...
user avatar
  • 1,071
1 vote
0 answers
217 views

Logic written in Platform Event Trigger doesn't work, but the same logic works from ProcessBuilder

I am using Platform Events, to fire a webservice(HTTP request) call post transaction commit, let us say Once Account is Created or Account Updated. In the process of doing so, I am able to create/...
user avatar
  • 101
5 votes
1 answer
3k views

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

Currently stuck at trying to send a JSON structure through web services but keep receiving the error: Method does not exist or incorrect signature: void send(System.HttpRequest) from the type System....
user avatar
  • 165
2 votes
2 answers
5k views

Convert base 64 to pdf and display it as PDF. Not required to save the pdf in salesforce, Directly display

When user clicks on a quick action, a soap webservice callout is made and in response we get base 64. I need to convert this base64 into PDF and display it online. I dont want to save the pdf document ...
user avatar
0 votes
3 answers
2k views

Error Handling in REST Webservice

I have exposed this Apex class as a webservice. So far so good, as I get the response when this Webservice is called from ARC or POstman. @RestResource(urlMapping='/ProcessAccount/*') global with ...
user avatar
0 votes
1 answer
33 views

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

I have this trigger which deletes the Specific Objects records on delation of a record. I wrote a test class for this but since I am a toootal Noob, I was unable to manage to cover the whole thing and ...
user avatar
0 votes
0 answers
2k views

Unable to tunnel through proxy - HTTP/1.1 503 Service Unavailable

I have built an integration in sandbox, I have deployed the web service code to production and I obtained this error: EXCEPTION: System.CalloutException: Unable to tunnel through proxy. Proxy returns "...
user avatar
  • 150
0 votes
1 answer
46 views

Web Services - Getting JSONException while handling request from External System

I have a JSON string like - String jsonInput = '{"merch" : ['+ '{"name" : "Eraser1", "description" : "desc", "price" : 2},'+ '{"name" : "Eraser2", "description" : "desc", "price" : ...
user avatar
0 votes
1 answer
971 views

STATUS_CODE returned for the response: 403 STATUS_MESSAGE returned for the response: Forbidden

Can someone please guide me how to resolve the access forbidden 403 status code error ? What can i do to at least hit the end point? I am executing the code anonymously in developer console string ...
user avatar
2 votes
0 answers
302 views

Outbound messaging, one org to another, can I reference in Apex, the class referred to by the Notifications element in the Outbound Messaging WSDL

I am trying to receive an outbound message sent from a workflow in one Salesforce org, using a SOAP webservice method in another Salesforce org. This would be a nice-to-have, if I can't get this ...
user avatar
  • 394
0 votes
3 answers
18k views

How to send Post request to Rest API with XML data

I have created a rest API(apex class) in Salesforce. I have multiple nested tags in xml that comes via API request. I am wondering how do I define my post method in apex that could handle the request. ...
user avatar
  • 555
0 votes
2 answers
455 views

How to Retrieve large data from Salesforce using Rest API?

I have one new requirement where My client wants to retrieve large data set (~80K records) from Salesforce daily. I have created rest web service but it returns only 2k records. for 80k records, do ...
user avatar
1 vote
1 answer
416 views

Understanding authentication for Apex SOAP web service

I have read this post: How authentication works in APEX and since the SF documentation is a bit confusing for me at this point I would like to ask: Is it possible to get the session id with a ...
user avatar
  • 512
0 votes
1 answer
2k views

Apex Callout HTTP POST with Named Credentials error [closed]

I am constructing something wrong, in the POST request. Please advise. Step 1: Created Named Credential called Stock_Check_For_Materials Step 2: Created Apex Controller as below Continuation con = ...
user avatar
  • 131
0 votes
1 answer
39 views

SOAP Web Service Method for two top level nodes

I have a client who needs a web service method for a 3rd party to send a SOAP call to. But this soap call has two top level nodes in the body. <body> <blockOne> <data> ...
user avatar
  • 85
0 votes
1 answer
234 views

Rest API Response - Break Address into multiple fields

I am working on an assignment where we enabled an external system to search for contacts in Salesforce based on lastName, firstName, BirthDate. I have developed a webservice which queries the Contact ...
user avatar
0 votes
1 answer
451 views

"Element invalid at this location" error in call to Apex web service

I am getting SessionID invalid after taking session id from visualforce page using {!$Api.Session_ID} I am getting the below response from workbench Element {https://soap.sforce.com/schemas/class/...
user avatar
  • 1
2 votes
0 answers
127 views

Apex SOAP WebService - how to suppress/alter accepted header

I am working with a 3rd party on SOAP integration, and they send a detailed async fault response to any POST done by us. The data they send is rigid and they say they cannot (or won't) change it. I ...
user avatar
  • 85
2 votes
0 answers
249 views

Salesforce API Integration with External Applications [closed]

What is the best way to get external Application's data on a regular interval, let's say the application am integrating has 10+ API's, all the API's data have chances of getting added/updated over ...
user avatar
  • 541
0 votes
2 answers
4k views

How to stop Read Timed Out

So I have run a apex class that makes a callout to a external application. So I triggered the callout in SFDC and I have gotten hundreds of System Exception Read Timed Out emails. I have went to ...
user avatar
-3 votes
1 answer
99 views

Salesforce webservice [closed]

I developed a custom web service using Soap . The web service is supposed to send 1900+ records which satisfied the conditions in integration. When tested it only sent 1400 records and remaining are ...
user avatar
1 vote
1 answer
709 views

Accessing a Webservice Apex Method via SOAP-UI

So I have created a simple webservice apex class that follows the second example for webservice on this link: https://developer.salesforce.com/page/Apex_Web_Services_and_Callouts#Apex_Web_Services ...
user avatar
0 votes
1 answer
970 views

How to consume external webservice

I got the requirement where I need to consume the WSDL from Workday and create/update contact records in Salesforce. Can someone of you please assist me in how to utilize a WSDL from Workday into apex....
user avatar
0 votes
1 answer
704 views

Webservice @httpPost method authentication

Quick response on this would be helpful. I'm able to send request body from Workbench as source to my org as destination for creation of records. But what i need is how to perform the same operation ...
user avatar
0 votes
1 answer
254 views

The request failed with HTTP status 400: TLS 1.1 or higher required

I'm getting an error"The request failed with HTTP status 400: TLS 1.1 or higher required." on "Add Web Reference" asp.net window. Pls, help me out this.
user avatar
1 vote
1 answer
105 views

Inserting a record after reading XML sent by external app

External app will send XML in their request to salesforce webservice class and webservice class will have to insert a object record.I have written a webservice and it is able to get the xml in string ...
user avatar
  • 1,367
0 votes
0 answers
95 views

Map key null when using getContentAsPDF() method

I have a Visualforce page that is used to generate a PDF document by our users. Recently we started experimenting with the Community License, and I'm facing an unusual error with this user. The ...
user avatar