gpt4 book ai didi

api - 在 Drupal 中发出 SOAP 请求?

转载 作者:行者123 更新时间:2023-12-02 19:38:13 24 4
gpt4 key购买 nike

我正在尝试使用 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>

我是 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();

引用PHP的标准文档http://php.net/manual/en/book.soap.php

关于api - 在 Drupal 中发出 SOAP 请求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9255274/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com