Apache HTTP SERVER has stopped working while using soap client in - php

Getting
Apache HTTP SERVER has stopped working while using soap client in.
if SOAP API url not exist getting attached screen shot error again
Getting this error
I am using xampp v3.2.2 with php7.
Code which I am using
try
{
$vies = new SoapClient('http://www.webservicex.com/spc/globalweather.asmx?wsdl', array('exceptions'=>true));
var_dump($vies);
}
catch(SoapFault $e){
$return_value = 'VAT check service is not available.';
return $return_value;
}
Note:- same code working fine with 5.6.
Thanks in advance

Related

Salesforce PHP Toolkit 20 Error: SoapClient::__setSoapHeaders(): Invalid SOAP header

I am trying to do a very simple integration with the Salesforce PHP Toolkit 20.0. Everything works fine on my local server so I think it must be a server setting, but I don't see any issues with my server configuration. Additionally, the errors I'm getting aren't helping at all.
I've removed the actual authentication piece because I'm getting errors just running the basic createConnection function. Here is the code:
define("SOAP_CLIENT_BASEDIR", "soapclient");
require_once (SOAP_CLIENT_BASEDIR.'/SforceEnterpriseClient.php');
try {
$mySforceConnection = new SforceEnterpriseClient();
$mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/enterprise.wsdl.xml');
}
catch (Exception $e) {
exit($e->faultstring);
}
Running that code alone, I get the following error:
<br />
<b>Fatal error</b>: SoapClient::__setSoapHeaders(): Invalid SOAP header in <b>/home/website/public_html/app/equity/soapclient/SforceBaseClient.php</b> on line <b>325</b><br />
My server is running PHP 5.6 and OpenSSL, SOAP, SSL, and cURL is enabled.
I have no idea why, but changing my Salesforce password fixed the issue.

codeigniter sends blank page

I faced today a strange problem wich I cannot explain.
The Environment:
Ubuntu 16.04
Nginx 1.10 with php-fpm
php 7.0.8
So I migrated from a hosted server with apache and php5 to this new Server.
The first tests were successful. The page was running and seemed to be fine.
Then I encountered the Problem, that some pages couldn't be called. The HTTP response was 200 but the page was blank.
Chrome told me net::ERR_CONTENT_DECODING_FAILED
I found out, that the difference between working pages and the blank pages were, that the non-controller echoed json_encode() at the end;
This is my controller:
public function some_controller()
{
$result = ["test" => "abcde"];
echo json_encode($result);
}
This will end with net::ERR_CONTENT_DECODING_FAILED
This is my workarround:
public function some_controller()
{
$result = ["test" => "abcde"];
echo json_encode($result);
exit();
}
So following is unclear:
Why I have to exit() my controller now?
What is CI doing after a Controller function is passed?
Why was that working with Apache and PHP5? What could be the difference now?
Thank you all
I found the problem by myself.
After installing php7.0-xml the issue went away.
But can anyone tell me why the xml module is required for JSON responses?
Maybe its not the JSON, it is codeigniter wich needs the XML Module (After the controller is passed)?

SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://10.31.1.106:8080/gss-0.1/FileUtilities?wsdl'

I hope someone can help me because I am looking for the solution since 2 working days...
I have a php website which need to request a distant webservice.
When I try it on my computer (Win7 + WAMP), it works well.
When I try it on the webserver (CentOs6), it return me the following error :
SOAP-ERROR: Parsing WSDL: Couldn't load from
'http://ip_address:8080/gss-0.1/FileUtilities?wsdl' : failed to load
external entity "http://ip_address:8080/gss-0.1/FileUtilities?wsdl"
NB: the webservice is on the same network of my webserver (I do not use the same IP/port).
I know that the WSDL is accessible from the webserver because it is accessible using curl linux function.
curl http://ip_address:8080
My php code is:
<?php
$wsdl = "http://ip_address:8080/gss-0.1/FileUtilities?wsdl";
try{
$client = new SoapClient($wsdl ,array('trace' => 1,
'exceptions'=> 1,
'cache_wsdl' => WSDL_CACHE_NONE
));
}
catch(Exception $e) {
echo $e->getMessage();
}?>
OK I found a solution but I don't understand the problem...
So I execute this Linux command
setsebool -P httpd_can_network_connect on
And now all is running !
Response here: Thanks to user2533111
If its not firewalled there at your web server and its working in your local but not at your webserver(CentOS). its might be a case of different PHP version and php.ini settings.
Can you compare your PHP version and those below extensions in your CentOs server with your WAMP at local.
S0AP,
php_openssI,
openssI,
curI;

