私はSalesforceから頂いたセールスフォースでレストサービスを呼び出そうとしていますが、Salesforceから電話をかけてもうまく動作しません。 ARC Chrome、そして私が作ってうまく動作するJavaプログラムです。 最大タイムアウトを設定するとこのエラーが表示されます。common.apex.runtime.impl.ExecutionException:サーバーエイペックスから予期せぬファイルの末尾まで
common.apex.runtime.impl.ExecutionException:
頂点サーバからの予期しないファイルの終わりそして私はタイムアウトなしでそれを変更する私を与える:
予期しないエラーが発生しました:タイムアウトを読む
私は本当に何が起こっているのか分かりませんので、同じ論理スクリプトを使って別のRest Serviそれはうまく動作します。
は、これは今まで私のタラです:
@future (callout=true)
public static void SendNitrosOautIncluded(Decimal cantidadNitros, String id_cuenta) {
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Http http = new Http();
try {
map<String, Endpoint__c> endPoints = Endpoint__c.getall();
Endpoint__c endPoint = endPoints.get('PtxAddNitros');
String endPointPtx= (String)endPoint.get('Endpoint__c');
System.debug(endPointPtx+id_cuenta);
//req.setTimeout(60000);
req.setEndpoint(endPointPtx+id_cuenta);
req.setMethod('POST');
req.setHeader('Content-Type', 'application/json; charset=utf-8');
JSONGenerator gen = JSON.createGenerator(true);
gen.writeStartObject();
gen.writeNumberField('credits', cantidadNitros);
//MANAGE RESPONSE
String objSended= gen.getAsString();
System.debug(objSended);
req.setBody(objSended);
res = http.send(req);
String resp=res.getBody();
System.debug(resp);
System.debug(res.toString());
System.debug('STATUS:'+res.getStatus());
System.debug('STATUS_CODE:'+res.getStatusCode());
/* Map<String, Object> m =(Map<String, Object>)JSON.deserializeUntyped(resp);
System.debug(m);
//CONTROL DE ERRORES
String data=(String)m.get('data');
String status=(String)m.get('status');
if(status.equals('200')){
System.debug('CORRECTO');
}*/
} catch(System.CalloutException e) {
facturaDeudor.errorMessage(e);
}
}
問題はファイアウォールに関するものです。サーバーのホワイトリストにあるURLのアドレスをすべてコールアウトするようにしてください。 https://help.salesforce.com/articleView?id=000003652&type=1 – Kuidsh