Skip to content

sagarsdeshmukh/nusoap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nusoap PHP library

Simple example of Soap client call -

<?php
	require_once('lib/nusoap.php');

	$wsdl   = "http://<your_web_service_url>?wsdl";
	$client = new nusoap_client($wsdl, 'wsdl');
	
	// Input params
	$username = "username";
	$password = "pass";
	
	// In this demo, we use json data , you can use any other data format for same
	$json	  = '{"param1":"value1","param2":"value2"}';

	$client->setCredentials($username, $password);
    $error = $client->getError();
	
	if ($error)
	{
		echo $error; die();
	}
	
	$action = "webservice_methode_name"; // webservice method name
	
	$result = array();

	if (isset($action))
	{
		$result['response'] = $client->call($action, $json);
	}
	
	echo "<h3>Output : </h3>";
	echo $result['response'];
	echo "<h2>Request</h2>";
	echo "<pre>" . htmlspecialchars($client->request, ENT_QUOTES) . "</pre>";
	echo "<h2>Response</h2>";
	echo "<pre>" . htmlspecialchars($client->response, ENT_QUOTES) . "</pre>";
?>

About

Nusoap PHP library

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%