在 Drupal 中发出 SOAP 请求?
我正在尝试使用 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 调用?您能否提供使用上述示例请求格式的工作代码示例?
I am trying to implement a SOAP call with Drupal 6 with the following format:
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>
I am new to SOAP and all the web documentation doesn't work for Drupal. Also, I have to make this call in SOAP (not HTTP GET or POST).
How would I make a SOAP call in Drupal? Can you provide a working code example using the above example request format?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Drupal 没有任何特定的肥皂功能 - 您可以使用内置的 PHP 客户端。应该有一个 WSDL 文件可用于生成您的肥皂客户端。像这样的事情:
请参阅 PHP 的标准文档 http://php.net/manual/en/ book.soap.php
Drupal doesnt have any specific soap functionality - you can use the built in PHP client. There should be a WSDL file you can use to generate your soap client. Something like this:
Refer to PHP's standard documentation http://php.net/manual/en/book.soap.php
老兄只需使用模块服务3,它包含您需要的所有内容。您还可以进行(REST、XMLRPC、JSON、JSON-RPC、SOAP、AMF)调用,以便在 drupal 中执行此操作。实际上,您也必须将肥皂服务器安装到 drupal ...
请点击此链接了解有关服务模块的更多信息。
http://drupal.org/project/services
这是 drupal 令人惊叹的模块之一
Dude just use the module service 3 it contains all you need . you'll make a (REST, XMLRPC, JSON, JSON-RPC, SOAP, AMF) call also in order to do this in drupal pragmatically you must install soap server to drupal too ...
Follow this link to know more about service module .
http://drupal.org/project/services
this one of drupal amazing modules