Bonsoir à tous,
Je poste trés rarement mais cette fois ci je ne parviens pas à solutionner mon problème.

Je crée un web service en utilisant zend_soap_server, quand j accède à l'url pour le wsdl tout semble correcte le xml s affiche bien.

Puis je tente de consommer ce web service avec zend_soap_client, et le problème survient quand je tente d accéder a l action qui consomme ce ws.

L erreur est la suivante :
SoapFault: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://srce/ws/index/?wsdl' : Premature end of data in tag html line 1
Le code est :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
class WsController extends Zend_Controller_Action
{
** *public function indexAction() {
** * * *if (is_null($this->getRequest()->getParam('wsdl'))) {
** * * * * *// Traitement de la requête
** * * * * *$server = new Zend_Soap_Server('http://srce/ws/index/?wsdl', array('soap_version' => SOAP_1_2,
** * * * * * * * * * * * * * * * * * * * * *'encoding' => 'UTF-8', 'compression' => SOAP_COMPRESSION_ACCEPT));
** * * * * *$server->setClass('Default_Services_Users');
** * * * * *$server->handle();
** * * *} else {
** * * * * *// Retour de la WSDL
** * * * * *$wsdl = new Zend_Soap_AutoDiscover();
** * * * * *$wsdl->setClass('Default_Services_Users');
** * * * * *$wsdl->setUri('http://srce/ws/index/?wsdl', array('soap_version' => SOAP_1_2,*
** * * * * * * * * * * * * *'encoding' => 'UTF-8', 'compression' => SOAP_COMPRESSION_ACCEPT));
** * * * * *$wsdl->handle();
** * * *}
** * * *exit;
** *}
** *
** *public function clientAction() {
*
** * * *// Appel du WebService
** * * *try {
** * * * * *$client = new Zend_Soap_Client('http://srce/ws/index/?wsdl');
** * * * * *$client->setOptions(array('soap_version' => SOAP_1_2,*
** * * * * * * * * * * * * * * * * * * *'encoding' => 'UTF-8', 'compression' => SOAP_COMPRESSION_ACCEPT));
** * * * * *$result = $client->add(1, 2);
** * * *} catch(Zend_Exception $e) {
** * * * * *Zend_Debug::dump($e->getMessage());
** * * *}
*
** * * *Zend_Debug::dump($result);exit();
** *}
*
** *
}
?>
Comme vous pouvez le voir c est en local.
L environnement est :
PHP : 5.3+
OS: ubuntu 10.04 LTS ou debian squeeze ( je test les deux)
Php-soap installé

En ce qui concerne les ws le client et serveur son sur la même application.

Je vous prie de m excuser j ecris à partir de mon télephone.

Seriez vous d où cela pourrait venir?

Je vous remercie