Client SOAP - Internal Server Error
Bonjour,
J'essaie d'écrire un client SOAP avec les fonctions natives de PHP et j'ai systématiquement un retour Internal Server Error, j'ai testé le Webservice avec SOAPUI afin de vérifier qu'il fonctionne bien et le Serveur ne semble pas avoir de problème, j'ai donc testé mon code sous diffèrente plateforme (Linux/Windows) avec et sans firewall etc... toujours le même soucis, pourtant quand j'attaque un Webservice public de Type Weather ou autre mon code fonctionne, je ne comprend pas, je pense qu'il s'agit d'une question de paramètre envoyé ou de Header mais n'étant pas adepte de SOAP ( nous travaillons en général avec REST) je me retourne vers vous pour décortiquer le WSDL
Voici mon code PHP :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
ini_set('soap.wsdl_cache_enabled', 0);
$client = new SoapClient('http://XXXXXXXXXX:8080/RemService.svc?wsdl',
array(
'trace' => 1,
'exceptions' => false
));
var_dump($client->__getFunctions());
var_dump($client->__getTypes());
//Cette fonction permet de réupérer les détails d'un compte
$params = array('GetAccountInformation'=>array('Login'=>'***********','Password'=>'*******'));
$retour = $client->GetAccountInformation($params);
echo '<pre>' . htmlspecialchars(print_r($retour,true)) . '</pre>'; |
Voici l'erreur affichée :
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 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 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330
|
array (size=5)
0 => string 'SendResponse Send(Send $parameters)' (length=35)
1 => string 'GetResponse Get(Get $parameters)' (length=32)
2 => string 'GetSendingsResponse GetSendings(GetSendings $parameters)' (length=56)
3 => string 'InviteResponse Invite(Invite $parameters)' (length=41)
4 => string 'GetAccountInformationResponse GetAccountInformation(GetAccountInformation $parameters)' (length=86)
array (size=45)
0 => string 'int char' (length=8)
1 => string 'duration duration' (length=17)
2 => string 'string guid' (length=11)
3 => string 'string NotificationState' (length=24)
4 => string 'string AccountRole' (length=18)
5 => string 'struct Authenticate {
string Login;
string Password;
}' (length=56)
6 => string 'struct User {
ReceiverType Type;
string Email;
string Firstname;
string Lastname;
string Company;
string Service;
Address Address;
string PhoneNumber;
string GSMNumber;
}' (length=179)
7 => string 'string ReceiverType' (length=19)
8 => string 'struct Address {
string Line1;
string Line2;
string Zip;
string City;
}' (length=75)
9 => string 'struct ArrayOfFile {
File File;
}' (length=34)
10 => string 'struct File {
string Filename;
base64Binary Data;
string Hash;
}' (length=67)
11 => string 'string State' (length=12)
12 => string 'struct ArrayOfEvent {
Event Event;
}' (length=37)
13 => string 'struct Event {
EventType Type;
dateTime Date;
}' (length=49)
14 => string 'string EventType' (length=16)
15 => string 'struct ArrayOfEvidence {
Evidence Evidence;
}' (length=46)
16 => string 'struct Evidence {
File File;
EvidenceType Type;
}' (length=51)
17 => string 'string EvidenceType' (length=19)
18 => string 'struct ArrayOfNotification {
Notification Notification;
}' (length=58)
19 => string 'struct Notification {
NotificationState State;
string Type;
string Media;
dateTime SentDate;
string Description;
}' (length=119)
20 => string 'struct GuestAccount {
string Email;
string Firstname;
string Lastname;
string CompanyName;
string GroupName;
AccountRole Role;
string Service;
string Address;
string Address2;
string Zip;
string City;
string PhoneNumber;
string GSMNumber;
}' (length=253)
21 => string 'struct ResultMessage {
string Id;
string Message;
}' (length=53)
22 => string 'struct ArrayOfint {
int int;
}' (length=31)
23 => string 'struct SendController.REM {
User Receiver;
string Subject;
string Content;
boolean PriorAgreement;
int Duration;
ArrayOfFile Attachments;
boolean SMS;
string ExternalId;
string From;
}' (length=193)
24 => string 'struct SendController.Result {
File File;
string LinkId;
ResultMessage ResultMessage;
}' (length=90)
25 => string 'struct GetController.Result {
GetController.REM rem;
ResultMessage resultMessage;
}' (length=85)
26 => string 'struct GetController.REM {
string LinkId;
State State;
GetController.User Sender;
GetController.User Receiver;
string Subject;
string Content;
boolean PriorAgreement;
ArrayOfFile Attachments;
ArrayOfEvent Events;
ArrayOfEvidence Evidences;
ArrayOfNotification Notifications;
string ExternalId;
}' (length=307)
27 => string 'struct GetController.User {
ReceiverType Type;
string Email;
string Firstname;
string Lastname;
string Company;
string Service;
Address Address;
string PhoneNumber;
string GSMNumber;
}' (length=193)
28 => string 'struct GetSendingsController.Data {
dateTime BeginDate;
dateTime EndDate;
int Offset;
int Size;
GetSendingsController.Filters Filters;
}' (length=141)
29 => string 'struct GetSendingsController.Filters {
dateTime DateCloseBegin;
dateTime DateCloseEnd;
boolean EmailError;
string ExternalId;
string LinkId;
string ReceiverCompany;
string ReceiverEmail;
string ReceiverFirstname;
string ReceiverLastname;
string ReceiverZip;
boolean SMSError;
State State;
}' (length=302)
30 => string 'struct GetSendingsController.Result {
ArrayOfGetSendingsController.REM REMs;
ResultMessage ResultMessage;
long Total;
}' (length=122)
31 => string 'struct ArrayOfGetSendingsController.REM {
GetSendingsController.REM GetSendingsController.REM;
}' (length=97)
32 => string 'struct GetSendingsController.REM {
string LinkId;
State State;
GetSendingsController.User Sender;
GetSendingsController.User Receiver;
string Subject;
string Content;
boolean PriorAgreement;
ArrayOfFile Attachments;
ArrayOfEvent Events;
ArrayOfEvidence Evidences;
ArrayOfNotification Notifications;
string ExternalId;
}' (length=331)
33 => string 'struct GetSendingsController.User {
ReceiverType Type;
string Email;
string Firstname;
string Lastname;
string Company;
string Service;
Address Address;
string PhoneNumber;
string GSMNumber;
}' (length=201)
34 => string 'struct GetAccountInformation.Result {
ArrayOfint AuthorizedArchive;
long Credits;
boolean FixRequiredB2B;
dateTime LastSent;
boolean MobilOrFixRequiredB2B;
boolean MobilRequiredB2B;
boolean MobilRequiredB2C;
string OutlookPluginVersion;
ResultMessage ResultMessage;
boolean WithExternalReference;
boolean isCBS;
}' (length=324)
35 => string 'struct Send {
Authenticate Authenticate;
SendController.REM rem;
}' (length=68)
36 => string 'struct SendResponse {
SendController.Result SendResult;
}' (length=58)
37 => string 'struct Get {
Authenticate authenticate;
string LinkId;
}' (length=58)
38 => string 'struct GetResponse {
GetController.Result GetResult;
}' (length=55)
39 => string 'struct GetSendings {
Authenticate authenticate;
GetSendingsController.Data data;
}' (length=84)
40 => string 'struct GetSendingsResponse {
GetSendingsController.Result GetSendingsResult;
}' (length=79)
41 => string 'struct Invite {
Authenticate authenticate;
GuestAccount guest;
}' (length=66)
42 => string 'struct InviteResponse {
ResultMessage InviteResult;
}' (length=54)
43 => string 'struct GetAccountInformation {
Authenticate authenticate;
}' (length=60)
44 => string 'struct GetAccountInformationResponse {
GetAccountInformation.Result GetAccountInformationResult;
}' (length=99)
SoapFault Object
(
[message:protected] => Internal Server Error
[string:Exception:private] =>
[code:protected] => 0
[file:protected] => C:\wamp\www\Wevelop\index.php
[line:protected] => 30
[trace:Exception:private] => Array
(
[0] => Array
(
[function] => __doRequest
[class] => SoapClient
[type] => ->
[args] => Array
(
[0] => <?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tempuri.org/"><SOAP-ENV:Body><ns1:GetAccountInformation/></SOAP-ENV:Body></SOAP-ENV:Envelope>
[1] => http://xxxxxxxxxxxx:8080/RemService.svc
[2] => http://tempuri.org/IRemService/GetAccountInformation
[3] => 1
[4] => 0
)
)
[1] => Array
(
[file] => C:\wamp\www\Wevelop\index.php
[line] => 30
[function] => __call
[class] => SoapClient
[type] => ->
[args] => Array
(
[0] => GetAccountInformation
[1] => Array
(
[0] => Array
(
[GetAccountInformation] => Array
(
[Login] => xxxxxxxxx
[Password] => xxxxxx
)
)
)
)
)
[2] => Array
(
[file] => C:\wamp\www\Wevelop\index.php
[line] => 30
[function] => GetAccountInformation
[class] => SoapClient
[type] => ->
[args] => Array
(
[0] => Array
(
[GetAccountInformation] => Array
(
[Login] => xxxxxxxxxx
[Password] => xxxxxxxxxx
)
)
)
)
)
[previous:Exception:private] =>
[faultstring] => Internal Server Error
[faultcode] => HTTP
) |
GetAccountInformation n'attend que deux paramètres Login et MDP du compte souhaité, je pense avoir tout testé
Merci