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 :
A priori je dois avoir une erreur dans mon WSDL mais je n'arrive pas la trouver, je m'arrache les cheveux...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
Voici le code de mes pages:
service.php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 <?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
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
40 <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"> <part name="input" type="xsd:integer" /></message> <message name="circResponse"> <part name="resultat" type="xsd:integer" /></message> <portType name="MonServicePortType"> <operation name="circ"> <documentation>Trouver la circonférence dun cercle par son rayon</documentation> <input message="tns:circRequest"/> <output message="tns:circResponse"/> </operation> </portType> <binding name="MonServiceBinding" type="tns:MonServicePortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="circ"> <soap:operation soapAction="http://localhost/circ" style="rpc"/> <input><soap:body use="encoded" namespace="http://localhost/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input> <output><soap:body use="encoded" namespace="http://localhost/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output> </operation> </binding> <service name="MonService"> <port name="MonServicePort" binding="tns:MonServiceBinding"> <soap:address location="http://localhost/service.php"/> </port> </service> </definitions>
Si quelqu'un peut m'aider je lui serai reconnaissant.
Merci d'avance.
Partager