dongyue110702 2011-08-17 17:33
浏览 71

在Magento / PHP中使用外部Web服务

Are there any tutorials or good examples of how I can utilize (consume?) an external web service via SOAP from within Magento? (Magento is a PHP based software system)

I see TONS of tutorials on accessing Magento data externally using SOAP and Magento's API, but I want to access an external web service from within Magento.

I've done a bit of research and I have to imagine I can use the SoapClient class to do this, but I'm not sure how the required keys and method calls translate to setting up/using the SoapClient class. If someone can point me in the right direction I'd greatly appreciate it!

Here's an example

Let's say I need to send the following SOAP request to http://someurl.somewhere.com:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://api.channeladvisor.com/webservices/">
    <soapenv:Header>
        <web:APICredentials>
            <web:DeveloperKey>DeveloperKey</web:DeveloperKey>
            <web:Password>Password</web:Password>
        </web:APICredentials>
    </soapenv:Header>
    <soapenv:Body>
        <web:RequestAccess>
            <web:localID>99999999</web:localID>
        </web:RequestAccess>
    </soapenv:Body>
</soapenv:Envelope>

How would I go about doing this in Magento?

  • 写回答

1条回答 默认 最新

  • dqg95034 2011-08-18 05:59
    关注

    Magento is a php application based on zend framework so any tutorial that is about zend and soap will also do. You can do any php related stuff in any magento file (exept from config files) although the best place to do such request are models.

    评论

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP