Implement Salesforce Outbound Message by JavaEE

准备工具:JDK、Eclipse Java EE IDE、ngrok.exe(翻墙https://ngrok.com/downloadhttp://www.cnblogs.com/chengxiaohui/articles/4864791.html

Tools to use: JDK、Eclipse Java EE IDE、ngrok.exe(VPN: https://ngrok.com/downloadhttp://www.cnblogs.com/chengxiaohui/articles/4864791.html

 

Salesforce

在Lead Object上创建一个Workflow,当有新Lead进来,即发Outbound Message到外部Server

Create a Workflow on Object Lead which triggers an Outbound Message to Call-out Server when new leads come in.

生成WSDL文件到本地桌面,命名为Notification.wsdl

Generate a WSDL file to Desktop and name it as Notification.wsdl.

 

创建新的Java Web工程

Create a new Java Web project.

直接把Notification.wsdl文件拖到LeadNotificaton工程

Drag the file Notification.wsdl to Project LeadNotifcation.

 运行LeadNotification工程,启用Tomcat

Run LeadNotification, start up Tomcat.

Eclipse->File->New->Other->Web Service★★★★★

 

选择"Top down Java been Web Service",点Browse加载wsdl文件,并且勾选"Publish the Web service"

Choose "Top down Java been Web Service", click button Browse to load file WSDL and tick "Publish the Web service".★★★★★

 

最后生成一些Java代码,打开NotificationBindingImpl.java,修改notifications方法return true并加入log

Jave codes will be generated by now. Open NotificationBindingImpl.java, edit method Notification, Return true and add it to log.

直接打开浏览器,输入http://localhost:8080/LeadNotification/services/Notification?wsdl

Open browser, input http://localhost:8080/LeadNotification/services/Notification?wsdl ★★★★★

这时候工程发布成功

The project will be released successfully by now.

 

打开翻墙工具,接着用cmd打开ngrok.exe工具(需要注册,载入Token),输入ngrok.exe http 8080

Open VPN and open ngrok.exe by cmd(Register and load Token), input ngrok.exe http 8080.★★★★★

替换浏览器里的localhost:8080地址,回车即可

Copy and past the address localhost:8080 from the browser, enter.★★★★★

 

最后再将这个域名更新到Outbound Message里

At last update the DNS to Outbound Message.

 

Salesforce里创建一条新的Lead,随后进入到Outbound Messaging Delivery Status,如果失败这里会有记录

Create a new Lead in Salesforce. Go to Outbound Messaging Delivery Status. Records will be shown here if it failed.

 

如果成功会看到Eclipse里的日志打印结果

If it succeeded, log print result will be shown in Eclipse.

最后,成功!!!!!!

Congratulations! It's done!

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值