NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
getProxy error *solved*


Joined: 29 Mar 2005
Posts: 5
Reply with quote
Hi all ,

I'm having problems with the getProxy function

Warning: Invalid argument supplied for foreach() in nusoap.php on line 5071
Fatal error: Call to undefined function: showaddress()

this is the code that i use, very basic straight from PhpED:

$proxy = $soap->getProxy();

$location = array(country => "NL",city => "Amsterdam",state => "",zipCode => “”,cityCode => "",address => "");

$filter = "false";

$result = $proxy->ShowAddress($location, $filter);

ShowAddress -> is from the WSDL file.
nothing fancy, but still a reason to give some errors apparently

Sounds familiar to anyone ?
View user's profileFind all posts by johnnywuSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Can you list all the code related to nusoap calls ? How and what did you get in $soap variable in particular?
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 29 Mar 2005
Posts: 5
Reply with quote
ddmitrie wrote:
Can you list all the code related to nusoap calls ? How and what did you get in $soap variable in particular?


here it is

--------------------
require_once('nusoap.php');
// config.php has $user $pass
require_once('config.php');
// set the URL or path to the WSDL document
$wsdl = "file://F:/common/wsdl/test.wsdl";

// instantiate the SOAP client object
$soap = new soapclient($wsdl,"wsdl");
$soap->setCredentials($user, $pass);

// get the SOAP proxy object, which allows you to call the methods directly
$proxy = $soap->getProxy();

// set parameter location (PostalAddress)
$location = array(country => "NL",city => "Amsterdam",state => "",zipCode => “”,cityCode => "",address => "");

// set parameter filter (boolean)
$filter = "false";

// get the result, a native PHP type, such as an array or string
$result = $proxy->ShowAddress($location,$filter);
--------------------

the result is the error message without any data:

Warning: Invalid argument supplied for foreach() in nusoap.php on line 5071
Fatal error: Call to undefined function: showaddress()
View user's profileFind all posts by johnnywuSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Probably, there is something wrong with WSDL file. Did you generate it using nusoap?
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 29 Mar 2005
Posts: 5
Reply with quote
No, i didn't

I saved the online version locally for testing.
The online version gave an error during the wizard procedure in PhpED due to the first line being a commented line <!-- generated by... -->

Using the version I saved after removing the comment made it possible to go through the wizard.

Is there a way to test if the getproxy is working?

greetz
View user's profileFind all posts by johnnywuSend private message


Joined: 29 Mar 2005
Posts: 5
Reply with quote
I've noticed when testing other examples that when i use the getProxy method i always get an error.
The ones that i get using the Amazon example:

Code:

require_once 'nusoap.php';

$wsdl_url = 'http://soap.amazon.com/schemas3/AmazonWebServices.wsdl';
$WSDL     = new soapClient($wsdl_url);
$client   = $WSDL->getProxy();

$params   = array(
    'manufacturer' => "O'Reilly",
    'mode'         => 'books',
    'sort'         => '+title',
    'page'         => 1,
    'type'         => 'lite',
    'tag'          => 'trachtenberg-20',
    'devtag'       => 'XXXXXXXXXXXXXX',
);

$books    = $client->ManufacturerSearchRequest($params);


I have tested different SOAP classes and NuSOAP versions

I get with the NuSOAP version (v 1.69) included in recent PhpEd :
-
Warning: Invalid argument supplied for foreach() in nusoap.php on line 5071
Fatal error: Call to undefined function:
-

other SOAP solutions or with NuSOAP v 1.86:
-
Fatal error: Call to a member function on a non-object
View user's profileFind all posts by johnnywuSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Hmm, seems your code works w/o any problems on the client side...
I only added 'wsdl' argument.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 29 Mar 2005
Posts: 5
Reply with quote
adding the "wsdl" does the trick with amazon

still no luck on the first one tough Sad

is there a way to do other tests ?

I'm kinda new to SOAP, so all help is welcome Wink
View user's profileFind all posts by johnnywuSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
You probably need to check your WSDL first to see if it contains all necessary info. Did you check it with another soap clients?
View user's profileFind all posts by dmitriSend private messageVisit poster's website
getProxy error *solved*
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic