problem with web service

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
galej
Forum Newbie
Posts: 1
Joined: Wed Dec 21, 2011 10:43 am

problem with web service

Post by galej »

Hi to everyone.

A friend of mine implemented a web service and she can consume it when running Apache with WAMPP. When I try to consume the same web service with the same code I get:

Fatal error: Uncaught SoapFault exception: [Client] SoapClient::SoapClient() [<a href='soapclient.soapclient'>soapclient.soapclient</a>]: Invalid parameters in C:\xampp\htdocs\Prueba\clienteUsuario.php:7 Stack trace: #0 C:\xampp\htdocs\Prueba\clienteUsuario.php(7): SoapClient->SoapClient('http://localhos...', true) #1 {main} thrown in C:\xampp\htdocs\Prueba\clienteUsuario.php on line 7

I'm using XAMPP 1.7.2. Then I tried to consume the web service in an application developed with Yii and I get:

SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost/Prueba/wsUsuario.php?wsdl' : Premature end of data in tag definitions line 2
User avatar
tr0gd0rr
Forum Contributor
Posts: 305
Joined: Thu May 11, 2006 8:58 pm
Location: Utah, USA

Re: problem with web service

Post by tr0gd0rr »

I'm not sure what your question is. But the first error looks like you are sending a second parameter of true instead of an array. It should be

Code: Select all

$client = new SoapClient($wsdl, $arrayOfOptions);
see php.net docs.

The second error looks like the wsdl contains invalid xml.
Post Reply