"HTTP Callouts" connect to a remote web server from Apex code.

learn more… | top users | synonyms

1
vote
2answers
34 views

Maintaining a reference to sObjects being upserted for subsequent related object insertion

I have a button that needs to make several webservice callouts and then use the resulting data to upsert a collection of OpportunityLineItems. For each OpportuntiyLineItem there is also a collection ...
2
votes
1answer
61 views

URL.getSalesforceBaseUrl() returns VF Subdomain URL

I'm on doing custom logs, there for I use an internal REST callout to bypass a LimitException rollback. My page: c.na15.visual.force.com/apex/TestPage Controller code: . HttpRequest req = ...
1
vote
2answers
70 views

SOAP callout fails silently

I have generated an Apex class from my WSDL successfully and was able to authenticate on the remote server by setting the HTTP Authorization header manually. I have double checked on the remote server ...
4
votes
1answer
87 views

Testing Batch Job with HTTP Callouts

Suppose I have the following: global class CMBatchRegisterUsers implements Database.Batchable<sObject>, Database.AllowsCallouts, Database.Stateful { global final String orgID = ...
2
votes
1answer
94 views

System.HttpResponse[Status=Moved Temporarily, StatusCode=302]

I am accessing an API, but when i debug the response it shows this message [Status=Moved Temporarily, StatusCode=302]. what should i do to access my required response.. my code is given below public ...
2
votes
1answer
41 views

Uncommitted Work Error with MultiStaticResourceCalloutMock

I am using the MultiStaticResourceCalloutMock to test a callout to Twitter. I am using the Test.Start/Stop to wrap the test.mock implementation which has previously fixed the issues we all had with ...
3
votes
1answer
133 views

Can you run Batch Apex after a callout?

I have a callout that is scheduled every hour to import data. Upon finishing the import, I would like to call a Bach Class that works with the imported data. Right now, I get an error saying ...
2
votes
1answer
53 views

Error in inserting a sobject in batch apex and passing the same object in webservice call

i need to Insert a List of Sobject Pass the ID of SObject that has been inserted in to a webservice call. This has to be done in Batch Apex since it needs to run on a daily basis. Now i have done ...
4
votes
1answer
175 views

Issue in callout to an external REST service over HTTPS from Salesforce

I have to make callout to an external REST service from salesforce. Service provider has shared an 'HTTPS' endpoint with me. I am able to access the service by simply pasting service endpoint in ...
3
votes
0answers
253 views

Sorting Opportunity Line Items programmatically

I've been attempting to do a purely Apex based sorting of Opportunity Line Items based on a solution I found in the Salesforce developer boards. That solution uses a combination of Javascript and Apex ...
2
votes
1answer
84 views

Do Governor limits apply to downloading files?

Governor limits include Maximum size of callout request or response (HTTP request or Web services call) - 3 MB Does this include downloading files via HTTP from external servers? Will those ...
3
votes
1answer
87 views

Iterable Batch class to page through an variable number of web service results

Is it possible to use a iterable batch job to page through a web services result set? I need to import a potentially large number of records into Salesforce via a third party web service. They ...
9
votes
1answer
153 views

Testing callout with zipped static resource

How can I access the content of a static resource zip file to create several callout mocks? I'd like to group all service responses in a single zip file without create several static resources. In ...
0
votes
1answer
197 views

Making Authenticated Web Service Callouts Using One-Way SSL

How do I make web service call out using one-way ssl. I couldn't find any documentation on this. Salesforce has given documentation for two-way ssl connection.
1
vote
1answer
163 views

Why do I get 'PKIX path building failed' exception with my callout?

Error message :PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Hello all please see the above ...
5
votes
2answers
587 views

HTTP Callout from Triggers

I have a trigger on the Custom Object that calls a class. That class makes an HTTP GET request to a Web Service. However I get the following error: Callout from triggers are currently not supported. ...
5
votes
2answers
172 views

System.CalloutException: “Algorithm missing:”

I have been getting a System.CalloutException with the message "Algorithm missing:" when I try to make a call to a specific endpoint. This is an exception that happens intermittently. For example, ...
1
vote
1answer
205 views

How to use Self-Signed CA for 2-way SSL?

I would like to use Self-Signed CA of Salesforce to build a 2-way SSL connection with my Web Server. The Web Server is built on Apache 2.2 and the 1-way SSl test is fine. In the 2-way SSL test, the ...
1
vote
1answer
99 views

What does an HTTP Response with a Status Code of -1 indicate?

I am making a web callout in a Batch Apex class and occasionally I am receiving an HTTPResponse with a StatusCode = -1 and a Status = null. Any ideas on what this indicates? Below are the entries ...
8
votes
2answers
573 views

Call webservice with NTLM authentication

Is it possible calling a webservice using NTLM authentication from apex? It is a microsoft navision webservice, I tried to do it in java following this guide and it works.
5
votes
3answers
1k views

Workaround for the 10 web service callout limit in apex?

What are the workarounds for the 10 web service callout limit in apex. If you need to make, say 50 callouts, how do you batch them so that you can execute them all asynchronously? Is there a good ...
7
votes
2answers
1k views

WebServiceMock causing “CalloutException: You have uncommitted work pending” when creating managed package

I have a number of test methods that call Test.setMock(WebServiceMock.class, new SomeWebServiceMockImpl()); where SomeWebServiceMockImpl implements WebServiceMock. These test methods pass when I run ...
1
vote
3answers
271 views

Options for callouts from triggers

I need to make some callouts from code that initiates from a trigger. I realize that you can't do a callout directly from a trigger. Currently what I do is make a future call to code that then ...
8
votes
5answers
1k views

Testing HttpCallout with HttpCalloutMock and UnitTest Created Data

We have a callout to an external webservice that requires retrieving some data from the database via SOQL and then issuing an HTTP GET request, and performing various logic based upon the response. ...
6
votes
3answers
832 views

web service callout failed error

I'm having an issue with the Address Verification method available through StrikeIron. I imported the following WSDL and am using the generated wsdl2apex code. The WSDL I'm using is here: ...
1
vote
1answer
432 views

Read timeout error calling a third party REST API

I am getting Read timeout error while calling a third party REST API. Can I catch it using try catch block? Or it is not catchable like other Limit Exceptions. Please explain.
1
vote
1answer
521 views

Forcing a test method to fail if a web service callout is attempted

When an apex test method attempts to make a web service callout something like the following is logged: 23:11:45.288 (4288851000)|EXCEPTION_THROWN|[116]|System.TypeException: Methods defined as ...
4
votes
2answers
159 views

Can I access Remote Site List from Apex?

Our application makes outbound connections to different remote sites, and installs a short list of those sites as part of the Package Installation process. One of our custom objects is a list of ...
24
votes
2answers
2k views

Has anyone, ever, successfully invoked the Metadata API from within Apex?

While researching a semi-related question posted here earlier, I dug up some interesting and conflicting information regarding whether it's even possible to use the Metadata API from within Apex. I ...
2
votes
1answer
106 views

How are wsdl2apex generated private member variables referenced?

When generating apex code through a WSDL, several classes and member variables are generated. Each data type has its own class and the class has at least two private member variables associated with ...
9
votes
2answers
453 views

How do you write a unit test for a trigger whose only function is to make a callout?

What is considered a best practice for writing a unit test (to maintain code coverage) on a trigger whose sole function is making a callout (Which also means it has to use a future method)? Neither ...