使得在Drupal SOAP请求? [英] Making a SOAP request in Drupal?

查看:195
本文介绍了使得在Drupal SOAP请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现一个SOAP调用使用Drupal 6格式如下:

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>

我是新来的SOAP和所有的web文档不为Drupal工作。此外,我不得不在SOAP此调用(而不是HTTP GET或POST)。

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).

我怎么会让在Drupal SOAP调用?用上面的例子请求格式可以提供工作code例子吗?

How would I make a SOAP call in Drupal? Can you provide a working code example using the above example request format?

推荐答案

Drupal的犯规有什么具体的香皂的功能 - 你可以使用内置的PHP客户端。应该有你可以用它来生成你的SOAP客户端的WSDL文件。事情是这样的:

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:

<?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

这篇关于使得在Drupal SOAP请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