salesforce - Force.com 标注 : Is there a way to get the full response from the target server

标签 salesforce force.com

当从 Force.com 调用 Web 服务时,我得到:

System.CalloutException: Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':HTML'

另一端的网络人员要求查看 Salesforce 从他们的服务器获得的完整响应。

有办法实现吗?我尝试从执行匿名中使用调试级别“Finest”运行,但这会产生相同的小消息,但没有进一步的详细信息。

最佳答案

您收到的消息是因为 Saleforce 尝试解析响应时生成了错误,但遗憾的是该错误未记录。

发生解析错误是因为您得到的是 HTML 页面,而不是 SOAP 消息响应。当您访问受防火墙保护的服务时,通常会发生这种情况。这意味着您在计算机上浏览时可能能够看到该服务,但请记住 Salesforce 位于您的防火墙之外,因此 Salesforce 与您的服务的任何通信都将被阻止。

有几种方法可以解决这个问题,但 Salesforce 的这个 wiki 主题最好地涵盖了这些选项: http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_om_outboundmessaging_security.htm

以上内容特定于出站消息传递,但本质上技术问题是相同的。

关于salesforce - Force.com 标注 : Is there a way to get the full response from the target server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11447494/

相关文章:

triggers - Salesforce Apex 触发器 "isAPI"上下文变量

security - Salesforce "View All"对详细信息对象的权限,由于主从关系,它会提供对主对象的所有查看吗?

salesforce - 是否可以使用SOSL进行子查询?

eclipse - 无法使用 Salesforce 在 Eclipse 中创建部件的控件

php - SOAP_SINGLE_ELEMENT_ARRAYS 的未定义常量错误

session - Salesforce Session变量,在Session中设置和获取变量

javascript - 从 Node.js 订阅 SalesForce 主题时出错

salesforce - 链接到 Apex 方法的 CSRF 安全自定义按钮

Salesforce - 无法将 Visualforce 输入文本值传递给 apex 类

salesforce - 为什么不能更改 Salesforce 受管软件包中的类关系?