my first demo for sca php has something wrong,help!

9 views
Skip to first unread message

jackyrong

unread,
Feb 18, 2009, 10:18:43 PM2/18/09
to phpsoa
i just write my first demo for sca php,helloworld,the code is:

include 'SCA/SCA.php';

/**
* @service
* @binding.soap
*/
class Greeting
{
/**
* @param string $name
* @return string
*/
public function greet($name)
{
return 'hello ' . $name;
}
}
?>
and when i run the code above,it generated the wsdl,and the wsdl is:

http://localhost:8082/myphp/helloworldscawsreference/Greeting.wsdl
and i can use the ie browser to see it.
the the client code is:
<?

include 'SCA/SCA.php';

//$wsdl = file_get_contents('http://localhost:8082/myphp/
helloworldscawsreference/Greeting.wsdl');
//file_put_contents("service.wsdl",$wsdl); //write the wsdl to a file
$service=SCA::

$greeting_service = SCA::getService('http://localhost:8082/myphp/
helloworldscawsreference/Greeting.wsdl');

echo $greeting_service->greet('liaoyurong');


?>
but when i runt the code,i wait for a long time,then get the result
is:

Fatal error: Uncaught SCA_RuntimeException: SDO_Exception in
setWSDLTypes : SDO_DAS_XML::create - Unable to parse the supplied xsd
file 1 parse error(s) occurred when parsing the file 'http://localhost:
8082/myphp/helloworldscawsreference/Greeting.wsdl': 1.
xmlSAXUserParseFile returned an error -1 thrown in D:\php5\PEAR\SCA
\Bindings\soap\Proxy.php on line 104


my php version is php 5.2.8,the run in visita system

jackyrong

unread,
Feb 20, 2009, 1:48:33 AM2/20/09
to phpsoa
it's so crazy,i run it on win2003,that's ok,all code,apache,php,are
the same

jackyrong

unread,
Feb 19, 2009, 8:35:46 PM2/19/09
to phpsoa


it is so crazy that i run it on wi2003 server,it is ok!but can not run
in visita!

On 2月19日, 上午11时18分, jackyrong <jackyr...@tom.com> wrote:

Matthew Peters

unread,
Mar 4, 2009, 1:41:52 PM3/4/09
to phpsoa
Hi Jacky,
sorry you had difficulties. You did everything right. If I try out
your example the sytax is all just fine.

I can sort of see what is going wrong without knowing straightaway how
to fix it.

The error message says that xmlSAXUserParseFile returned an error.
This is a routine in the libxml code that we use to do all the XML
parsing.

libxml is a piece of open source code that gets built into php. libxml
is here -> http://xmlsoft.org/ and you can see that it is built into
php when you do phpinfo() - look in the extensions and you'll see
libxml.

On our WinXP systems the versions of php we have mostly use libxml2
version 2.6.26. I guess that either the php you have is using 2.6.26
and that does not like Vista, or the version of PHP you have is using
a different libxml. Take a look in phpinfo() and tell us what version
you see.

Matthew

jackyrong

unread,
Mar 5, 2009, 3:16:42 AM3/5/09
to phpsoa
thank you very much,and i already reinstall my os system,and now is
win2003,and it's is fine,
but another question is :when i use the php sca to reference the wsdl
which generated by apache tuscany sca,
the php can not get the result,even the sample is helloworld,why?

and this is the wsdl which generated by apache tuscany sca:

use java create a wsdl which published in Tomcat 6,the wsdl is:
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions name="IUserserviceService"
targetNamespace="http://
service.tuscanytest.com/" xmlns:tns="http://service.tuscanytest.com/"
xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:SOAP11="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xs="http://
www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/
wsdl/">
- <wsdl:types>
- <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/
XMLSchema">
- <xs:complexType name="user">
- <xs:sequence>
<xs:element minOccurs="0" name="address" type="address" />
<xs:element minOccurs="0" name="id" type="xs:string" />
<xs:element minOccurs="0" name="name" type="xs:string" />
<xs:element minOccurs="0" name="password" type="xs:string" />
</xs:sequence>
</xs:complexType>
- <xs:complexType name="address">
- <xs:sequence>
<xs:element minOccurs="0" name="street" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:schema>
- <xs:schema attributeFormDefault="qualified"
elementFormDefault="unqualified" targetNamespace="http://
service.tuscanytest.com/" xmlns:xs="http://www.w3.org/2001/
XMLSchema">
- <xs:element name="getAllResponse">
- <xs:complexType>
- <xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true"
type="xs:anyType" />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getAll">
<xs:complexType />
</xs:element>
</xs:schema>
</wsdl:types>
- <wsdl:message name="getAllResponse">
<wsdl:part name="getAllResponse" element="tns:getAllResponse" />
</wsdl:message>
- <wsdl:message name="getAll">
<wsdl:part name="getAll" element="tns:getAll" />
</wsdl:message>
- <wsdl:portType name="IUserservice">
- <wsdl:operation name="getAll">
<wsdl:input message="tns:getAll" />
<wsdl:output message="tns:getAllResponse" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="IUserserviceBinding" type="tns:IUserservice">
<SOAP:binding style="document" transport="http://
schemas.xmlsoap.org/
soap/http" />
- <wsdl:operation name="getAll">
<SOAP:operation />
- <wsdl:input>
<SOAP:body use="literal" />
</wsdl:input>
- <wsdl:output>
<SOAP:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="IUserserviceService">
- <wsdl:port name="IUserservicePort"
binding="tns:IUserserviceBinding">
<SOAP:address location="http://172.16.18.15:8085/tuscanytest/
UserService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

when i use php to call it,i use the code :
include 'SCA/SCA.php';
$greeting_service = SCA::getService('http://172.16.18.15:8085/
tuscanytest/UserService?wsdl');
while ($arr=$greeting_service->getAll())
{


echo($arr["name"]);
}






jackyrong

unread,
Mar 9, 2009, 10:24:51 PM3/9/09
to phpsoa


no one help me?

On 3月5日, 下午4时16分, jackyrong <jackyr...@tom.com> wrote:
> thank you very much,and i already reinstall my os system,and now is
> win2003,and it's is fine,
> but another question is :when i use the php sca to reference the wsdl
> which generated by apache tuscany sca,
> the php can not get the result,even the sample is helloworld,why?
>
> and this is the wsdl which generated by apache tuscany sca:
>
> use java create a wsdl which published in Tomcat 6,the wsdl is:
> <?xml version="1.0" encoding="UTF-8" ?>
> - <wsdl:definitions name="IUserserviceService"
> targetNamespace="http://
> service.tuscanytest.com/" xmlns:tns="http://service.tuscanytest.com/"
> xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:SOAP11="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/

Dalibor Andzakovic

unread,
Mar 10, 2009, 6:08:56 AM3/10/09
to php...@googlegroups.com
$greeting_service  = SCA::getService('http://172.16.18.15:8085/tuscanytest/UserService?wsdl', ‘soap’);

HTH

dali


On 10/03/09 3:24 PM, "jackyrong" <jack...@tom.com> wrote:

jackyrong

unread,
Mar 11, 2009, 2:54:42 AM3/11/09
to phpsoa

it still can not work!it shows "The page cannot be displayed"



On 3月10日, 下午6时08分, Dalibor Andzakovic
<Dalibor.Andzako...@swerve.co.nz> wrote:
> $greeting_service = SCA::getService('http://172.16.18.15:8085/tuscanytest/UserService?wsdl', 'soap');
>
> HTH
>
> dali
>
> On 10/03/09 3:24 PM, "jackyrong" <jackyr...@tom.com> wrote:
>
> greeting_service = SCA::getService('http://172.16.18.15:8085/
>
>
>
> > tuscanytest/UserService?wsdl');- 隐藏被引用文字 -
>
> - 显示引用的文字 -

Matthew Peters

unread,
Mar 11, 2009, 2:58:52 PM3/11/09
to phpsoa
Jacky,
just a quick note to let you know I am looking at this one. I am
making up a simple php UserService.php that will generate wsdl close
to what you have below. I will post a working example when I have it.

Thanks to dali for spotting you need the 'soap' argument.

Matthew

jackyrong

unread,
Mar 12, 2009, 4:08:33 AM3/12/09
to phpsoa

Thank you very much,but I am so curious about it,

because i use the PHP SCA to reference a wsdl made by TUSCANY SCA
JAVA,it can not work,
and I notice that there is two files in PEAR\SCA\Bindings\tuscany,but
I don't know how to use it


On 3月12日, 上午2时58分, Matthew Peters <matthew.f.pet...@googlemail.com>
wrote:
> > > - 显示引用的文字 -- 隐藏被引用文字 -
>
> - 显示引用的文字 -

jackyrong

unread,
Mar 27, 2009, 1:29:51 PM3/27/09
to phpsoa
still can not work

jackyrong

unread,
May 10, 2009, 4:59:30 AM5/10/09
to phpsoa
still can not work!help
Reply all
Reply to author
Forward
0 new messages