2012-02-13 5 views
3

나는 다음과 같은 형식으로 드루팔 (6)와 SOAP 호출을 구현하기 위해 노력하고 있습니다 :Drupal에서 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과 드루팔 작동하지 않는 모든 웹 문서에 대한 새로운입니다. 또한 SOAP (HTTP GET 또는 POST 아님)에서이 호출을 만들어야합니다.

Drupal에서 SOAP 호출을 어떻게 작성합니까? 위의 예제 요청 형식을 사용하여 작업 코드 예제를 제공 할 수 있습니까?

답변

5

Drupal에는 특정 비누 기능이 없습니다. PHP 클라이언트를 내장하여 사용할 수 있습니다. 비누 클라이언트를 생성하는 데 사용할 수있는 WSDL 파일이 있어야합니다. 이런 식으로 뭔가 :

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

1

야 그냥 당신이 필요로하는 모든 포함하는 모듈 서비스 (3)를 사용합니다. 당신은 드루팔 (Drupal에서 이것을하기 위해서도 REST, XMLRPC, JSON, JSON-RPC, SOAP, AMF) 콜을 만들 것이다. 서비스 모듈에 대한 자세한 정보.

http://drupal.org/project/services

드루팔이 하나의 놀라운 모듈