Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ERROR: SOAP CALL Internal Error

990 views
Skip to first unread message

pittala...@gmail.com

unread,
Sep 12, 2014, 11:59:40 AM9/12/14
to
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

Jerry Stuckle

unread,
Sep 12, 2014, 1:16:56 PM9/12/14
to
Just a quick look - don't have time right now to spend in a detailed
examination. But if this is HTTPS, shouldn't your $action be 'https://...'?

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstu...@attglobal.net
==================

bill

unread,
Sep 12, 2014, 1:29:49 PM9/12/14
to
On 9/12/2014 11:59 AM, pittala...@gmail.com wrote:
> function __doRequest($request, $location, $action, $version, $one_way = 0) {
> $action = 'http://visualizzaerogato.wsdl.dem.sanita.finanze.it/VisualizzaErogato'; // override soapaction here

no experience using SOAP, but I did notice that the
documentations calls for https and you appear to be using http.

Vito Vittorio Pittalà

unread,
Sep 12, 2014, 3:58:03 PM9/12/14
to
Il giorno venerdì 12 settembre 2014 19:29:49 UTC+2, bill ha scritto:
> On 9/12/2014 11:59 AM,
>
I just checked the wsdl file, which I enclose, action is correct, I tried to change it to HTTPS and the result has not changed

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:ricevutans="http://visualizzaerogatoricevuta.xsd.dem.sanita.finanze.it" xmlns:richiestans="http://visualizzaerogatorichiesta.xsd.dem.sanita.finanze.it" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://visualizzaerogato.wsdl.dem.sanita.finanze.it" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://visualizzaerogato.wsdl.dem.sanita.finanze.it">
<wsdl:types>
<xsd:schema elementFormDefault="qualified">
<xsd:import namespace="http://visualizzaerogatorichiesta.xsd.dem.sanita.finanze.it" schemaLocation="VisualizzaErogatoRichiesta.xsd"/>
</xsd:schema>
<xsd:schema elementFormDefault="qualified">
<xsd:import namespace="http://visualizzaerogatoricevuta.xsd.dem.sanita.finanze.it" schemaLocation="VisualizzaErogatoRicevuta.xsd"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="ricevuta">
<wsdl:part name="VisualizzaErogatoRicevuta" element="ricevutans:VisualizzaErogatoRicevuta"/>
</wsdl:message>
<wsdl:message name="richiesta">
<wsdl:part name="VisualizzaErogatoRichiesta" element="richiestans:VisualizzaErogatoRichiesta"/>
</wsdl:message>
<wsdl:portType name="visualizzaErogatoPT">
<wsdl:operation name="visualizzaErogato">
<wsdl:input message="tns:richiesta"/>
<wsdl:output message="tns:ricevuta"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="visualizzaErogatoBinding" type="tns:visualizzaErogatoPT">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="visualizzaErogato">
<soap:operation soapAction="http://visualizzaerogato.wsdl.dem.sanita.finanze.it/VisualizzaErogato"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="demVisualizzaErogato">
<wsdl:port name="demVisualizzaErogato" binding="tns:visualizzaErogatoBinding">
<soap:address location="http://localhost:9080/DemRicettaErogatoServicesWeb/services/demVisualizzaErogato"/>
</wsdl:port>
</wsdl:service>
<wsdl:documentation>Versione 1.2</wsdl:documentation>
</wsdl:definitions>

Jerry Stuckle

unread,
Sep 13, 2014, 3:52:37 PM9/13/14
to
Where did you get this wsdl? Was it supplied for you, or did you have
to come up with it yourself (I visited the site, but unfortunately, I
don't understand Italian).

Also, you should be logging all PHP errors. In your php.ini file for
your development system, you should have

error_reporting = E_ALL
display_errors = on

The values of log_errors and error_log can also be specified, if you wish.

For production, you should have

error_reporting = E_ALL
display_errors = off
log_errors = on
error_log = (path to a file here)

Then see what errors get logged.

Vito Vittorio Pittalà

unread,
Sep 16, 2014, 1:51:54 PM9/16/14
to
The manager of web services has provided me the WSDL file, the XSD file, the CA certificate in PEM format, ENDPOINT to access services, the ACTION that is http and not https.
the PHP.INI file has
error_reporting = E_ALL & E-NOTICE

display_errors = off

log_errors = on

error_log = error.txt

and error.txt file does not contain any error code.

they say that starch could be a problem in the construction of the XML file, actually I noticed that getLastRequest returns xmlns: ns1 = "http://visualizzaerogatorichiesta.xsd.dem.sanita.finanze.it, so I changed the file xlm with the prefix ns1 , but the result does not change it keeps coming back Iternal error sending variables returned by the call



An exception occured: SoapFault exception: [env:Client] Internal Error in C:\apache\htdocs\mail\soap.php:39 Stack trace: #0 C:\apache\htdocs\mail\soap.php(39): SoapClient->__soapCall('visualizzaEroga...', Array) #1 {main}

__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: 605
Authorization: Basic VVdUM0NCWFg6UEJVVzlFQlA=

__getLastRequest():<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://visualizzaerogatorichiesta.xsd.dem.sanita.finanze.it"><SOAP-ENV:Body><ns1:VisualizzaErogatoRichiesta">
<ns1:pinCode>xxxxx</ns1:pinCode>
<ns1:codiceRegioneErogatore>190</ns1:codiceRegioneErogatore>
<ns1:codiceAslErogatore>201</ns1:codiceAslErogatore>
<ns1:codiceSsaErogatore>xxxxxx</ns1:codiceSsaErogatore>
<ns1:pwd>xxxxxxxx</ns1:pwd>
<ns1:nre>xxxxxxxxxxx</ns1:nre>
<ns1:cfAssistito>xxxxxxxxxxxxxx</ns1:cfAssistito>
<ns1:tipoOperazione>1</ns1:tipoOperazione>
</ns1:VisualizzaErogatoRichiesta></SOAP-ENV:Body></SOAP-ENV:Envelope>
__getLastResponseHeaders():HTTP/1.1 500 Error
Content-Type: text/xml; charset=utf-8
X-Backside-Transport: FAIL FAIL
Connection: close
__getLastResponse:<?xml version='1.0' ?>
<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
<env:Body>
<env:Fault>
<faultcode>env:Client</faultcode>
<faultstring>Internal Error</faultstring>
</env:Fault>
</env:Body>
</env:Envelope>
</pre>

Denis McMahon

unread,
Sep 16, 2014, 3:53:25 PM9/16/14
to
On Tue, 16 Sep 2014 10:51:24 -0700, Vito Vittorio Pittalà wrote:

> the PHP.INI file has error_reporting = E_ALL & E-NOTICE

I think if anything that should be E_NOTICE

--
Denis McMahon, denismf...@gmail.com

Vito Vittorio Pittalà

unread,
Sep 17, 2014, 7:46:18 AM9/17/14
to
I deleted e-notice of it has now become
error_reporting = E_ALL
I noticed a " more in the request
SOAP-ENV: Body> <ns1: VisualizzaErogatoRichiesta "
Now stay is incorrect, but the error persists. I'll try the same code in visual basic. the error is:

An exception occured: SoapFault exception: [env:Client] Internal Error in C:\apache\htdocs\mail\soap.php:39 Stack trace: #0 C:\apache\htdocs\mail\soap.php(39): SoapClient->__soapCall('visualizzaEroga...', Array) #1 {main}

__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: 605
Authorization: Basic VVdUM0NCWFg6UEJVVzlFQlA=

__getLastRequest():<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://visualizzaerogatorichiesta.xsd.dem.sanita.finanze.it"><SOAP-ENV:Body><ns1:VisualizzaErogatoRichiesta>
<ns1:pinCode>xxxx</ns1:pinCode>
<ns1:codiceRegioneErogatore>xxx</ns1:codiceRegioneErogatore>
<ns1:codiceAslErogatore>xxx</ns1:codiceAslErogatore>
<ns1:codiceSsaErogatore>xxxxxx</ns1:codiceSsaErogatore>
<ns1:pwd>xxxxxx</ns1:pwd>
<ns1:nre>xxxxxxxxxx</ns1:nre>
<ns1:cfAssistito>xxxxxxxxx</ns1:cfAssistito>

Jerry Stuckle

unread,
Sep 17, 2014, 11:47:43 AM9/17/14
to
OK, I've had more time to look at this. I know this is a stupid
question - but you are connecting to the correct server, right? Some
companies have more than one SOAP server and it can be easy to connect
to the wrong one (I don't think this is the case - but sometimes the
obvious gets missed).

The keys here is the <faultstring>Internal Error</faultstring>

This is indicating an error was detected by the server. Unfortunately,
it doesn't pass more information along as to what the error is (on
purpose for security reasons so that it doesn't show details of the
server's implementation).

I don't see anything obviously wrong with your PHP code, but there are a
lot of unknowns here, also - like is the certificate valid (probably),
is the wsdl correct (it's well-formatted XML, but that's all I can
tell), and a bunch of other things only your host would know

Also, I'm not sure where the extra '"' came from - I don't see it in
your XML (or the XML would be invalid).

Your best bet is to go to the provider and have them check their error
logs, which will contain more information about the error. There just
isn't enough information from the client side to determine what the
problem is.

My best bet would be something invalid in the WSDL - perhaps a typo or a
change in the server which didn't get reflected in their sample code.
But it's only a guess.

Sorry I can't be of more help.
0 new messages