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.

    评论

报告相同问题?

悬赏问题

  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?