Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

how to call php web service from .aspx without adding Web Preference?

I have a following php web service (nusoap-server-struct.php):
<?php
require_once('lib/nusoap.php');
$server = new nusoap_server();
$server->configureWSDL('hellowsdl2', 'urn:hellowsdl2');
$server->wsdl->addComplexType(
'SweepstakesGreeting',
'complexType',
'struct',
'all',
'',
array(
'greeting' => array('name' => 'greeting', 'type' => 'xsd:string'),
'winner' => array('name' => 'winner', 'type' => 'xsd:boolean')
)
);

$server->register('hello1', // method name
array('name' => 'xsd:string'), // input parameters
array('return' => 'xsd:string'), // output parameters
'urn:hellowsdl2', // namespace
'urn:hellowsdl2#hello', // soapaction
'rpc', // style
'encoded', // use
'Say hello' // documentation
);

$server->register('hello2', // method name
array('name' => 'xsd:string'), // input parameters
array('return' => 'tns:SweepstakesGreeting'), // output parameters
'urn:hellowsdl2', // namespace
'urn:hellowsdl2#hello', // soapaction
'rpc', // style
'encoded', // use
'Greet a person entering the sweepstakes' // documentation
);

function hello1($name) {
return 'Hello, ' . $name;
}

function hello2($name) {
$greeting = 'Hello, ' . $name;

$winner = $name == 'Sang';

return array(
'greeting' => $greeting,
'winner' => $winner
);
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>

I

Comments

Sign In or Register to comment.