Error when I call WSDL file

I’m in real problème, first I create a php file with sourcecode:

<?php

$client = new SoapClient("services_ws_cma3_BalancesReadService.wsdl");
//show content of wsdl file
echo "Fonctions : <br/>"; 
var_dump($client->__getFunctions());
echo "<br/>Types :<br/>";
var_dump($client->__getTypes());

//begin of define parameters

$c = array('key' => 'Z','value'=>'string');

$d = array('item' => '$c');

$s = array('values' => '$d');

$g = array('privateKey' => 'long','publicKey'=>'string');

$f = array('contract' => '$g','isCharged'=>'0');

$p = array('inputAttributes' => '$f', 'sessionChangeRequest' => '$s');

//call function balancesRead whitche defined in wsdl file

$z = $client->balancesRead($p);

print_r($z);

echo "<br><br>";

var_dump($z);

?>

content of wsdl file :

Fonctions :

array (size=1)
  0 => string 'balancesReadResponse balancesRead(balancesReadRequest $balancesReadRequest)' (length=75)


Types :

array (size=14)
  0 => string 'struct money {
 double amount;
 string currency;
}' (length=50)
  1 => string 'struct svlany {
 string content;
}' (length=34)
  2 => string 'struct valuesListpartRequest {
 string key;
 string value;
}' (length=60)
  3 => string 'struct valuesRequest {
 valuesListpartRequest item;
}' (length=53)
  4 => string 'struct sessionChangeRequest {
 valuesRequest values;
}' (length=54)
  5 => string 'struct pAMEntity {
 long privateKey;
 integer publicKey;
}' (length=58)
  6 => string 'struct cSEntityDTO {
 long privateKey;
 integer externalKey;
}' (length=62)
  7 => string 'struct offersResponse {
 cSEntityDTO offer;
}' (length=45)
  8 => string 'struct balanceDTO {
 long balanceType;
 boolean createdInSDP;
 long profileId;
 referenceDTO service;
 string serviceDes;
 float creditValue;
 referenceDTO currency;
 float secondaryCreditValue;
 referenceDTO secondaryCurrency;
 dateTime resetDate;
 boolean creditable;
 dateTime startDate;
 dateTime expiryDate;
 float actualValue;
 float secondaryActualValue;
 long accountManagementTotalCounter;
 long accountManagementPeriodCounter;
 dateTime nextAvailableBonusDate;
 float nextAvailableBonusValue;
 float ne'... (length=804)
  9 => string 'struct balancesResponse {
 balanceDTO balance;
}' (length=48)
  10 => string 'struct balancesReadResponse {
 balancesResponse balances;
}' (length=59)
  11 => string 'struct referenceDTO {
 long privateKey;
 string publicKey;
}' (length=60)
  12 => string 'struct inputAttributes {
 referenceDTO contract;
 boolean isCharged;
}' (length=70)
  13 => string 'struct balancesReadRequest {
 inputAttributes inputAttributes;
 sessionChangeRequest sessionChangeRequest;
}' (length=108)

when executing script i show this message

Fatal error: Uncaught SoapFault exception: [HTTP] Could not
connect to host in C:\wamp\www\wsdlProjet\index.php:22 Stack trace: #0
[internal function]: SoapClient->__doRequest(‘http://10.15.11…’,
‘’, 1, 0) #1 C:\wamp\www\wsdlProjet\index.php(22):
SoapClient->__call(‘balancesRead’, Array) #2
C:\wamp\www\wsdlProjet\index.php(22): SoapClient->balancesRead(Array)
#3 {main} thrown in C:\wamp\www\wsdlProjet\index.php on line 22
*

please helpe me,I will be very grateful,tks a lot.

Try to add a host when you call SoapClient. Something like http://localhost/path_to_wsdl/services_ws_cma3_BalancesReadService.wsdl

Tks do respend to my request,but when i integrate /* http://localhost/path_to_wsdl/services_ws_cma3_BalancesReadService.wsdl / isee the message /

( ! )
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing
WSDL: Couldn’t load from ‘http://localhost/path_to_wsdl/services_ws_cma3_BalancesReadService.wsdl
: failed to load external entity “http://localhost/path_to_wsdl/services_ws_cma3_BalancesReadService.wsdl
in C:\wamp\www\wsdlProjet\index.php:3Stack trace:#0 C:\wamp\www\wsdlProjet\index.php(3): SoapClient->SoapClient(‘http://localhos…’)#1 {main} thrown in C:\wamp\www\wsdlProjet\index.php on line 3

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.