Questions tagged [apex-webservice]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
26 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 ...
0
votes
0answers
13 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 ...
0
votes
1answer
35 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 ...
2
votes
1answer
90 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 ...
0
votes
1answer
28 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 ...
4
votes
1answer
142 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 ...
0
votes
1answer
82 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\"}&...
0
votes
0answers
37 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 ...
0
votes
0answers
28 views

Salesforce CPQ: Quote Calculation issue using custom webservice

I have create the custom web service to create the quote and quote line items from postman call in Salesforce CPQ. I am able to create the quote and quote line items but my requirement is after quote ...
0
votes
1answer
40 views

how to parse JSON response and store it on contact

{ "data":[ { "status":"found", "contact":{ "salesforceId":"{id}" "firstName": "First (first)...
0
votes
1answer
133 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 ...
-1
votes
3answers
227 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: ...
0
votes
2answers
560 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 ...
0
votes
1answer
63 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 ...
0
votes
2answers
217 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....
0
votes
1answer
116 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)...
1
vote
0answers
130 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/...
5
votes
1answer
1k 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....
2
votes
2answers
1k 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 ...
0
votes
3answers
228 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 ...
0
votes
1answer
23 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 ...
0
votes
0answers
1k 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 "...
0
votes
1answer
39 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" : ...
0
votes
1answer
662 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 ...
2
votes
0answers
155 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 ...
0
votes
3answers
9k 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. ...
0
votes
2answers
152 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 ...
1
vote
1answer
334 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 ...
0
votes
1answer
683 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 = ...
0
votes
1answer
32 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> ...
0
votes
1answer
127 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 ...
0
votes
1answer
239 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/...
2
votes
0answers
99 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 ...
2
votes
0answers
238 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 ...
0
votes
2answers
2k 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 ...
-3
votes
1answer
90 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 ...
1
vote
1answer
561 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 ...
0
votes
1answer
889 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....
0
votes
1answer
584 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 ...
0
votes
1answer
235 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.
1
vote
1answer
88 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 ...
0
votes
0answers
72 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 ...
1
vote
1answer
1k views

External Data source through apex custom adapter

I want to connect the external database from salesforce. I have developed the custom adapter (DataSource.Connection class and DataSource.Provider class). In connection class, Sync method is working ...
0
votes
1answer
4k views

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

I have implemented a web service in salesforce and generated the WSDL for the web service and provided it to the external system. However while invoking a call, we need to pass the session id in teh ...
0
votes
1answer
110 views

Loading a file form sftp location into salesforce

I am working on a scenario where the file needs to be picked up from a SFTP server and loaded into salesforce. Can salesforce web service pick up a file from sftp location and load it into salesforce?...
3
votes
1answer
2k views

Authentication for custom Apex SOAP web service

I am in the process of creating a custom SOAP apex web service using webservice keyword so that external system can call this apex web service. I am not using Apex REST. From the class I can create ...
4
votes
1answer
564 views

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

We have completely changed the way a managed package operates and no longer want a legacy global webservice method. I don't want it to be included in future packages/installs. However, I can't seem to ...
0
votes
1answer
34 views

Checking Users credentials against AD while they are logged in

I am looking to get some suggestions on the best solution for following requirement. Any help will be appreciated. Requirement is to capture user's name using their AD credentials (they will be ...
0
votes
1answer
211 views

Execution of Javascript inside a Custom Button is deferred till the end of function

We display inside a tab in the Sales Console a custom object page layout with a custom Javascript button. Once the user clicks on that button, the custom code performs some operations on a Salesforce ...
2
votes
0answers
3k views

Trailhead Data Integration Specialist Superbadge || Test Class is Failing

I wrote the below test classes - @isTest global class ProjectCalloutServiceMock implements HttpCalloutMock{ global HttpResponse respond(HttpRequest req){ System.Debug('--++-- Inside ...