I try for weeks and I can not risovere the problem is access to a SOAP service that I know:
1° service endpoint that is an HTTPS address
2° Test.pem -> CA certificate test
4° User: xxx
5° Password:xxx
6° Pincode: xxx
7° Pincode cifrato: xxx
the spec says succinctly:
The services exposed by SistemaTS via Web Service model and reported in this
document are available through the communication channel https.
The authentication is performed through the use of basic authentication.
For its proper setting is necessary to force the basic authentication
the http header, otherwise the refusal of web services by the system.
The php code is used:
<?php
class CustomSoapClient extends SoapClient {
function __doRequest($request, $location, $action, $version, $one_way = 0) {
$action = '
http://visualizzaerogato.wsdl.dem.sanita.finanze.it/VisualizzaErogato'; // override soapaction here
return parent::__doRequest($request, $location, $action,
$version, $one_way);
}
}
$options = array('soap_version' => SOAP_1_1,
'login' => 'xxxxxxxx',
'password' => 'XXXXXXXX',
'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_DEFLATE | 5,
'cache_wsdl' => WSDL_CACHE_NONE,
'connection_timeout' => 400,
'exceptions'=>true,
'trace'=>1
);
$client = new CustomSoapClient('DEMVISUALIZZAEROGATO.WSDL', $options);
$client->__setLocation('
https://XXXXXXXX');
$xml = '<?xml version="1.0" encoding="UTF-8"?>
<VisualizzaErogatoRichiesta xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file://VisualizzaErogatoRichiesta.xsd">
<pinCode>0Gv1vsTpzlvRD9kBd8FVLo2/441rZ8rRZVf0Zi9eO6+L7kme0KC8Vx6ZjRj/4JjA4aHPTCi3D6YW9OtmYkIpW7sfchmhqHdVORBZHPitiPHdr5iIipAhIzBhFOQIPfpYasW5cQmU//uNB4GSWSNDIkaqdMrDjTPpIkbKKeoA4dQ=</pinCode>
<codiceRegioneErogatore>XXX</codiceRegioneErogatore>
<codiceAslErogatore>XXX</codiceAslErogatore>
<codiceSsaErogatore>XXXXXX</codiceSsaErogatore>
<pwd>XXXXXXXX</pwd>
<nre>XXXXXXXXXXXXXXX</nre>
<cfAssistito>5uMCDNeF/QdSHO0HVx6k0ceUBg06b/xYH2A9ZfbO8vyl8fz/GSFFy1Piwf2sRYBqVh6hrPr+z7j4W+pynSKdIg7RkWbACK1k8rw1d1aa1pc3GGMto6e3z7VwgSEsCrF6WTARqz5QIjRqeaXKymxqCKe+Dg8YLJPtzKTmZjDK1CM=</cfAssistito>
<tipoOperazione>1</tipoOperazione>
</VisualizzaErogatoRichiesta>';
$args = array(new SoapVar($xml, XSD_ANYXML));
$res = $client->__soapCall('visualizzaErogato', $args);
The code returned is:
Caught exception: Internal Error
__getLastRequestHeaders: POST /DemRicettaErogatoServicesWeb/services/demVisualizzaErogato HTTP/1.1 Host:
demservicetest.sanita.finanze.it Connection: Keep-Alive User-Agent: PHP-SOAP/5.2.14 Accept-Encoding: gzip, deflate Content-Encoding: deflate Content-Type: text/xml; charset=utf-8 SOAPAction: "
http://visualizzaerogato.wsdl.dem.sanita.finanze.it/VisualizzaErogato" Content-Length: 667 Authorization: Basic VVdUM0NCWFg6UEJVVzlFQlA=
__getLastRequest: XXXX
RESPONSE: HTTP/1.1 500 Error Content-Type: text/xml; charset=utf-8 X-Backside-Transport: FAIL FAIL Connection: close env:Client Internal Error
What does it mean ????
I tried to use certificates that have provided me with putting them in the parameters
$options = array('local_cert' => "test.pem",
'soap_version' => SOAP_1_1,
'login' => 'xxxxxxxx',
'password' => 'xxxxxxxx',
'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_DEFLATE | 5,
'cache_wsdl' => WSDL_CACHE_NONE,
'connection_timeout' => 400,
'exceptions'=>true,
'trace'=>1
);
The code returned is:
Caught exception: Could not connect to host
any help would be appreciated