RJ博客

PHP和java通讯

本文目录

版权声明:本文为博主原创文章,未经博主允许不得转载。

       最近弄ecshop网上商城这个系统,需要提供对银联快捷支付支持,我查了下资料,发现php调用java,可以通过PHP/Java Bridge来实现这个功能。于是采用PHP/Java Bridge来调用java实现银联支付Demo.

http://hikin.iteye.com/blog/484192

       一般来说,PHP和java通讯通讯,使用JavaBridge就可以了,坑爹的是银联那边提供的demo打包成jar包不能正常运行(打包完后运行需要3-5分钟,有的甚至直接不能运行),具体打包方法如下:

java打包jar包具体可以参考链接(有引入第三方jar包的推荐使用FatJar打包):

http://www.cnblogs.com/lanxuezaipiao/p/3291641.html

除了以上链接,还有一种ant打包:

http://www.cnblogs.com/yuzhongwusan/archive/2013/03/26/2982411.html

其中eclipse当导出jar包方式为runnable jar时,可以导出相应的build.xml文件,相应为这3中jar包导出方式的ant代码(需要注意的是runnable jar的第二种导出方式所导出build.xml文件文件的同时还会生成jar-in-jar-loader.zip,需要放到java项目(Demo)的根目录)

       既然我把Demo打包成jar包运行失败了,那只好换另外一种方式了,于是我又上网找了下,发现有人使用thiift通讯,不过我感觉这种方式也挺悬,链接如下:

http://www.chinab4c.com/html/shangchengchengxu/ecshopjiagou/2014/0524/1287.html

有兴趣的朋友可以试下,反正我是没试过哈.

       最后我索性弄个WebService,把Demo当成客户端,再把服务端打包成jar包供JavaBridge调用(直接用php连接到WebService也可以,不过我觉得再用个JavaBridge可能更方便一些,虽然多了一层跳转,不过因为php和java的交互并不是很频繁,所以就将就吧).途中也遇到了一些小问题,不过都在万能的互联网的帮助下一一解决了(主要就是银联这个Demo做出WebService还需要另外导入相关支持的jar包)

Webservice知识点可参考以下网站:

http://blog.csdn.net/hanxuemin12345/article/details/40163757

http://wenku.baidu.com/link?url=m3lZ6V6Alq5VsO7CU-YEoJg6fy_3WG37KUFORg4z82R9gepBlel-SBV0aXwiUxqGLYKiUjXS8HxLuFJPshRdH-s_T5Q-vm3XfcQ6Hoq7-17&qq-pf-to=pcqq.c2c

JavaBridge可参考以下网站:

http://i006.blog.163.com/blog/static/205965147201302210523864

最终方案的确定:WebService+JavaBridge

作者:finallylly

相关推荐

