Ato*_*les 3 api soap drupal nusoap drupal-6
我正在尝试使用以下格式实现与Drupal 6的SOAP调用:
POST /0_5/ClassService.asmx HTTP/1.1
Host: api.mindbodyonline.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://clients.mindbodyonline.com/api/0_5/AddClientsToClasses"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<AddClientsToClasses xmlns="http://clients.mindbodyonline.com/api/0_5">
<Request>
<ClientIDs>
<string>string</string>
<string>string</string>
</ClientIDs>
<ClassIDs>
<int>int</int>
<int>int</int>
</ClassIDs>
<Test>boolean</Test>
<RequirePayment>boolean</RequirePayment>
</Request>
</AddClientsToClasses>
</soap:Body>
</soap:Envelope>
Run Code Online (Sandbox Code Playgroud)
我是SOAP的新手,所有的Web文档都不适用于Drupal.此外,我必须在SOAP(而不是HTTP GET或POST)中进行此调用.
我如何在Drupal中进行SOAP调用?您能否使用上面的示例请求格式提供有效的代码示例?
Drupal没有任何特定的soap功能 - 您可以使用内置的PHP客户端.应该有一个WSDL文件可用于生成soap客户端.像这样的东西:
<?php
$client = new SoapClient("http://localhost/code/soap.wsdl");
$something = $client->HelloWorld(array());
echo $something->HelloWorldResult;
die();
Run Code Online (Sandbox Code Playgroud)
请参阅PHP的标准文档http://php.net/manual/en/book.soap.php
| 归档时间: |
|
| 查看次数: |
6259 次 |
| 最近记录: |