Jump to content

php web service


jayaraj

Recommended Posts

<?php

$client = new SoapClient("http://......../DatasetServiceService.asmx?wsdl");

$result = $client->GetDatasets("testing");

?>

 

    getLastResponse and getFunctions working properly but when i call the GetDatasets function,

The following error will occurs:   

 

 

Fatal error: Uncaught SoapFault exception: [soap:Server] System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DataSource.GetDatasets(String customer) in d:\WORKFLOWSERVICES\DatasetService\App_Code\DataSource.cs:line 313 at Service.GetDatasets(String customer) in d:\WORKFLOWSERVICES\DatasetService\App_Code\Service.cs:line 21 --- End of inner exception stack trace --- in /home/jayaraj/www/opt/trunk/web/src/webservices.php:22 Stack trace: #0 [internal function]: SoapClient->__call('GetDatasets', Array) #1 /home/jayaraj/www/opt/trunk/web/src/webservices.php(22): SoapClient->GetDatasets('test1') #2 {main} thrown in /home/jayaraj/www/opt/trunk/web/src/webservices.php on line 22

Link to comment
https://forums.phpfreaks.com/topic/197746-php-web-service/
Share on other sites

        I can use nusoap methods, then only my problem is solved

 

        require_once('nusoap.php');

 

$proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';

 

$proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';

 

$proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';

 

$proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';

 

$client = new nusoap_client('http://......./Service.asmx?wsdl', 'wsdl',

 

$proxyhost, $proxyport, $proxyusername, $proxypassword);

 

$err = $client->getError();

 

if ($err)

{

 

echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';

 

}

 

 

// Doc/lit parameters get wrapped

$param = array('Customer' => $_GET['name']);

 

 

$result = $client->call('GetPDFDetails', array('parameters' => $param), '', '', false, true);

 

 

 

                /*  ----------------------------------------------------

                      array('parameter'=>$param) 

                      //dont change "parameter"  it's an constant and "Customer" is XML Name

 

                    -----------------------------------------------------  */

 

 

Link to comment
https://forums.phpfreaks.com/topic/197746-php-web-service/#findComment-1040741
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.