PHP and object class that return from web service
Posted: Mon Jan 13, 2003 2:00 am
i created my web service in C# that returns class
public class MyInfo
{
public int x;
public int y;
}
...
[WebMethod]
public MyInfo TestClass(int num1,int num2)
{
MyInfo info = new MyInfo();
info.x=num1;
info.y=num2;
return info;
}
then i use MSSOAP COM for calling web service
<?php
$myCom = new COM("MSSOAP.SoapClient");
$myCom->mssoapinit("http://localhost/WebService1/Service1.asmx?WSDL", "Service1");
echo $myCom->TestClass(1,2);
?>
it returns a word "OBJECT"
i dont know how can i get this result to show..
and ive tried..
$myCom->TestClass(1,2);
echo $myCom->x;
or
echo com_get($myCom->TestClass(1,2),"x");
it returns..
Warning: Unable to lookup x: Unknown name.
if ... gettype($myCom->TestClass(1,2)); it returns ..object
if ... get_class($myCom->TestClass(1,2)); it returns .. COM
please help me
thanks in advance
public class MyInfo
{
public int x;
public int y;
}
...
[WebMethod]
public MyInfo TestClass(int num1,int num2)
{
MyInfo info = new MyInfo();
info.x=num1;
info.y=num2;
return info;
}
then i use MSSOAP COM for calling web service
<?php
$myCom = new COM("MSSOAP.SoapClient");
$myCom->mssoapinit("http://localhost/WebService1/Service1.asmx?WSDL", "Service1");
echo $myCom->TestClass(1,2);
?>
it returns a word "OBJECT"
i dont know how can i get this result to show..
and ive tried..
$myCom->TestClass(1,2);
echo $myCom->x;
or
echo com_get($myCom->TestClass(1,2),"x");
it returns..
Warning: Unable to lookup x: Unknown name.
if ... gettype($myCom->TestClass(1,2)); it returns ..object
if ... get_class($myCom->TestClass(1,2)); it returns .. COM
please help me
thanks in advance