Salesforce Rest API (upsert): System.Web.Services.Protocols.



我间歇性地遇到这个问题,但并非针对每个请求。你能帮我这个吗?以下是我向 salesforce rest API 发送请求的代码:

loginResult = _sfCachingManager.GetLoginResult();
if (_loginResult != null && _loginResult.userInfo != null)
{     
_sforceService.Url = _loginResult.serverUrl;
_sforceService.SessionHeaderValue = new SessionHeader();
_sforceService.SessionHeaderValue.sessionId = _loginResult.sessionId;
Account account = _sfModelMapping.AccountMapping(agency);
UpsertResult[] result = _sforceService.upsert("Agency_ID__c", new sObject[] { account });

有时,当我尝试发送请求时,它会生成异常:

System.Web.Services.Protocols.SoapException: EXCEEDED_MAX_SIZE_REQUEST:未经身份验证的请求大小太大,位于 System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall( at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters(

任何帮助将不胜感激。

在向登录端点发送请求时,您会收到此错误,似乎您可能正在跨线程共享_sforceService,当其中一个线程决定需要登录时,它会将 Url 设置为登录端点,而另一个线程上的并发请求认为它向经过身份验证的端点发送请求实际上最终会将其发送到登录端点。仔细查看如何跨线程共享_sforceService

相关内容

最新更新