Created
February 2, 2017 16:48
-
-
Save jorgedison/fc79ba83e18fd107ca470049d7974a92 to your computer and use it in GitHub Desktop.
Cliente NuSOAP para consumir WSDL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('lib/nusoap.php'); | |
$wsdl = "https://pagoefectivo.pe/PagoEfectivoWSGeneralv2/service.asmx?WSDL"; | |
$client = new nusoap_client($wsdl, 'wsdl'); | |
// Seguridad | |
$username = "username"; | |
$password = "pass"; | |
// Si usamos json | |
$json = '{"param1":"value1","param2":"value2"}'; | |
$client->setCredentials($username, $password); | |
$error = $client->getError(); | |
if ($error) | |
{ | |
echo $error; die(); | |
} | |
$action = "ConsultarCIPMod1"; // Nombre del metodo | |
$result = array(); | |
if (isset($action)) | |
{ | |
$result['response'] = $client->call($action, $json); | |
} | |
echo "<h3>Output : </h3>"; | |
echo $result['response']; | |
echo "<h2>Request</h2>"; | |
echo "<pre>" . htmlspecialchars($client->request, ENT_QUOTES) . "</pre>"; | |
echo "<h2>Response</h2>"; | |
echo "<pre>" . htmlspecialchars($client->response, ENT_QUOTES) . "</pre>"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment