Précédent   Forum des professionnels en informatique > Général Développement > Conception > Architecture > SOA
SOA Forum d'entraide : Architecture Orientée Services (Service Oriented Architecture)
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 09/03/2011, 12h05   #1
Invité de passage
 
Alexandre
Inscription : janvier 2011
Messages : 1
Détails du profil
Informations personnelles :
Nom : Alexandre

Informations forums :
Inscription : janvier 2011
Messages : 1
Points : 0
Points : 0
Par défaut Fichier WSDL - Paramètre complexType ? __soapCall Error.

Bonjour,

Je suis débutant en PHP, je dois créer un WebService.
J'ai commencé par suivre un tuto afin de créer un WebService (et son .WSDL) répondant à la fonction 'QuelJour'. Ca fonctionne bien.
J'y ai ajouté une seconde fonction 'TryBase', qui fonctionne tout aussi bien ! ouf.
(Je me sert de l'IDE Eclipse pour former "graphiquement" le .WSDL, ne trouvant pas de générateur de WSDL à partir d'une classe PHP...)

Maintenant, j'ai besoin d'une fonction, mais qui reçoit plusieurs paramètres.
Mon server.php ainsi que mon client.php sont faits, mais il me reste le problème de mon fichier .WSDL... En effet, je n'arrive pas à obtenir une validation correcte de ma structure.

La fonction 'CheckLicence' nécessite le passage de 5 paramètres de types différents. J'ai alors créée un complexType, composé de ces 5 attributs, correctement typés. (Je me suis appuyé sur un exemple existant).

Lorsque j'appelle la fonction 'CheckLicence' depuis mon client.php, celle-ci n'est pas éxécutée. La méthode __soapCall échoue...

Citation:
Warning: SoapClient::__soapCall() expects at most 5 parameters, 6 given in C:\Dropbox\www\Appolonia\WS\client.php on line 59
Ça me parle de 6 paramètres passés, au lieu de 5... Or j'en passe bien 5 et non 6 !

Code :
$client -> __soapCall('CheckLicence', $idLicence, $dateExp, $lickey, $siteid, $idModule);
Je ne comprend pas. Mais c'est sûrement mon .WSDL qui foire...
Le voici:

Code :
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://localhost:8080/Appolonia/WS/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="WSDL_SGL" targetNamespace="http://localhost:8080/Appolonia/WS/">
    <wsdl:types>
	
		<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://localhost:8080/Appolonia/WS/">
		
		<xsd:element name="InfosLicence" type="tns:InfosLicence"/>
		<xsd:complexType name="InfosLicence">
				<xsd:attribute name="idLicence" type="xsd:int"></xsd:attribute>
				<xsd:attribute name="dateExp" type="xsd:string"></xsd:attribute>
				<xsd:attribute name="licKey" type="xsd:string"></xsd:attribute>
				<xsd:attribute name="siteid" type="xsd:string"></xsd:attribute>
				<xsd:attribute name="idModule" type="xsd:int"></xsd:attribute>
		</xsd:complexType>
		
		</xsd:schema>
	</wsdl:types>
    <wsdl:message name="QueljourRequest">
    <wsdl:part name="QueljourRequest" type="xsd:string"/>
  </wsdl:message>
  <wsdl:message name="QueljourResponse">
    <wsdl:part name="QueljourResponse" type="xsd:string"/>
  </wsdl:message>
  <wsdl:message name="TryBaseRequest">
  	<wsdl:part name="TryBaseRequest" type="xsd:string"></wsdl:part>
  </wsdl:message>
  <wsdl:message name="TryBaseResponse">
  	<wsdl:part name="TryBaseResponse" type="xsd:boolean"></wsdl:part>
  </wsdl:message>
  <wsdl:message name="CheckLicenceRequest">
  	<wsdl:part name="CheckLicenceRequest" type="tns:InfosLicence"></wsdl:part>
  </wsdl:message>
  <wsdl:message name="CheckLicenceResponse">
  	<wsdl:part name="CheckLicenceResponse" type="xsd:boolean"></wsdl:part>
  </wsdl:message>
  
  <wsdl:portType name="WSDL_SGL">
    <wsdl:operation name="Queljour">
      <wsdl:input message="tns:QueljourRequest"/>
      <wsdl:output message="tns:QueljourResponse"/>
    </wsdl:operation>
    <wsdl:operation name="TryBase">
    	<wsdl:input message="tns:TryBaseRequest"></wsdl:input>
    	<wsdl:output message="tns:TryBaseResponse"></wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="CheckLicence">
    	<wsdl:input message="tns:CheckLicenceRequest"></wsdl:input>
    	<wsdl:output message="tns:CheckLicenceResponse"></wsdl:output>
    </wsdl:operation>
  </wsdl:portType>
  
  <wsdl:binding name="WSDL_SGLSOAP" type="tns:WSDL_SGL">
  	<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
		
  	<wsdl:operation name="Queljour">
  		<soap:operation
  			soapAction="http://localhost:8080/Appolonia/WS/Queljour" />
  		<wsdl:input>

  			<soap:body use="literal"
  				namespace="http://localhost:8080/Appolonia/WS/" />
  		</wsdl:input>
  		<wsdl:output>

  			<soap:body use="literal"
  				namespace="http://localhost:8080/Appolonia/WS/" />
  		</wsdl:output>
  	</wsdl:operation>
	
  	<wsdl:operation name="TryBase">

  		<soap:operation
  			soapAction="http://localhost:8080/Appolonia/WS/TryBase" />
  		<wsdl:input>

  			<soap:body use="literal"
  				namespace="http://localhost:8080/Appolonia/WS/" />
  		</wsdl:input>
  		<wsdl:output>

  			<soap:body use="literal"
  				namespace="http://localhost:8080/Appolonia/WS/" />
  		</wsdl:output>
  	</wsdl:operation>
	
  	<wsdl:operation name="CheckLicence">

  		<soap:operation
  			soapAction="http://localhost:8080/Appolonia/WS/CheckLicence" />
  		<wsdl:input>

  			<soap:body use="literal"
  				namespace="http://localhost:8080/Appolonia/WS/" />
  		</wsdl:input>
  		<wsdl:output>

  			<soap:body use="literal"
  				namespace="http://localhost:8080/Appolonia/WS/" />
  		</wsdl:output>
  	</wsdl:operation>
	
  </wsdl:binding>
  
  <wsdl:service name="WSDL_SGL">
    <wsdl:port binding="tns:WSDL_SGLSOAP" name="WSDL_SGLSOAP">
      <soap:address location="http://localhost:8080/Appolonia/WS/server.php"/>
    </wsdl:port>
  </wsdl:service>
  
</wsdl:definitions>
Quelqu'un saurait-il me donner (un début de) une solution svp ?
Je peut donner + de détails, ou ré-expliquer certains points si ce n'est pas clair... désolé si c'est le cas ^^

En vous remerciant d'avance.

Alexandre.
Mast06 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 18h08.


 
 
 
 
Partenaires

Hébergement Web