How to make a PHP SOAP call using the SoapClient class

后端 未结 12 583
星月不相逢
星月不相逢 2020-11-22 17:28

I\'m used to writing PHP code, but do not often use Object-Oriented coding. I now need to interact with SOAP (as a client) and am not able to get the syntax right. I\'ve got

12条回答
  •  感情败类
    2020-11-22 17:42

    You need a multi-dimensional array, you can try the following:

    $params = array(
       array(
          "id" => 100,
          "name" => "John",
       ),
       "Barrel of Oil",
       500
    );
    

    in PHP an array is a structure and is very flexible. Normally with soap calls I use an XML wrapper so unsure if it will work.

    EDIT:

    What you may want to try is creating a json query to send or using that to create a xml buy sort of following what is on this page: http://onwebdev.blogspot.com/2011/08/php-converting-rss-to-json.html

提交回复
热议问题