two question regarding SOAP and PHP
| From: | Rajarshi Guha | Date: | Mon, 19 Mar 2007 21:05:40 +0000 |
| Subject: | two question regarding SOAP and PHP | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-2484@lists.php.net to get a copy of this message | ||
Hi, I'm using SOAP 0.9.0 with PHP 5.1 on Fedora Core 5.
I have a Java SOAP service that has a number of methods that have the
same name but differ in their arguments.
When I instantiate a client object by doing
$client = new SOAP_Client('http://rguha.ath.cx:8080/rws/services/FeatureSelection?wsdl');
the client only sees the last of these functions. Thus, if the WSDL
defines functions
func(int x, int y)
func(int x, int y, String z)
the PHP client will only see the last one. Is there any way to get at
the other corresponding functions in the WSDL?
My other question is related to 2D arrays. I have a Java service that
accepts a double[][] and double[] and returns a double[][]
My client, below, behaves weirdly printing out the input arrays for some
reason and then reports
org.xml.sax.SAXException: No deserializer for {http://www.w3.org/2001/XMLSchemas}anyType
Does anybody know how I can get around this problem? Can PHP SOAP handle
2D arrays?
Any pointers would be much appreciated.
--%<--------------------------------------------
<?php
require_once('SOAP/WSDL.php');
require_once('SOAP/Client.php');
$client = new
SOAP_Client('http://rguha.ath.cx:8080/rws/services/FeatureSelection?wsdl');
srand(time());
$y = array();
for ($i = 0; $i < 10; $i++) $y[$i] = rand(0, 100);
$x = array();
for ($i = 0; $i < 10; $i++) {
$tmp = array();
for ($j = 0; $j < 3; $j++) {
$tmp[$j] = rand(0,100);
}
$x[$i] = $tmp;
}
$params = array('x' => $x, 'y' => $y, 'nmodel' => intval(1),
'nvar' => intval(4), 'method' => strval('exhaustive'));
$soapoptions = array('timeout' => 360);
$ret = $client->call('fsStepwise',$params,$soapoptions);
if (PEAR::isError($ret)) {
echo $ret->getMessage();
print "\n\n";
}
print count($ret);
?>
-------------------------------------------------------------------
Rajarshi Guha <rguha@indiana.edu>
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
-------------------------------------------------------------------
A method of solution is perfect if we can forsee from the start,
and even prove, that following that method we shall attain our aim.
-- Leibnitz