Re: Question on accessing C# Web Service
| From: | Adam | Date: | Wed, 30 Mar 2005 23:44:58 +0000 |
| Subject: | Re: Question on accessing C# Web Service | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-25799@lists.php.net to get a copy of this message | ||
I changed the php code to the follows.
<html>
<body><?php echo "Hello World"; ?>
<br>
<?php
require_once('lib\nusoap.php');
$client = new soapclient('http://localhost/TestService/Service1.asmx?WSDL',
'wsdl');
$soap_proxy = $client->getProxy();
$rs = $soap_proxy->HelloWorld(null);
echo $rs;
?>
</body>
</html>
=== Output ===
Hello World
Array
However the output is till $rs = Array
Am I missing anything, or I need to install other PHP support package.
Adam
"Charles P. Killmer" <charlesk@netgaintechnology.com> wrote in message
news:CA44979F4F707E499D909DAC3464D9AC227916@ngsv24.my-netgain.com...
You could print_r $rs and see exactly what it contains. Otherwise you
could add this to your code to make things simpler.
$soap_proxy = $client->getProxy();
$result = $soap_proxy->HelloWorld();
This is how I do it.
Charles
-----Original Message-----
From: Adam [mailto:yipky@hotmail.com]
Sent: Wednesday, March 30, 2005 1:28 PM
To: php-windows@lists.php.net
Subject: [PHP-WIN] Question on accessing C# Web Service
Hello
I am new to PHP soap and I have a simple question.
here is my simple hello world server class
namespace TestService
{
public class Service1 : System.Web.Services.WebService {
public Service1()
{
InitializeComponent();
}
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}
}
and Here is my PHP client
<html>
<body><?php echo "Hello World"; ?>
<br>
<?php
require_once('lib\nusoap.php');
$client = new
soapclient('http://localhost/TestService/Service1.asmx?WSDL',
'wsdl');
$rs = $client->call('HelloWorld');
echo 'result:' . $rs;
?>
</body>
</html>
The result I got is
Hello World
result:Array
Can anyone pls help me with this ??
It return no error, but say rs is an Array. When I try to access the $rs
as array it gives me a offset error.
--
PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php