发表评论

  • 欢迎评论

  • XEvil - the best captcha solver tool with unlimited number of solutions, without thread number limits and highest precision! XEvil 5.0 support more than 12.000 types of image-captcha, included ReCaptcha, Google captcha, Yandex captcha, Microsoft captcha, Steam captcha, SolveMedia, ReCaptcha-2 and (YES!!!) ReCaptcha-3 too. 1.) Flexibly: you can adjust logic for unstandard captchas 2.) Easy: just start XEvil, press 1 button - and it's will automatically accept captchas from your application or script 3.) Fast: 0,01 seconds for simple captchas, about 20..40 seconds for ReCaptcha-2, and about 5...8 seconds for ReCaptcha-3 You can use XEvil with any SEO/SMM software, any parser of password-checker, any analytics application, or any custom script: XEvil support most of well-known anti-captcha services API: 2Captcha, RuCaptcha, AntiGate.com (Anti-Captcha.com), DeathByCaptcha, etc. Interested? Just search in Google "XEvil" for more info You read this - then

  • XEvil - the best captcha solver tool with unlimited number of solutions, without thread number limits and highest precision! XEvil 5.0 support more than 12.000 types of image-captcha, included ReCaptcha, Google captcha, Yandex captcha, Microsoft captcha, Steam captcha, SolveMedia, ReCaptcha-2 and (YES!!!) ReCaptcha-3 too. 1.) Flexibly: you can adjust logic for unstandard captchas 2.) Easy: just start XEvil, press 1 button - and it's will automatically accept captchas from your application or script 3.) Fast: 0,01 seconds for simple captchas, about 20..40 seconds for ReCaptcha-2, and about 5...8 seconds for ReCaptcha-3 You can use XEvil with any SEO/SMM software, any parser of password-checker, any analytics application, or any custom script: XEvil support most of well-known anti-captcha services API: 2Captcha, RuCaptcha, AntiGate.com (Anti-Captcha), DeathByCaptcha, etc. Interested? Just search in YouTube "XEvil" for more info You read this - then it

  • XEvil - the best captcha solver tool with unlimited number of solutions, without thread number limits and highest precision! XEvil 5.0 support more than 12.000 types of image-captcha, included ReCaptcha, Google captcha, Yandex captcha, Microsoft captcha, Steam captcha, SolveMedia, ReCaptcha-2 and (YES!!!) ReCaptcha-3 too. 1.) Flexibly: you can adjust logic for unstandard captchas 2.) Easy: just start XEvil, press 1 button - and it's will automatically accept captchas from your application or script 3.) Fast: 0,01 seconds for simple captchas, about 20..40 seconds for ReCaptcha-2, and about 5...8 seconds for ReCaptcha-3 You can use XEvil with any SEO/SMM software, any parser of password-checker, any analytics application, or any custom script: XEvil support most of well-known anti-captcha services API: 2Captcha.com, RuCaptcha.Com, AntiGate.com (Anti-Captcha), DeathByCaptcha, etc. Interested? Just search in YouTube "XEvil" for more info You read this -

  • XEvil - the best captcha solver tool with unlimited number of solutions, without thread number limits and highest precision! XEvil 5.0 support more than 12.000 types of image-captcha, included ReCaptcha, Google captcha, Yandex captcha, Microsoft captcha, Steam captcha, SolveMedia, ReCaptcha-2 and (YES!!!) ReCaptcha-3 too. 1.) Flexibly: you can adjust logic for unstandard captchas 2.) Easy: just start XEvil, press 1 button - and it's will automatically accept captchas from your application or script 3.) Fast: 0,01 seconds for simple captchas, about 20..40 seconds for ReCaptcha-2, and about 5...8 seconds for ReCaptcha-3 You can use XEvil with any SEO/SMM software, any parser of password-checker, any analytics application, or any custom script: XEvil support most of well-known anti-captcha services API: 2Captcha.com, RuCaptcha.Com, AntiGate (Anti-Captcha), DeathByCaptcha, etc. Interested? Just search in Google "XEvil" for more info You read this - then

  • XEvil - the best captcha solver tool with unlimited number of solutions, without thread number limits and highest precision! XEvil 5.0 support more than 12.000 types of image-captcha, included ReCaptcha, Google captcha, Yandex captcha, Microsoft captcha, Steam captcha, SolveMedia, ReCaptcha-2 and (YES!!!) ReCaptcha-3 too. 1.) Flexibly: you can adjust logic for unstandard captchas 2.) Easy: just start XEvil, press 1 button - and it's will automatically accept captchas from your application or script 3.) Fast: 0,01 seconds for simple captchas, about 20..40 seconds for ReCaptcha-2, and about 5...8 seconds for ReCaptcha-3 You can use XEvil with any SEO/SMM software, any parser of password-checker, any analytics application, or any custom script: XEvil support most of well-known anti-captcha services API: 2Captcha, RuCaptcha.Com, AntiGate.com (Anti-Captcha), DeathByCaptcha, etc. Interested? Just search in Google "XEvil" for more info You read this - then

  • XEvil - the best captcha solver tool with unlimited number of solutions, without thread number limits and highest precision! XEvil 5.0 support more than 12.000 types of image-captcha, included ReCaptcha, Google captcha, Yandex captcha, Microsoft captcha, Steam captcha, SolveMedia, ReCaptcha-2 and (YES!!!) ReCaptcha-3 too. 1.) Flexibly: you can adjust logic for unstandard captchas 2.) Easy: just start XEvil, press 1 button - and it's will automatically accept captchas from your application or script 3.) Fast: 0,01 seconds for simple captchas, about 20..40 seconds for ReCaptcha-2, and about 5...8 seconds for ReCaptcha-3 You can use XEvil with any SEO/SMM software, any parser of password-checker, any analytics application, or any custom script: XEvil support most of well-known anti-captcha services API: 2Captcha.com, RuCaptcha.Com, AntiGate (Anti-Captcha.com), DeathByCaptcha, etc. Interested? Just search in YouTube "XEvil" for more info You read this -

  • Hi , I am following up on my message below. Who would I speak with about handling your US order fulfillment and shipping? Regards, Marcus order-fulfillment.net ------------------------------------------------------------------------ Hi, Who would I speak with at your company that manages your product shipping and order fulfillment? We are US company, offering warehousing, order fulfillment and drop shipping to our customers since 2005. Here are some of the items we ship for clients: -Books, training manuals, guides -E-com product drop shipping -New member welcomes boxes and gifts -Product samples -Health and Medical supplements -Marketing materials -Medical program test kits -Follow up gifts to clients, leads, and prospects Do you have some time to discuss - phone / email ? Thanks, Fulfillment Specialist www.Order-Fulfillment.net

  • XEvil-最好的验证码求解工具,具有无限数量的解决方案,没有线程数限制和最高精度! XEvil5.0支持超过12.000类型的图像验证码,包括ReCaptcha,Google captcha,Yandex captcha,Microsoft captcha,Steam captcha,SolveMedia,ReCaptcha-2和(是的!!!)ReCaptcha-3了。 1.) 灵活: 您可以调整非标准验证码的逻辑 2.) 简单: 只需启动XEvil,按1按钮-它将自动接受来自您的应用程序或脚本的验证码 3.) 快: 0,01对于简单的验证码秒,关于20..40秒的ReCaptcha-2,约5。..8秒的ReCaptcha-3 您可以将XEvil与任何SEO/SMM软件,密码检查器的任何解析器,任何分析应用程序或任何自定义脚本一起使用: XEvil支持大多数知名的反验证码服务 API: 2Captcha.com, RuCaptcha.Com, AntiGate (Anti-Captcha.com), DeathByCaptcha, etc. 有兴趣吗? 只需在YouTube"XEvil"中搜索即可获取更多信息 你读这个-那么它的工作原理! ;) XEvil.Net 问候, Lolitywoupt8369

  • XEvil - the best captcha solver tool with unlimited number of solutions, without thread number limits and highest precision! XEvil 5.0 support more than 12.000 types of image-captcha, included ReCaptcha, Google captcha, Yandex captcha, Microsoft captcha, Steam captcha, SolveMedia, ReCaptcha-2 and (YES!!!) ReCaptcha-3 too. 1.) Flexibly: you can adjust logic for unstandard captchas 2.) Easy: just start XEvil, press 1 button - and it's will automatically accept captchas from your application or script 3.) Fast: 0,01 seconds for simple captchas, about 20..40 seconds for ReCaptcha-2, and about 5...8 seconds for ReCaptcha-3 You can use XEvil with any SEO/SMM software, any parser of password-checker, any analytics application, or any custom script: XEvil support most of well-known anti-captcha services API: 2Captcha.com, RuCaptcha.Com, AntiGate.com (Anti-Captcha), DeathByCaptcha, etc. Interested? Just search in Google "XEvil" for more info You read this -

  • It is with sad regret to inform you that because of the Covid pandemic BestLocalData.com is shutting down at the end of the month. We have lost family members and colleagues and have decided to shut down BestLocalData.com It was a pleasure serving you all these years. We have made all our databases available for $99 (All of it for $99) for those interested. Kind Regards, BestLocalData.com Edna

  • We at BestLocalData.com has been hit badly by Covid-19 and as a result BestLocalData.com is shutting down. We provided the best data to companies to find their right customer base, we don't want other companies to go down the same path we went and go out of business. As a result we are providing our data till the end of the week at the lowest possible prices. BestLocalData.com

  • Hello from BestLocalData.com Due to the pandemic BestLocalData.com is shutting down on the 14th of May. We have more than a 100 million records of Key Executives all over the world. We hope that this Data will serve other companies to succeed in their marketing efforts. We have reduced all the prices to next to nothing on our website BestLocalData.com We wish you the best in your future endeavours.

  • Hello from SendBulkMails.com, We have a special limited offer for you to send unlimited emails. We allow non-permission based emails and you won't ever get blocked. We also buy your domain for you and give you a clean IP and setup your DNS records. Check us out on SendBulkMails.com

  • Do you need clients? We compiled some of the world's top databases for you at ridiculous low prices. $49 for any of our databases or $99 for all 16 databases! Visit BestLocalData.com Regards, Billie

  • Do you need clients? We compiled some of the world's top databases for you at ridiculous low prices. $49 for any of our databases or $99 for all 16 databases! Visit BestLocalData.com Regards, Terese

  • Hello, Send unlimited emails to unlimited lists with one click and no monthly fees! $99 once off! LifeMailNow.com

  • Hello, BestLocalData.com has a special package you get any group of databases for $49 or $249 for all 16 databases and unlimited emails for a year(Domain, IP, Dashboard included). You can purchase it on BestLocalData.com and see samples if you are interested.

  • QGWQE0JFA9Y3RDVWXF www.google.com I have a small question for you

  • Do you need more clients? We have amazing databases starting at $9.99 until the end of the Month! Visit us at StarDataGroup.com

  • Use SendBulkMails.com to run email campaigns from your own private dashboard. Cold emails are allowed and won't get you blocked :) - 1Mil emails / mo @ $99 USD - Dedicated IP and Domain Included - Detailed statistical reports (delivery, bounce, clicks etc.) - Quick and easy setup with extended support at no extra cost. - Cancel anytime! Regards, www.SendBulkMails.com

  • QGW6CEMP21QXSXTWXF How to get to you ? I need to get a consultation www.google.com

  • Great post. I was checking constantly this blog and I am impressed! Extremely helpful information specifically the last part :) I care for such info much. I was seeking this certain info for a very long time. Thank you and best of luck.