NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
NuSoap Sample(s)


Joined: 11 Aug 2003
Posts: 11
Reply with quote
I have PHPed version 3.2
I'm using the NuSoap Wizard and when I choose a service or enter a WSDL document URL I get this message:
"Error retriving data!:
No input file especified"
Does anyone know how to solve it?
My web server works perfectly and also with php files
Alvaro.
View user's profileFind all posts by inforalvSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8328
Reply with quote
Soap is a protocol that requires two parts to be involved.

First one is close-end server that runs requests on the far-end server and shows results to the client.
NuSoap library can run on either or on both of them.

If you want to run NuSoap server on the far-end server (SOAP server) you'd create a php file and use it in your WSDL URL.
For example, suppose you have a php function on far-end server and you want it to be run via SOAP protocol:
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!";
  }

  $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ?
     $HTTP_RAW_POST_DATA : '';
  $server->service($HTTP_RAW_POST_DATA);
?>

You see that this you have to define input and output parameters for your function and register it with instance of soap_server class. This way you can register as many functions as you wish.
All of them can be invoked by any SOAP-compatible clients, not only NuSoap.
Target WSDL document is generated using data registered in $server->register() method call. Suppose you placed test.php file shown above in the root of you web. It means that the target WSDL URL should be
http://yourserver/test.php?wsdl
If you run this link without wsdl argument you'll see a short description in HTML form.

Now few hints about close-end server (SOAP client). It can run a given method on a given SOAP server using WSDL URL.
For example with the far-end server sample shown above it can be done using the following way:
Code:

<?php
  require_once('nusoap.php');
  $arg = "test message";
  $wsdl = "http://yourserver/test.php?wsdl";
  $soap = new soapclient($wsdl,"wsdl");
  $proxy = $soap->getProxy();
  $result = $proxy->hello($arg);
?>


Now about NuSoap wizard. It can generate a code sample shown above to be run on SOAP client side (close-end server). First it ask if you know a particular WSDL URL or want to select one from the public domain (service). Once WSDL URL is given you are able to select an operation (hello function in our case). Once operation is selected you can see all necessary arguments for it and you can type values that the call should be generated with.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 11 Aug 2003
Posts: 11
Reply with quote
OK!!!
It's very interesting!!
ALVARO.
View user's profileFind all posts by inforalvSend private message
NuSoap Sample(s)
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