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

Howdy, Stranger!

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

Categories

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.