Skip to content

Commit

Permalink
2.11.22 Update web service
Browse files Browse the repository at this point in the history
  • Loading branch information
webpwnized committed Oct 8, 2024
1 parent a6b6270 commit db9ed0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/webservices/soap/ws-hello-world.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
require_once './lib/nusoap.php';

// Create the SOAP server instance
$server = new soap_server();
$lSOAPWebService = new soap_server();

// Initialize WSDL (Web Service Definition Language) support
$server->configureWSDL('hellowsdl', 'urn:hellowsdl');
$lSOAPWebService->configureWSDL('hellowsdl', 'urn:hellowsdl');

// Register the "hello" method to expose as a SOAP function
$server->register(
$lSOAPWebService->register(
'hello', // method name
array('name' => 'xsd:string'), // input parameter
array('return' => 'xsd:string'), // output parameter
Expand Down Expand Up @@ -48,9 +48,9 @@ function hello($name) {
// Handle the SOAP request with error handling
try {
// Process the incoming SOAP request
$server->service(file_get_contents("php://input"));
$lSOAPWebService->service(file_get_contents("php://input"));
} catch (Exception $e) {
// Send a fault response back to the client
$server->fault('Server', "SOAP Service Error: " . $e->getMessage());
$lSOAPWebService->fault('Server', "SOAP Service Error: " . $e->getMessage());
}
?>
4 changes: 2 additions & 2 deletions src/webservices/soap/ws-lookup-dns-record.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ function lookupDNS($pTargetHost) {
// Handle the SOAP request with error handling
try {
// Process the incoming SOAP request
$server->service(file_get_contents("php://input"));
$lSOAPWebService->service(file_get_contents("php://input"));
} catch (Exception $e) {
// Send a fault response back to the client
$server->fault('Server', "SOAP Service Error: " . $e->getMessage());
$lSOAPWebService->fault('Server', "SOAP Service Error: " . $e->getMessage());
}
?>

0 comments on commit db9ed0c

Please sign in to comment.