4

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?

AtomicCharles
  • 111
  • 1
  • 3
  • 12

2 Answers2

6

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

Refer to PHP's standard documentation http://php.net/manual/en/book.soap.php

jakraska
  • 751
  • 3
  • 6
0

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

George Hanna
  • 354
  • 1
  • 19