Web Service, SOAP et WSDL

jimmypage64 Messages postés 164 Date d'inscription samedi 16 octobre 2004 Statut Membre Dernière intervention 21 septembre 2010 - 5 févr. 2010 à 10:50
cs_spoonisback Messages postés 72 Date d'inscription vendredi 14 mai 2004 Statut Membre Dernière intervention 5 février 2010 - 5 févr. 2010 à 12:29
Bonjour,

je suis en train de tenter de faire un serveur de WebService en PHP.
J'ai crée ma page service.php qui cree le serveur SOAP et qui définit la fonction de mon WebService et, j'ai ensuite crée mon WSDL.

Quand je tente d'accéder a service.php j'obtiens une ereur :

WSDLSOAP-ERROR: Parsing WSDL: Couldn't load from 'C:\Program Files\EasyPHP6.0dev\www\service.wsdl' : Input is not proper UTF-8, indicate encoding ! Bytes: 0xE9 0x72 0x65 0x6E

A priori je dois avoir une erreur dans mon WSDL mais je n'arrive pas la trouver, je m'arrache les cheveux...

Voici le code de mes pages:

service.php
<?php
    
 function circ($rayon) {
        return $rayon * 6.28;
    }

// Création de l'objet serveur SOAP 
$server new SoapServer('service.wsdl', array('soap_version'> SOAP_1_2));
$server->addfunction('circ');
$server->handle();

?>


service.wsdl
<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 
    xmlns:tns="http://localhost/" 
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
    xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://localhost/">
<types>
<xsd:schema targetNamespace="http://localhost/">
 <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
 <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
</xsd:schema>
</types>
<message name="circRequest">
  </message>
<message name="circResponse">
  </message>

  <operation name="circ">
    <documentation>Trouver la circonférence dun cercle par son rayon</documentation>
    
    <output message="tns:circResponse"/>
  </operation>



  <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
  <operation name="circ">
    <soap:operation soapAction="http://localhost/circ" style="rpc"/>
     <soap:body use="encoded" namespace="http://localhost/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
    <output><soap:body use ="encoded" namespace="http://localhost/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
  </operation>

<service name="MonService">
  
    <soap:address location="http://localhost/service.php"/>
  


</service>
</definitions>


Si quelqu'un peut m'aider je lui serai reconnaissant.

Merci d'avance.
[8)]Zoso

1 réponse

cs_spoonisback Messages postés 72 Date d'inscription vendredi 14 mai 2004 Statut Membre Dernière intervention 5 février 2010
5 févr. 2010 à 12:29
Salut,

Tu devrai peut-être pas poster ça dans "débutant" ?? ;)


Heureux l'étudiant qui comme la rivière arrive a suivre son cours sans sortir de son lit...
0
Rejoignez-nous