function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
lreedlreed 

Using @Future to call webservice from Trigger

I have a trigger that calls a webservice using @future in order to send orders to a 3rd Party vendor automatically.  I receive a "Status: OK" and "Status Code: Success".  However, nothing is received by the 3rd party vendor.  We have a manual process that requires clicking a button to invoke this same web service and it works. 

Any assistance would be greatly appreciated.
PawanKumarPawanKumar
Hi Ireed,

The status is fine, but can you log & check your response XML? as sometimes middleware send error message even with Status :OK.

// Log the XML content
System.debug(res.getBody());

Regards,
Pawan Kumar
lreedlreed
I checked the response xml and there is no error.  I also compared this response xml  with the one received when I click the button and they apear to be identical..
PawanKumarPawanKumar
it's quite strange.

In order to troubleshoot , please send your request to below URL. This way we can make sure, your reuest is going outside from your salesforce instance. But Please configure Remote Site Setting with URL [https://putsreq.com/] before sending request to below URL.

https://putsreq.com/Q393aQJ1jLGiHAtaupe0

Note :The above url is nothing but simulator.

Regards,
Pawan Kumar
lreedlreed
Ok I tried this and I received "hello world"  in the repsonse body...
PawanKumarPawanKumar
you can see your request XML by using below URL. I think your request is working fine. Now you can bang on your integration team by showing this request / response and ask explanation from them. From Your side, everything is working fine.

https://putsreq.com/Q393aQJ1jLGiHAtaupe0/inspect

Regards,
Pawan Kumar