duan02143 2017-06-26 08:47
浏览 207
已采纳

如何将python / django项目与仅为php提供api的web服务集成?

I work on a django website. Currently, I need to integrate it with a third-party API that provides only PHP endpoints and some shitty documentation that instructs how to build PHP requests. The API provider introduces a PHP client containing a class that handles requests to PHP API webservice via SOAP.

First, is it possible to build python client that will interact with PHP endpoints without knowing server-side trickery of the API provider? Should I dive deeper into PHP client source code and try to rewrite it in python?

Second, should I create intermediary PHP webservice that will integrate third-party PHP API and provide a precise API to interact with python client.

Is there any better option?

P.S. Please, note that I'm new to PHP and SOAP.

  • 写回答

1条回答 默认 最新

  • dph58509 2017-06-26 09:18
    关注

    Just like any other API. You just have to use the PHP client as a guide to build the API client in python. If you feel it's no help at all, throw it away and look what the endpoints are and what they spit out.

    In the end, the endpoints on the remote server can be programmed in Smalltalk for you care. The API client only cares about what parameters to send to the server and what the response looks like.

    So pick your basics:

    and start coding ;) Good luck!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题