PHP SoapClient error with line endings - php

I have a SoapServer running on a windows machine.
When I try to instantiate a SoapClient object from a linux machine, it fails with a nice
PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://172.23.5.124:8181/Pyxvital.exe/wsdl/IPyxvital' : Premature end of data in tag definitions line 1
If I try on a windows machine, it works.
I'm not sure, but it seems to come from the fact that the Soap server sends windows line endings in the XML response (I can see ^M in the XML when I open the WSDL file).
I changed the encoding in the SoapClient options, but I can't find if I can do anything to the line endings (I tryed auto_detect_line_endings in php.ini, but it seems to affect only fgets).
Thanks.

Related

How to overcome maxreceivedmessagesize using php soapclient on linux

Hi I am interrogating a windows service on a remote IIS server from my Linux server using PHP soapclient.
Everything's working fine except when I make a request that returns a large chunk of data, I get the following message:
Fatal error: Uncaught SoapFault exception: [a:InternalServiceFault] The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
Is there something I can do with SoapClient to increase this value? I assume that it is at my end that the problem is arising...? Everything I read says to 'increase the MaxReceivedMessageSize in the appropriate web.config or app.config'. I don't have anything like that here on the client-side, just a couple of lines of PHP that make the call using the PHP soap class.
Any help welcome!

PHP fatal error opening required

I've copied php and IIS files to new PC and can't bring it to work. Everytime getting this error:
Fatal error: Unknown: Failed opening required '-' (include_path:.;C:\PHP\includes)
So, what IS THIS -> '-'? My index.php just contain only two strings, it's <?php and phpinfo();
Some problems may occur when you use IIS under WIndows OS due to a misunderstanding of the file paths that contain non-Latin characters . Check the file path for the presence of non-Latin characters . Also try to change the encoding utf8 script - cp1251
For the information of anyone else who encounters this problem, I was attempting to use php 7.1 on Windows 10 and IIS using localhost.
I had only a test page containing a single phpinfo() command, but when I attempt to navigate to this page, I got:
Fatal error: Unknown: Failed opening required '-' (include_path='.;C:\php\pear') in Unknown on line 0
In my case, the handler mapping in iis was mis-configured.
Start IIS and under Double Click Handler mappings.
Select the entry for *.php and click Edit in the actions menu.
Change php.exe to php-cgi.exe as shown below.
You might also like to look at this page which explains things in a bit more detail:
http://php.net/manual/fa/install.windows.iis7.php
Regards.
Chris B.

random Soap Error: Couldn't load from

While consuming the webservice, I sometimes get this error. And they are pretty sure their webservice is up and running.
Our server is amazon ec2 and php version is : PHP 5.3.20
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://...webservice..asmx?wsdl' : failed to load external entity "http://...webservice..asmx?wsdl"
Any idea?
You can Try enabling the php_openssl extension in your local server by only uncommening the line "extension=php_openssl.dll" in you php.ini file

WSDL reading shows strange first character with php

I'm reading a wsdl for SOAP connection :
https://api3.popfax.com/index.php?service=Popfax&wsdl
Other clients (mobile apps, desktop software, ...) are using it and have been doing so for a long time.
When I try to construct a SoapClient from it, I get :
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://api3.popfax.com/index.php?service=Popfax&wsdl' : Start tag expected, '<' not found in D:\Dev\test\sendfax.php:32 Stack trace: #0 D:\Dev\test\sendfax.php(32): SoapClient->SoapClient('https://api3.po...') #1 {main} thrown in D:\Dev\test\sendfax.php on line 32
So I wrote this to test what I got :
$wsdl = 'https://api3.popfax.com/index.php?service=Popfax&wsdl';
$bip = file_get_contents($wsdl);
var_dump($bip);
And the result is string with on the first line :
'ï<?xml version="1.0" encoding="UTF-8"?>
And every time I reload that test script, the first character is different...
Any idea why ?
It's working fine for me. Have you tried using a simple text editor and just saving your code snippet in it, saving it with a .php suffix in your web root and calling it from localhost? (that's what I did)
It may be that the editor you're using has an encoding issue (just a huge guess).

Apache htdocs in folder with unicode name

I have my apache (for windows) htdocs in a folder like c:\anything1\怘怙怚怛\anything2. The problem is that in this case php won't execute any scripts from here and will display an error message like this:
`Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'c:/anything1/怘怙怚怛/anything2/index.php' (include_path='.;C:\php5\pear') in Unknown on line 0
`
If I try to open a html file, it is served by apache, so it seems that the problem appears only with php.
Do you have an idea how to solve this?
I may be wrong but I'd say you can't do it without patching PHP. Apache (or the PHP apache handler) passes PHP a path encoded in UTF-8 and PHP ultimately relies on the ANSI version of FindFirstFile (and you cannot set a UTF-8 codepage).
I suggest you submit a bug report.
i have same problem,
Read more # http://www.oneminuteinfo.com/2011/02/solve-php-failed-to-open-stream-error.html
it may be help you

Categories