Précédent   Forum des professionnels en informatique > Autres langages > XML/XSL et SOAP
XML/XSL et SOAP Forum d'entraide sur XML et SOAP. Avant de poster -> FAQ XML, Sources XML
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 03/02/2012, 11h15   #1
Invité de passage
 
Homme
Inscription : février 2012
Messages : 3
Détails du profil
Informations personnelles :
Sexe : Homme

Informations forums :
Inscription : février 2012
Messages : 3
Points : 0
Points : 0
Par défaut [XML] Probleme WSDL: the part has an invalid value

Bonjour tout le monde
J'essaye de créer un wsdl mais je n'arrive pas à le faire marcher

J'ai utilisé plusieurs tutoriaux dont le très bon tutorial de Mickael Baron
http://mbaron.developpez.com/soa/wsdl/

Mais malgré cela, je n'arrive pas à régler ces problèmes:
1/
Citation:
this part 'GetDataResult has an invalid value ScrappedObject' defined for it's element. Elment declarations must refer to valid values defined in a schema
Même message pour GetDataXpath et GetDataXpathResponse

2/
une autre erreur dans le binding apparait également:
Citation:
The operation specified for the 'WesSoapBinding' binding is not defined for port type 'WesSoap'

Je ne comprends pas cette erreur vu que je les ai bien défini dans portType

Voici le code du wsdl

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
 
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="Wes" targetNamespace="http://www.fff.com/Interfaces/Wes"
 
 
	xmlns:tns="http://www.fff.com/Interfaces/Wes"
 
	xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
	xmlns:s="http://www.w3.org/2001/XMLSchema"
	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
 
	<wsdl:types>	
		<schema xmlns="http://www.w3.org/2001/XMLSchema">
			<import namespace="http://www.fff.com/Interfaces/Wes" schemaLocation="scrappingModel.xsd" />
		</schema>
	</wsdl:types>
 
 
	<wsdl:message name="getData" />
	<wsdl:message name="getDataResponse">
		<wsdl:part name="getDataResult" element="ScrappedObject"/>
	</wsdl:message>		
 
	<wsdl:message name="getDataXpath">
		<wsdl:part name="getDataXpathResult" type="string"/>
	</wsdl:message>
 
	<wsdl:message name="getDataXpathResponse">
		<wsdl:part name="getDataResult" element="ScrappedObject"/>
	</wsdl:message>		
 
 
	<wsdl:portType name="WesSoap">
 
		<wsdl:operation name="getData">
			<wsdl:input message="tns:getData" />
			<wsdl:output message="tns:getDataResponse" />
		</wsdl:operation>
 
		<wsdl:operation name="getDataXpath">
			<wsdl:input message="tns:getDataXpath" />
			<wsdl:output message="tns:getDataXpathResponse" />
		</wsdl:operation>
	</wsdl:portType>
 
 
	<wsdl:binding name="WesSoapBinding"	type="tns:WesSoap">
		<wsdlsoap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
		<wsdl:operation name="getData">
			<wsdlsoap:operation soapAction="" />
			<wsdl:output name="getDataResponse">
				<wsdlsoap:body use="literal" />
			</wsdl:output>
		</wsdl:operation>
		<wsdl:operation name="getDataXpath">
			<wsdlsoap:operation soapAction="" />
			<wsdl:output name="getDataXpathResponse">
				<wsdlsoap:body use="literal" />
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
 
 
	<wsdl:service name="WesSoapService">
		<wsdl:port name="WesSoapPort"
			binding="tns:WesSoapBinding">
			<wsdlsoap:address
				location="http://localhost:9000/myappli/services/wes-1.0" />
		</wsdl:port>
	</wsdl:service>
</wsdl:definitions>
et voici le fichier xsd correspondant

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
<?xml version="1.0" encoding="UTF-8"?>
 
<schema 
	xmlns="http://www.w3.org/2001/XMLSchema"
	targetNamespace="http://www.fff.com/Interfaces/Wes"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
	xmlns:tns="http://www.fff.com/Interfaces/Wes"
	elementFormDefault="qualified"
	attributeFormDefault="qualified">
 
	<!-- common structure for model -->
 
	<element name="ScrappedObject">
		<complexType>			
			<sequence>
				<element name="data" type="string" />
			</sequence>			
		</complexType>
	</element>
 
</schema>

Je vous remercie par avance de votre aide!
Kyozo est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 03/02/2012, 19h23   #2
Membre confirmé
 
Inscription : octobre 2011
Messages : 188
Détails du profil
Informations forums :
Inscription : octobre 2011
Messages : 188
Points : 287
Points : 287
Les attributs élément et type dans wsdl:part devraient être qualifiés, comme ça.
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
 
	<wsdl:message name="getData" />
	<wsdl:message name="getDataResponse">
		<wsdl:part name="getDataResult" element="tns:ScrappedObject"/>
	</wsdl:message>		
 
	<wsdl:message name="getDataXpath">
		<wsdl:part name="getDataXpathResult" type="s:string"/>
	</wsdl:message>
 
	<wsdl:message name="getDataXpathResponse">
		<wsdl:part name="getDataResult" element="tns:ScrappedObject"/>
	</wsdl:message>
tsuji est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 06/02/2012, 13h29   #3
Invité de passage
 
Homme
Inscription : février 2012
Messages : 3
Détails du profil
Informations personnelles :
Sexe : Homme

Informations forums :
Inscription : février 2012
Messages : 3
Points : 0
Points : 0
Déjà je te remercie pour té réponse.
Ensuite, après avoir fait las changement que tu as proposé, le problème s'est déplacé plus bas, au niveau du binding:
à ces 2 lignes : ligne 16 et 22

Citation:
the opperation specified for the 'wesPortBinding" is not defined for port type 'WesSoap'. All operations specified in this binding must be defined in port type 'WesSoap'
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
 
	<wsdl:portType name="WesSoap">
		<wsdl:operation name="getData">
			<wsdl:input message="getData" />
			<wsdl:output message="getDataResponse" />
		</wsdl:operation>
 
		<wsdl:operation name="getDataXpath">
			<wsdl:input message="getDataXpath" />
			<wsdl:output message="getDataXpathResponse" />
		</wsdl:operation>
	</wsdl:portType>
 
	<wsdl:binding name="wesPortBinding"	type="WesSoap">
		<wsdlsoap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
		<wsdl:operation name="getData">
			<wsdlsoap:operation soapAction=""/>
			<wsdl:output name="getDataResponse">
				<wsdlsoap:body namespace="http://www.fff.com/Interfaces/Wes" use="literal" />
			</wsdl:output>
		</wsdl:operation>
		<wsdl:operation name="getDataXpath">
			<wsdlsoap:operation soapAction="" />
			<wsdl:input name="getDataXpath">
				<wsdlsoap:body namespace="http://www.fff.com/Interfaces/Wes" use="literal" />
			</wsdl:input>
			<wsdl:output name="getDataXpathResponse">
				<wsdlsoap:body use="literal" />
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
Kyozo est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 06/02/2012, 14h44   #4
Membre confirmé
 
Inscription : octobre 2011
Messages : 188
Détails du profil
Informations forums :
Inscription : octobre 2011
Messages : 188
Points : 287
Points : 287
Citation:
Envoyé par Kyozo Voir le message
the opperation specified for the 'wesPortBinding" is not defined for port type 'WesSoap'. All operations specified in this binding must be defined in port type 'WesSoap'
J'observe que wsdl:operation pour getDataXpath a quelque peu changé. Mais peu import pour le moment.

Le type de wsdl:binding doit être qualifié (la ligne #14 desus) pointant au portType en question.
Code :
1
2
 
	<wsdl:binding name="wesPortBinding"	type="tns:WesSoap">
tsuji est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 08/02/2012, 11h49   #5
Invité de passage
 
Homme
Inscription : février 2012
Messages : 3
Détails du profil
Informations personnelles :
Sexe : Homme

Informations forums :
Inscription : février 2012
Messages : 3
Points : 0
Points : 0
merci pour ton aide!
J'ai réussi à le faire marché finalement en remettant tout à plat et en m'aidant de l'onglet "design" du wsdl sous Eclipse

Par contre, me cvoici face à un autre problèmes, j'importe un element ScrappedObject créé dans ScrappingModel.xsd avec

Code :
<import namespace="http://www.fff.com/Interfaces/Wes" schemaLocation="ScrappingModel.xsd" />
je ne sais pas comment spécifié à une message d'utiliser cet élément pour son input/output!
Il me semble que c'est un problème de namespace mais en fait je ne vois pas vraiment.
Code :
1
2
3
4
 
<wsdl:message name="getDirectoryInfosRequest">
		<wsdl:part name="getDirectoryInfosRequest" element="tns:ScrappedObject"></wsdl:part>
	</wsdl:message>
ou encore

Code :
1
2
3
4
 
<wsdl:message name="getDirectoryInfosRequest">
		<wsdl:part name="getDirectoryInfosRequest" element="xsd:ScrappedObject"></wsdl:part>
	</wsdl:message>
xsd, tns ...? je ne sais pas quoi mettre à ce niveau là
Kyozo est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 08/02/2012, 17h10   #6
Membre confirmé
 
Inscription : octobre 2011
Messages : 188
Détails du profil
Informations forums :
Inscription : octobre 2011
Messages : 188
Points : 287
Points : 287
Importer ou expliciter dans wsdl:types importe peu, ça vaut la même. Comment utiliser? hélas, ça ne s'apprend pas par imagination... D'ailleurs, les messages semblent changer tout le temps comme qu'est ce que c'est getDirectoryInfosRequest, apparu soudainement? Mais, peu importe.

Dit-on l'élément ScrappedObject: si elle paraître dans soapenv:Body, elle peut s'écrire comme:
Code :
1
2
3
4
 
<ns:ScrappedObject xmlns:ns="http://www.fff.com/Interfaces/Wes">
    <ns:data>abc</ns:data>
</ns:ScrappedObject>
étant enveloppé dans une élément précisant qu'elle soit une requête ou une réponse etc... et de quelle requête ou réponse etc...

Mais tout ça, ça ne s'imagine pas. Et il est plus souvent que non que vous ne l'écrit pas directement en tant que xml explicitement. En tout cas, il vaut mieux lire, lire et lire d'abord. J"ai mal même à tapper ce message pour ne pas faire intentionner de vous apprendre quoi que ce soit.
tsuji 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 01h11.


 
 
 
 
Partenaires

Hébergement Web