Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [apex-webservice]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1 votes
1 answer
330 views

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

I've created Connected APP - Auth Provider and Named Credentials in order to make Rest API Apex Classes : @RestResource(urlMapping='/Opportunity/*') global class RestApiIntegration { @httpGet ...
Fark's user avatar
  • 27
0 votes
0 answers
543 views

how to typecast json response into wrapper class

Below is the json response I receive from service provider. {"_embedded":{"Id":"ABC-000","itemSummaries":[{"contractId":"CO11111","...
sfdcdevsathy's user avatar
-1 votes
1 answer
2k views

How to frame a Nested JSON Payload in HTTP Post request Body in Apex.?

I wanted to frame a Nested JSON Payload as below into HTTP Post request Body in Apex and send it to external system. { "product": "Protocol products", "title": &...
Ravi Kumar's user avatar
1 vote
0 answers
62 views

Org-to-org: certificate-based authentication when calling REST APIs

I have implemented SSO among two ORGS. I have made a web services class in my service Org. Can I hit that web service from my Identity provider Org using rest callout? I tried it by making a http get ...
nischal vasisth's user avatar
0 votes
1 answer
111 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":...
Balaji Pooruli's user avatar
-1 votes
1 answer
181 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 ...
Jeff's user avatar
  • 5
1 vote
1 answer
2k 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 ...
Mustika Farma's user avatar
0 votes
0 answers
130 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 ...
sdandamud1's user avatar
  • 2,705
1 vote
0 answers
272 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 ...
Kim's user avatar
  • 11
-3 votes
1 answer
764 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 ...
jotsna gowda's user avatar
0 votes
1 answer
676 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 ....
user3499987's user avatar
0 votes
1 answer
197 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?...
GroundToCloud's user avatar
0 votes
1 answer
839 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 ...
Balaji Pooruli's user avatar
0 votes
1 answer
639 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 ...
arut's user avatar
  • 5,281
3 votes
1 answer
4k 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 ...
Nacho Zve De La Torre's user avatar
1 vote
1 answer
280 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 ...
sdandamud1's user avatar
  • 2,705
4 votes
1 answer
462 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 ...
Anmol Kumar's user avatar
  • 3,631
0 votes
1 answer
615 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\"}&...
user3652558's user avatar
0 votes
0 answers
91 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 ...
Balaji Pooruli's user avatar
0 votes
1 answer
154 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
5k 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 ...
Giorgos Galaios's user avatar
-1 votes
3 answers
1k 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: ...
ramatbis's user avatar
1 vote
2 answers
3k 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 ...
love gupta's user avatar
0 votes
1 answer
993 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 ...
Arvind's user avatar
  • 15
0 votes
2 answers
1k 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....
Ajay Choudhary's user avatar
0 votes
1 answer
513 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)...
Madhurima's user avatar
  • 1,395
1 vote
0 answers
293 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/...
Azeez's user avatar
  • 103
5 votes
1 answer
5k 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....
Richard's user avatar
  • 165
2 votes
3 answers
10k 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 ...
user42184's user avatar
0 votes
4 answers
3k 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 ...
GroundToCloud's user avatar
0 votes
1 answer
41 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 ...
ウルソイナズルジェレン's user avatar
1 vote
0 answers
3k 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 "...
Rodolfo's user avatar
  • 326
0 votes
1 answer
55 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" : ...
sagar maurya's user avatar
0 votes
1 answer
2k 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 ...
GroundToCloud's user avatar
2 votes
0 answers
387 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 ...
RobD's user avatar
  • 404
0 votes
3 answers
24k 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. ...
Student's user avatar
  • 565
0 votes
2 answers
1k 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 ...
HowToDoItInSalesforce's user avatar
1 vote
1 answer
544 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 ...
utm's user avatar
  • 552
0 votes
1 answer
3k 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 = ...
Sid's user avatar
  • 185
0 votes
1 answer
43 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> ...
awh01's user avatar
  • 141
0 votes
1 answer
442 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 ...
Balaji Pooruli's user avatar
0 votes
1 answer
921 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/...
L2018's user avatar
  • 11
2 votes
0 answers
197 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 ...
awh01's user avatar
  • 141
2 votes
0 answers
344 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 ...
SFDC's user avatar
  • 461
0 votes
2 answers
6k 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 ...
nameishi's user avatar
-2 votes
1 answer
118 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 ...
ambitiousinme's user avatar
1 vote
1 answer
1k 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 ...
Jerard Dela Victoria's user avatar
0 votes
1 answer
1k 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....
pavan kumar's user avatar
0 votes
1 answer
785 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 ...
Jayanth B's user avatar
0 votes
1 answer
400 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.
GmDeepakChounan21's user avatar