Salesforce:使用 Apex 触发 SOAP 出站消息
我有一个现有的工作流程规则,该规则触发 (SOAP) 出站创建或更新某种类型的对象时显示消息。效果很好。
我想扩展它,以便在删除对象时也发送类似的出站消息。
根据此讨论,工作流无法根据对象删除来触发规则,因此我必须编写一个 Apex 触发器。
所以问题是,如何从 Apex 中启动 SOAP 出站消息?
I have an existing Workflow Rule that fires of a (SOAP) Outbound Message when a certain type of object is created or updated. That works fine.
I want to extend it so that a similar Outbound Message is also sent when the objects are deleted.
According to this discussion, Workflow Rules cannot be made to fire based on object deletions, so I have to write an Apex Trigger instead.
So the question is, how do I kick off a SOAP Outbound Message from within Apex?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我是新来的,所以无法对 weesilmania 的帖子添加评论,但我想指出一些重要的事情。 salesforce 中的出站消息传递功能非常容错且可靠。这意味着,如果您的端点出现故障一段时间,或者 Salesforce 与您的服务器之间的网络连接不稳定,Salesforce 将在长达 24 小时内重试发送触发的出站消息。
实现在触发器上发生的顶点标注会起作用,但它是一劳永逸的。如果使用此选项,请记住这一点。
I'm new here so I can't add a comment to weesilmania's post, but I wanted to point out something important. The outbound messaging feature in salesforce is pretty fault tolerant and reliable. Meaning if your endpoint goes down for a while, or if the network connection between salesforce and your server is flaky, salesforce will retry sending a triggered outbound message for up to 24 hours.
Implementing an apex callout that happens on a trigger will work, but it's fire and forget. Keep that in mind if using this option.
它应该非常简单 - 只要 SF 支持您的 Web 服务 SOAP 版本。导入服务的 WSDL(您可以从“Apex 类”页面执行此操作)并添加调用 WSDL 定义的方法的适当触发器类型。
It should be quite simple - as long as SF supports your web services SOAP version. Import the WSDL for the service (you can do this from the 'Apex Classes' page) and add an appropriate trigger type that calls the WSDL defined method(s).
真正的“出站消息”(在应用程序设置中作为实体创建,带有合并字段等)-不知道。
您自己的 HTTP 请求,您可以在其中定义自己的端点以及可能是有效 SOAP 信封的有效负载 - 请查看 此处 和这里作为开始。
Real "Outbound Message" (created as an entity somewhere in application Setup, with merge fields etc.) - no idea.
Your own HTTP request where you define your own endpoint as well as payload that might be a valid SOAP envelope - have a look here and here for a start.