-
Notifications
You must be signed in to change notification settings - Fork 0
/
BRC_queryTCRM.php
executable file
·57 lines (51 loc) · 1.87 KB
/
BRC_queryTCRM.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
ini_set('max_execution_time', 5);
function web_services($metodo, $params) {
$wsdl = 'https://www.superfinanciera.gov.co/SuperfinancieraWebServiceTRM/TCRMServicesWebService/TCRMServicesWebService?WSDL';
$options = array(
'uri'=>'http://schemas.xmlsoap.org/soap/envelope/',
'actor'=>'http://action.trm.services.generic.action.superfinanciera.nexura.sc.com.co/',
'style'=>SOAP_RPC,
'use'=>SOAP_ENCODED,
'soap_version'=>SOAP_1_1, //version 1 obligatorio
'cache_wsdl'=>WSDL_CACHE_NONE,
'connection_timeout'=>5,
'trace'=>true,
'encoding'=>'UTF-8',
'exceptions'=>false,
'location' => 'https://www.superfinanciera.gov.co/SuperfinancieraWebServiceTRM/TCRMServicesWebService/TCRMServicesWebService', //endpoint
'typemap' =>
[ //namespace
"type_ns" => "http://action.trm.services.generic.action.superfinanciera.nexura.sc.com.co/",
"type_name" => "WebServiceTRMReference.TCRMServicesInterface",
"to_xml" => "some_funktion_name"
],
'stream_context' =>stream_context_create([
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
]
])
//'proxy_port' => 8080,
//'local_cert' => '/www/cer_superfinanciera.cer'
);
$nroError = '';
$msjError = '';
$result = '';
try {
$soap = new SoapClient( $wsdl, $options );
$data = $soap->$metodo( $params );
return $data->return;
}
catch(SoapFault $e) {
echo (string)$e->faultcode.'<br>';
echo (string)$e->getMessage().'<br>';
}
}
$r = web_services( 'queryTCRM', [ 'tcrmQueryAssociatedDate' => date( 'Y-m-d' ) ] );
if ( $r->success == true ){
header('Content-Type: application/json');
echo json_encode($r);
}
?>