LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-31-2012, 01:49 PM   #1
macaruchi
LQ Newbie
 
Registered: Sep 2004
Posts: 10

Rep: Reputation: 0
Error:Client-looks like we got no XML document:; WebService PHP


Hi!
I am trying to do a webservice using the native library and theses are my examples
This is the server that listen request

<?php
// Incluir la Clase
require_once('Calculadora.php');

// Crear servidor de Soap
$server = new SoapServer(
null, // No use WSDL
array('uri' => 'urn:webservices') // Se debe especificar el URI
);

// Asignar la Clase
$server->setClass('Calculadora');

// Atender los llamados al webservice
$server->handle();
?>


This is the Calculadora class. Just is for examples

<?php
// Clase que implementa los servicios
class Calculadora
{
// Metodo a utilizar como servicio
public function sumar($x, $y)
{
return $x + $y;
}
}


This is the cllient that try to use the webservice

<?php
$client = new SoapClient(null,
array(
'location' => 'http://localhost/ws/ser.php',
'uri' => 'urn:webservices',
));
try
{
echo $client->sumar(13,4);
}
catch (SoapFault $fault) {
var_dump($client->__getLastResponse());
var_dump($client->__getLastRequest());
die("Sorry, the service returned the following ERROR::: ".$fault->faultcode."-".$fault->faultstring.".");
}
?>


When I run the client #>php cliente.php I get this::
NULL
NULL
Sorry, the service returned the following ERROR:::
Client-looks like we got no XML document

I am using APache2 and PHP5 in debian6 with php-soap installed. In other server it runs fine. My other server is for testing not production.

Any cluees?

Edwin Quijada
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
yum update error on client: Cannot retrieve repository metadata (repomd.xml) yogesh29sharma Linux - Newbie 2 05-30-2011 08:30 AM
Fedora 10 - cups error " client-error-document-format-not-supported: Unsupported for parmar_rs Linux - Newbie 4 02-03-2009 09:58 PM
LXer: Dynamic XML document construction with the PHP DOM LXer Syndicated Linux News 0 01-25-2007 06:03 PM
Need help creating webservice and WSDL file to use with PHP eikeland Linux - Software 5 11-07-2006 02:38 PM
PHP - XML error: junk after document element at line... jimieee Programming 2 04-27-2004 11:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration