[horde] SOAP client request against horde-3.0-rc1

Rafael Varela Pet srrafa at usc.es
Wed Nov 24 05:52:54 PST 2004


Hi,

What is the proper method to make a SOAP call to an HORDE application?

In this scenario:

horde-3.0-rc1
turba-h3-2.0-rc1

I'm trying to call the funcion "sources" exposed in turba/lib/api.php
using the PEAR SOAP 0.8RC3 module:

<?php

require "SOAP/Client.php";


$soapclient = new SOAP_Client("http://server/horde/rpc.php", false, "",
array( user=>'user', pass=>'pass') );

$parms = array( 1 );
$options = array('namespace' => 'contacts', 'trace' => 1); 
$ret = $soapclient->call( "sources", $parms, 'urn:horde' );
print_r($ret);

?>

This code always fails with an "method not defined in service", no
matter what I use in the "namespace" or "SOAP Port name" parameters. The
same happens with a PERL client that uses SOAP::Lite.


The same operation using this XMLRPC PHP client works perfectly:

<?php

require "XML/RPC.php";

$client = new XML_RPC_Client('/horde/rpc.php','localhost');
$client->setCredentials('user','pass');

$params = array( new XML_RPC_Value( 1, "integer") );
$msg = new XML_RPC_Message('contacts.sources', $params ); 

$response = $client->send($msg);

$v = $response->value();

if (!$response->faultCode()) {
      print "Value: " . $v->scalarval() . "<br>\n";
      print "Val. ser.:\n" . $response->serialize() . "<br>\n";
} else {
    print "Fault: ";
    print "Code: " . $response->faultCode() . " Reason '" .
$response->faultString() . "'\n";
}

?>


Regards,

-- 
--------------------------------------------------
Rafael Varela Pet
Area de Tecnoloxías da Información e Comunicacións

Universidade de Santiago de Compostela
15782 Santiago de Compostela
http://www.usc.es/saus
--------------------------------------------------




More information about the horde mailing list