A Basic Guide To Implement A SOAP Client in PHP: Downloading, Installing and Configuring PHP
A Basic Guide To Implement A SOAP Client in PHP: Downloading, Installing and Configuring PHP
http://www.php.net/downloads.php
If you are using the installer, the setup will automatically configure apache and other
settings for you.
If you are installing from binaries you will need to perform the following extra steps.
Search for the section of the file that has a series of commented out "LoadModule"
statements. Add the following line after all the LoadModule statements: (This line
may vary depending on your PHP version)
For, for Apache 1.3.X users, search for the block of "AddModule" statements. Add
the following line after the last "AddModule" statement: If you're using Apache 2.X,
you do not have to insert the AddModule directive. It's no longer needed in that
version. Apache 2.X has its own internal method of determining the correct order of
loading the modules.
AddModule mod_php4.c
Finally, search for "AddType" in the file, and add the following line after the last
"AddType" statement:
Make sure that you have restarted apache after modifying its configuration.
Make sure that your apache httpd.conf document root to point to htdocs. Place the
above file (say phptest.php) in you apache/htdocs folder.
http://localhost/phpinfo.php
This sample program helps you find important settings in your PHP.
It is very helpful to see errors (if any) on the browser during run time, especially when
debugging. To enable this feature you need to configure additional settings.
Edit your php.ini, which you moved to c:/Windows as follows at the start. Change
display_errors to On if its Off.
When you need to access URL with https, you need to install/enable cURL
extensions. Since PageOne’s endpoint for soap stats with https, this has to be
configured as described below.
2. Copy php5ts.dll (located in <your php directory>\) to your Apache bin folder
3. Copy libeay32.dll and ssleay32.dll (located in <your php directory>) to
c:\windows\system32
4. Download cURL SSL version for Windows at: http://curl.haxx.se/download.html
5. Download OpenSSL for Windows from
http://curl.haxx.se/download.html
6.
[Windows XP Install Only] Check to see if you have the following file:
c:\windows\system32\msvcr70.dll. If not, search for it in Google and download it to
system32. You may get error messages without it.
7. Uncomment the curl line in your php.ini file to enable curl: extension=php_curl.dll
One you have configured your environment as described in the previous sections, you
can run your PHP scripts.
https://soap.oventus.com/LiquidWS/MessageService?WSDL
https://soap.oventus.com/LiquidWS/MessageService
<?php
require_once('lib/nusoap.php');
$ns2 = "http://jaxb.liquidsoap.pageone.com";
$sessionID = send_soapLoginRequest("login",
get_login_body('enter user name here','enter password'));
send_message_request('sendMessage',get_sendMesssage_body('enter
a valid mobile number','enter your message here'),$sessionID);
$client=new nusoap_client(SERVER_ENDPOINT);
return;
$client=new nusoap_client(SERVER_ENDPOINT);
return;
$soapxml = $client->serializeEnvelope($body,
get_header($sessionID), array(), 'document', 'literal');
printRequestResponse($client, $result);
$info = $client->response;
$parts = explode("transactionID",$info);
echo $session_info;
echo '</pre>';
return;
}
function get_login_body($userid,$pwd)
return "<m:loginRequest
xmlns:m=\"http://jaxb.liquidsoap.pageone.com\" service-id=\"0\"
vezrsion-id=\"\">\n"
."<user-id>".$userid."</user-id>\n"
."<pwd>".$pwd."</pwd>\n"
."</m:loginRequest>\n";
function get_sendMesssage_body($destination,$message)
return "<m:sendMessageRequest
xmlns:m=\"http://jaxb.liquidsoap.pageone.com\"
flashSMS=\"false\">\n"
."<destinationAddress>".$destination."</destinationAddres
s>\n"
."<message>".$message."</message>\n"
."</m:sendMessageRequest>\n";
function get_header($sessionID)
return "<m:pageoneHeader
xmlns:m=\"http://jaxb.liquidsoap.pageone.com\"><session-id>".
$sessionID."</session-id></m:pageoneHeader>";
}
function get_session_id($client, $result)
$info = $client->response;
$parts = explode("session-id",$info);
echo $session_info;
echo '</pre>';
return $session_info;
'<h3>Response</h3><textarea cols="100"
rows="20">'.$client->response.'</textarea><br />';
if ($client->fault)
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
else
check_error($client);
}
function check_error($client)
$err = $client->getError();
if ($err)
echo '<h2>'.$message.'</h2><pre>'.$err.'</pre>';
return true;
else
return false;
?>