Bonjour, j'ai rédigé mon premier Webservice en SOAP(pas le savon ^^). Je me retrouve, en chargeant celui-ci via Wizdl avec l'erreur suivante :
Je vous joint mon code :
test.wsdl
Et voici mon php : testSolution.php :
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61 <?xml version="1.0" encoding="iso-8859-1"?> <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:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl" targetNamespace="urn:serviceTestwsdl" xmlns:tns="urn:serviceTestwsdl" > <wsdl:types> <xsd:schema targetNamespace="urn:serviceTestwsdl"/> <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" /> </wsdl:types> <message name="getStringRequest"> </message> <message name="getStringResponse"> <part name="return" type="xsd:string" /> </message> <wsdl:portType name="serviceTestPortType"> <wsdl:operation name="getString"> <documentation>Récupère un string</documentation> <input message="tns:getStringRequest"/> <output message="tns:getStringResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="serviceTestBinding" type="tns:serviceTestPortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="getString"> <soap:operation soapAction="urn:serviceTestwsdl#getStringServeur" style="rpc"/> <wsdl:input> <soap:body use="encoded" namespace="urn:serviceTestwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </wsdl:input> <wsdl:output> <soap:body use="encoded" namespace="urn:serviceTestwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="serviceTest"> <wsdl:port name="serviceTestPort" binding="tns:serviceTestBinding"> <soap:address location="http://localhost/testSolution/testSolution.php"/> </wsdl:port> </wsdl:service> </wsdl:definitions>
Merci d'avance
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 <?php class Ws{ function getString() { return "TESTASTOS"; } } ini_set("soap.wsdl_cache_enabled", 0); $serversoap = new SoapServer("http://localhost/testSolution/test.wsdl"); $serversoap->setClass("Ws"); $serversoap->handle(); ?>
Meilleurs regards ☻♥
Partager