Error using SoapClient in PHP and AMPPS on OS X

I have installed AMPPS on OS X Mavericks and I am getting the error below when I try to access a WSDL over HTTPS in PHP by using the SoapClient class.
SOAP-ERROR: Parsing WSDL: Couldn't load from
'https://www.some-domain.com/Webservice.asmx?WSDL' : failed to load
external entity
"https://www.some-domain.com/secure/api/Webservice.asmx?WSDL"
OpenSSL, SOAP and cURL is enabled in when I run phpinfo(). I can retrieve the WSDL contents just fine by using file_get_contents(). There is no firewall blocking the connection. Other computers on the same network can connect just fine. Below is my code. It works on the production server as well as several other computers that I have used it on.
$this->wsdlUrl = 'https://www.some-domain.com/Webservice.asmx?WSDL';
$this->client = new SoapClient($this->wsdlUrl);
$this->client->Connect(array(
/* Login credentials */
));
I have also tried to use a stream context with verify_peer set to false, but with the same result. Increasing the default_socket_timeout option also does not work as some people have suggested.
I understand that there are several other questions concerning this error, but none of the proposed solutions that I could find work for me.
Any ideas? Thanks in advance!
I'm sure this will point you to the right direction:
try {
$sc= new SoapClient('https://www.some-domain.com/Webservice.asmx?WSDL');
$sc->Connect(/* Login credentials */);
} catch (SoapFault $fault) {
print_r($fault->faultstring);
}

Segmentation Fault on WSDL request on PHP

I've created this simple example based on wsdl mode sample of wso2 framework for php.
<?php
try {
$client = new WSClient(array("wsdl"=>"http://footballpool.dataaccess.eu/data/info.wso?wsdl",
));
$proxy = $client->getProxy();
$result = $proxy->TopGoalScorers(array('iTopN'=>1));
echo "TEST!!!<br />";
echo '<pre>';
print_r($result);
echo '</pre>';
} catch (Exception $e) {
echo "Message = ".$e->getMessage();
}
?>
If I execute this script in a web browser i got a http 324 error ERR_EMPTY_RESPONSE
And when i execute it in a shell it seems to work but at the end i get a segmentation fault error.
The same error will be reproduced using the sample file wsdl_11_client.php
If this line
$result = $proxy->TopGoalScorers(array('iTopN'=>1));
is commented no segmentation fault error will appear.
I'm using wsf wso2 framework for php version 2.1.0
libxml version 2.7.8
libxslt version 1.1.26
PHP Version 5.3.6-13ubuntu3.6
Ubuntu 11.10.
In my php.ini i've added
include_path = ".:/usr/share/php:/usr/lib/php5/20090626/wsf_c/scripts"
[wsf]
wsf.home="/usr/lib/php5/20090626/wsf_c"
;log_level2 shows warnings and errors
;wsf.log_level=2
;wsf.log_path="/var/log/wsf"
and i've added this extension in /etc/php5/conf.d/wsf.ini
; configuration for php WSF module
extension=wsf.so
Is my server misconfigurated? Or there are some errors in my php script?
Thanks in advance.
Francesco.
Same for me.
Taking into account the absence of activity on "WSO2 WSF for PHP" project, I suppose it would be better not to use it on production.
The best workaround probably would be to write Java proxy service which communicates with original service and returns something like JSON to PHP.

Categories