Discussion:
Newbie question
Kariboe
2008-06-03 13:05:20 UTC
Permalink
Hi all,

Busy testing SCA package. I have a problem with a very simple
testscript. Running a local script client.php:

<?php

include 'SCA/SCA.php';

$wsdl = file_get_contents('http://barabas.hogent.be/kariboe/
helloworld.php?wsdl');
file_put_contents("helloworld.wsdl",$wsdl);
$helloservice = SCA::getService('helloworld.wsdl');

echo $helloservice->sayHello();
?>

And on my server:

<?php
include "SCA/SCA.php";
/**
* @service
* @binding.ws
*/
class helloworld
{
/**
* @return string Hello Message
*/
function sayHello(){
return 'hello kariboe';
}
}
?>

If I try to access the generated wsdl code I receive a blank page!
What am I doing wrong?

Server: Red Hat Enterprise Linux 4
PHP: 5.2.1
Apache: 2.2.3

Help is appreciated!

Regards,

Stefaan
Matthew Peters
2008-06-06 09:34:59 UTC
Permalink
Hi Stefaan,
Sorry you had difficulties. The first place to look when there are
problems is the apache error log. I just cut and pasted your example
(I coiuld see nothing wrong with it :-)) and saw
Uncaught SCA_RuntimeException: No valid @binding annotation found for
'helloworld.php'.\n....

Then I remembered ...

What has happened here is that the @binding you want is @binding.soap,
not @binding.ws. We used to have @binding.ws but changed it to
@binding.soap a while ago. I hope we changed all the documentation to
match, but if you found @binding.ws somewhere in the documentation do
let me know and I will fix it.

Good luck and let us know if you have more problems.

Matthew
Post by Kariboe
Hi all,
Busy testing SCA package. I have a problem with a very simple
<?php
include 'SCA/SCA.php';
$wsdl = file_get_contents('http://barabas.hogent.be/kariboe/
helloworld.php?wsdl');
file_put_contents("helloworld.wsdl",$wsdl);
$helloservice = SCA::getService('helloworld.wsdl');
echo $helloservice->sayHello();
?>
<?php
include "SCA/SCA.php";
/**
*/
class helloworld
{
/**
*/
function sayHello(){
return 'hello kariboe';
}}
?>
If I try to access the generated wsdl code I receive a blank page!
What am I doing wrong?
Server: Red Hat Enterprise Linux 4
PHP: 5.2.1
Apache: 2.2.3
Help is appreciated!
Regards,
Stefaan
Kariboe
2008-06-18 08:23:09 UTC
Permalink
Matthew,

Thanks for the response but my problem is not yet solved:

Fatal error: Uncaught SCA_RuntimeException: SDO_Exception in
setWSDLTypes : SDO_DAS_XML::create - Unable to parse the supplied xsd
file 2 parse error(s) occurred when parsing the file 'C:\wamp\www
\webservices\test_3\helloworld.wsdl': 1. Document is empty 2. Start
tag expected, '<' not found thrown in C:\wamp\www\webservices
\SCA_SDO-1.2.4\SCA\Bindings\soap\Proxy.php on line 104

When my client.php tries to read the wsdl from my server script it
receives nothing. Maybe something on my server is missing? I copied
the SCA folder to my php install/include folder. I hope this is
enough?

I really hope to get this working before the summer so we can start
implementing webservices in Dokeos 2.0.

Regards,

Stefaan
Matthew Peters
2008-06-18 08:52:09 UTC
Permalink
Hi Stefaan,
I see, you are presumably getting nothing back when you ask for the
wsdl with something like
$wsdl = file_get_contents('http://barabas.hogent.be/kariboe/
helloworld.php?wsdl');

What we need to know is what appears in the apache error log on the
server machine barabas.hogent.be (or whatever server you are using)
when you execute the file_get_contents? You can also just try to get
the wsdl using the url in a browser if you like.

I don't know if the SCA files are in the right place; I expect so
though. If include 'SCA/SCA.php' works on the server end that
everything else should work.

Matthew
Post by Kariboe
Matthew,
Fatal error: Uncaught SCA_RuntimeException: SDO_Exception in
setWSDLTypes : SDO_DAS_XML::create - Unable to parse the supplied xsd
file 2 parse error(s) occurred when parsing the file 'C:\wamp\www
\webservices\test_3\helloworld.wsdl': 1. Document is empty 2. Start
tag expected, '<' not found thrown in C:\wamp\www\webservices
\SCA_SDO-1.2.4\SCA\Bindings\soap\Proxy.php on line 104
When my client.php tries to read the wsdl from my server script it
receives nothing. Maybe something on my server is missing? I copied
the SCA folder to my php install/include folder. I hope this is
enough?
I really hope to get this working before the summer so we can start
implementing webservices in Dokeos 2.0.
Regards,
Stefaan
Continue reading on narkive:
Loading...