Posté le 31 octobre 2014 - 10:33
Bonjour,
Je suis en train d'essayer de consommer un webservice magento. J'ai donc importer le WSDL dans mon projet WINDEV.
Ce qui a entraîné la création de nouveaux objets et procédures :
Lorsque j'essaye d'utiliser la méthode login, je n'ai aucun problème car elle prend comme paramètre 2 chaines et en retourne une.
Cependant que je ne parviens pas a utilisé la méthode call. En effet elle prends pour argument un objet de type AnyType[]. Je ne sais pas comment importé la structure de celui-ci.
voici mon code:
ci-dessous le WSDL
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 sCretour est une chaîne tabArgcall est un tableau de chaînes retourCall est un MagentoService.FixedArray sCretour=MagentoService.login("******","*****") TableauAjoute(tabArgcall,"4026-20") TableauAjoute(tabArgcall,"7") retourCall:arrayType=MagentoService.call(sCretour,"status_stock.update",tabArgcall)
Code xml : 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188 <definitions xmlns:typens="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" name="Magento" targetNamespace="urn:Magento"> <types> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:Magento"> <import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="FixedArray"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:anyType[]"/> </restriction> </complexContent> </complexType> </schema> </types> <message name="call"> <part name="sessionId" type="xsd:string"/> <part name="resourcePath" type="xsd:string"/> <part name="args" type="xsd:anyType"/> </message> <message name="callResponse"> <part name="callReturn" type="xsd:anyType"/> </message> <message name="multiCall"> <part name="sessionId" type="xsd:string"/> <part name="calls" type="typens:FixedArray"/> <part name="options" type="xsd:anyType"/> </message> <message name="multiCallResponse"> <part name="multiCallReturn" type="typens:FixedArray"/> </message> <message name="endSession"> <part name="sessionId" type="xsd:string"/> </message> <message name="endSessionResponse"> <part name="endSessionReturn" type="xsd:boolean"/> </message> <message name="login"> <part name="username" type="xsd:string"/> <part name="apiKey" type="xsd:string"/> </message> <message name="loginResponse"> <part name="loginReturn" type="xsd:string"/> </message> <message name="resources"> <part name="sessionId" type="xsd:string"/> </message> <message name="resourcesResponse"> <part name="resourcesReturn" type="typens:FixedArray"/> </message> <message name="globalFaults"> <part name="sessionId" type="xsd:string"/> </message> <message name="globalFaultsResponse"> <part name="globalFaultsReturn" type="typens:FixedArray"/> </message> <message name="resourceFaults"> <part name="resourceName" type="xsd:string"/> <part name="sessionId" type="xsd:string"/> </message> <message name="resourceFaultsResponse"> <part name="resourceFaultsReturn" type="typens:FixedArray"/> </message> <message name="startSession"/> <message name="startSessionResponse"> <part name="startSessionReturn" type="xsd:string"/> </message> <portType name="Mage_Api_Model_Server_HandlerPortType"> <operation name="call"> <documentation>Call api functionality</documentation> <input message="typens:call"/> <output message="typens:callResponse"/> </operation> <operation name="multiCall"> <documentation>Multiple calls of resource functionality</documentation> <input message="typens:multiCall"/> <output message="typens:multiCallResponse"/> </operation> <operation name="endSession"> <documentation>End web service session</documentation> <input message="typens:endSession"/> <output message="typens:endSessionResponse"/> </operation> <operation name="login"> <documentation>Login user and retrive session id</documentation> <input message="typens:login"/> <output message="typens:loginResponse"/> </operation> <operation name="startSession"> <documentation>Start web service session</documentation> <input message="typens:startSession"/> <output message="typens:startSessionResponse"/> </operation> <operation name="resources"> <documentation>List of available resources</documentation> <input message="typens:resources"/> <output message="typens:resourcesResponse"/> </operation> <operation name="globalFaults"> <documentation>List of resource faults</documentation> <input message="typens:globalFaults"/> <output message="typens:globalFaultsResponse"/> </operation> <operation name="resourceFaults"> <documentation>List of global faults</documentation> <input message="typens:resourceFaults"/> <output message="typens:resourceFaultsResponse"/> </operation> </portType> <binding name="Mage_Api_Model_Server_HandlerBinding" type="typens:Mage_Api_Model_Server_HandlerPortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="call"> <soap:operation soapAction="urn:Mage_Api_Model_Server_HandlerAction"/> <input> <soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> <operation name="multiCall"> <soap:operation soapAction="urn:Mage_Api_Model_Server_HandlerAction"/> <input> <soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> <operation name="endSession"> <soap:operation soapAction="urn:Mage_Api_Model_Server_HandlerAction"/> <input> <soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> <operation name="login"> <soap:operation soapAction="urn:Mage_Api_Model_Server_HandlerAction"/> <input> <soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> <operation name="startSession"> <soap:operation soapAction="urn:Mage_Api_Model_Server_HandlerAction"/> <input> <soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> <operation name="resources"> <soap:operation soapAction="urn:Mage_Api_Model_Server_HandlerAction"/> <input> <soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> <operation name="globalFaults"> <soap:operation soapAction="urn:Mage_Api_Model_Server_HandlerAction"/> <input> <soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> <operation name="resourceFaults"> <soap:operation soapAction="urn:Mage_Api_Model_Server_HandlerAction"/> <input> <soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> </binding> <service name="MagentoService"> <port name="Mage_Api_Model_Server_HandlerPort" binding="typens:Mage_Api_Model_Server_HandlerBinding"> <soap:address location="http:/xxxxxxxx/api/index/index/"/> </port> </service> </definitions>
Peut être je n'utilise pas la bonne méthode. Quelqu'un peu m'aider?
Merci.
Partager