NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
call to undefined method


Joined: 24 Jan 2006
Posts: 3
Reply with quote
In webservices i'm a total newbie. I need to make a webservice for my job, and so i started to surf the internet for information and i came up with nusoap.

i tried the examples but i allways get an empty result. I didn't get an error message, except on the server-side script: Here's the xml-code:

Code:

<?xml version="1.0" ?>
- <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd">
- <SOAP-ENV:Body>
- <SOAP-ENV:Fault>
  <faultcode>Server</faultcode>
  <faultactor>method '' not defined in service ''</faultactor>
  <faultstring />
  <faultdetail />
  </SOAP-ENV:Fault>
  </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>


method not defined... does anyone has any idea?
thx
View user's profileFind all posts by dubbelpuntSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7901
Reply with quote
1) What soap tool/library/etc are you running on the server side?
2) How are you calling it on the client machine?
If you need people there to help you, please be more descriptive.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 24 Jan 2006
Posts: 3
Reply with quote
i'm trying to run the basic example of NuSOAP.
NuSOAP ==> 0.6.1

On server-side i've got this:
Code:

<?php
   require_once('nusoap.php');
   
   $server = new soap_server;
   $server->register('taxCalc');
   
   function taxCalc($rate, $sub)
   {
      if($rate == '' || $rate <= 0)
      {
         return new soap_fault('Client', '', 'Taks moet groter zijn dan nul.', '');
      }
      
      if($sub == '' || $sub <= 0)
      {
         return new soap_fault('Client', '', 'Subtotaal moet groeter zijn dan nul.', '');
      }
      
      return (($rate / 100) * $sub) + $sub;
   }
   
   $server->service($HTTP_RAW_POST_DATA);
   exit();
?>


on client-side, i've got this:
Code:

<?php
   require_once('nusoap.php');
   
   $param = array('rate' => '7', 'sub' => '816');
   
   $client = new soapclient('url_to_serverscript');
   $response = $client->call('taxCalc', $param);
   
   if($client->fault)
   {
      echo "Fault: <p>Code: {$client->faultcode}<br>";
      echo "String: {$client->faultstring}";
   }
   else
   {
      echo "$". $response;
   }
?>
View user's profileFind all posts by dubbelpuntSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7901
Reply with quote
please check if register_long_arrays is On and $HTTP_RAW_POST_DATA contains posted data
it's also unclear if nusoap.php was really included in your server script or not (enable php logs on the server and check them).

You may try to adjust the following sample to your needs:

Code:
<?php
  require_once('nusoap.php');
  $server = new soap_server;
  $server->configureWSDL('Test','http://soapinterop.org/');
  $server->wsdl->schemaTargetNamespace = 'http://soapinterop.org/xsd/';
 
  $server->register(
        'hello',
        array('name'=>'xsd:string'),
        array('return'=>'xsd:string'),
        'http://soapinterop.org/');

  function hello($name){
     return "Hello $name!<br>You sent me name=$name";
  }

  $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ?
     $HTTP_RAW_POST_DATA : '';
  $server->service($HTTP_RAW_POST_DATA);
?>
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 24 Jan 2006
Posts: 3
Reply with quote
I've found my first error, I had a space on the end of the nusoap.php, so the header information couldn't be sent.

Now, I have to following error, but I can't find a solution:

Fault: Array ( [faultcode] => Client [faultactor] => [faultstring] => error in msg parsing: XML error parsing SOAP payload on line 1: junk after document element [detail] => Array ( [soapVal] => ) )

Does anyone have an idea how to solve this?
View user's profileFind all posts by dubbelpuntSend private message
call to undefined method
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