473,394 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

General SOAP weirdness... libxml default stream context?

I had some problems on 1 particular server (up to 3 others with the same
PHP&SOAP version work, 1 of which with the same OS) with constructing a
SOAP client:

FAIL:
<?php
ini_set('soap.wsdl_cache_enabled',0);
$client = new SOAPClient('https://example.com/?WSDL');
?>
Error:
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing
WSDL: Couldn't load from 'https://....

SUCCESS:
<?php
ini_set('soap.wsdl_cache_enabled',0);
$ctx = stream_context_create();
libxml_set_streams_context($ctx);
$client = new SOAPClient('https://example.com/?WSDL');
?>

.... and it allready works, and I was planning to add all kinds of notifies
on stream alterations, disabling verify_peer (allthough the certificate is
valid..), etc. Nothing like that needed, just adding _some_ context
allready did the trick... I'm suitably amazed, any idea why this is? An
overriding of a buggy default context perhaps?

And some further digging, this was all that's needed:
<?php
ini_set('soap.wsdl_cache_enabled',0);
$client = new SOAPClient('https://example.com?WSDL',
array('stream_context'=stream_context_create()));
?>

Call me amazed. Ah well, the last server works too now...
--
Rik Wasmus
....spamrun finished
Jun 27 '08 #1
3 3168
Rik Wasmus wrote:
I had some problems on 1 particular server (up to 3 others with the same
PHP&SOAP version work, 1 of which with the same OS) with constructing a
SOAP client:

FAIL:
<?php
ini_set('soap.wsdl_cache_enabled',0);
$client = new SOAPClient('https://example.com/?WSDL');
?>
Error:
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing
WSDL: Couldn't load from 'https://....

SUCCESS:
<?php
ini_set('soap.wsdl_cache_enabled',0);
$ctx = stream_context_create();
libxml_set_streams_context($ctx);
$client = new SOAPClient('https://example.com/?WSDL');
?>

... and it allready works, and I was planning to add all kinds of
notifies on stream alterations, disabling verify_peer (allthough the
certificate is valid..), etc. Nothing like that needed, just adding
_some_ context allready did the trick... I'm suitably amazed, any idea
why this is? An overriding of a buggy default context perhaps?

And some further digging, this was all that's needed:
<?php
ini_set('soap.wsdl_cache_enabled',0);
$client = new SOAPClient('https://example.com?WSDL',
array('stream_context'=stream_context_create()));
?>

Call me amazed. Ah well, the last server works too now...
--Rik Wasmus
...spamrun finished
Hey Rik:

I think it may be a bug. I pasted your error in Google and found these
two bug reports:

<URL:http://bugs.php.net/bug.php?id=34657>
<URL:http://bugs.php.net/bug.php?id=38703>

I'm not sure if this will shed light on your particular case, but hope
it helps.

--
Curtis
Jun 27 '08 #2
On Wed, 04 Jun 2008 22:28:40 +0200, Curtis <ze******@verizon.netwrote:
Rik Wasmus wrote:
>I had some problems on 1 particular server (up to 3 others with the
same PHP&SOAP version work, 1 of which with the same OS) with
constructing a SOAP client:
FAIL:
<?php
ini_set('soap.wsdl_cache_enabled',0);
$client = new SOAPClient('https://example.com/?WSDL');
?>
Error:
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing
WSDL: Couldn't load from 'https://....
SUCCESS:
<?php
ini_set('soap.wsdl_cache_enabled',0);
$ctx = stream_context_create();
libxml_set_streams_context($ctx);
$client = new SOAPClient('https://example.com/?WSDL');
?>
... and it allready works, and I was planning to add all kinds of
notifies on stream alterations, disabling verify_peer (allthough the
certificate is valid..), etc. Nothing like that needed, just adding
_some_ context allready did the trick... I'm suitably amazed, any idea
why this is? An overriding of a buggy default context perhaps?
And some further digging, this was all that's needed:
<?php
ini_set('soap.wsdl_cache_enabled',0);
$client = new SOAPClient('https://example.com?WSDL',
array('stream_context'=stream_context_create()));
?>
Call me amazed. Ah well, the last server works too now...

I think it may be a bug. I pasted your error in Google and found these
two bug reports:

<URL:http://bugs.php.net/bug.php?id=34657>
Well, yes, it is the error, but not related: that's about it issuing a
Fatal Error rather then a catchable Exception on a fail. (An issue still
current when someone has XDebug installed however, I think XDebug needs to
fix that, I assume it's not SOAP's fault). The reason for the error there
is not the problem, the ability to catch it is.
<URL:http://bugs.php.net/bug.php?id=38703>
Is sort of about the same thing.
I'm not sure if this will shed light on your particular case, but hope
it helps.
Unfortunately, no, the issuing of the error is not of importance to me,
the reason for it is, and the reason why an empty context fixes it. If
only an empty context didn't fix it, I could easily trace the SoapClient
constructor beneath the surface... For now, it would be stepping throughC
code, not something I am about to do :) But thank you for thinking along,
much appreciated.

As it seems not to depend on a PHP version / OS / Soap settings, I suspect
it would either be a result of unknown settings (which I can't figure
out), or a rather unique combination of PHP version / OS / libraries. Not
reportable as a bug as of yet, just a big mystery.

Ah, well, what am I whining about, the issue is fixed, but I hate fixes I
don't understand :)
--
Rik Wasmus
....spamrun finished
Jun 27 '08 #3
Rik Wasmus wrote:
On Wed, 04 Jun 2008 22:28:40 +0200, Curtis <ze******@verizon.netwrote:
>Rik Wasmus wrote:
>>I had some problems on 1 particular server (up to 3 others with the
same PHP&SOAP version work, 1 of which with the same OS) with
constructing a SOAP client:
FAIL:
<?php
ini_set('soap.wsdl_cache_enabled',0);
$client = new SOAPClient('https://example.com/?WSDL');
?>
Error:
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing
WSDL: Couldn't load from 'https://....
SUCCESS:
<?php
ini_set('soap.wsdl_cache_enabled',0);
$ctx = stream_context_create();
libxml_set_streams_context($ctx);
$client = new SOAPClient('https://example.com/?WSDL');
?>
... and it allready works, and I was planning to add all kinds of
notifies on stream alterations, disabling verify_peer (allthough the
certificate is valid..), etc. Nothing like that needed, just adding
_some_ context allready did the trick... I'm suitably amazed, any
idea why this is? An overriding of a buggy default context perhaps?
And some further digging, this was all that's needed:
<?php
ini_set('soap.wsdl_cache_enabled',0);
$client = new SOAPClient('https://example.com?WSDL',
array('stream_context'=stream_context_create()));
?>
Call me amazed. Ah well, the last server works too now...

I think it may be a bug. I pasted your error in Google and found these
two bug reports:

<URL:http://bugs.php.net/bug.php?id=34657>

Well, yes, it is the error, but not related: that's about it issuing a
Fatal Error rather then a catchable Exception on a fail. (An issue still
current when someone has XDebug installed however, I think XDebug needs
to fix that, I assume it's not SOAP's fault). The reason for the error
there is not the problem, the ability to catch it is.
><URL:http://bugs.php.net/bug.php?id=38703>

Is sort of about the same thing.
Ah, ok. I wasn't too sure if it was directly pertinent.
>I'm not sure if this will shed light on your particular case, but hope
it helps.

Unfortunately, no, the issuing of the error is not of importance to me,
the reason for it is, and the reason why an empty context fixes it. If
only an empty context didn't fix it, I could easily trace the SoapClient
constructor beneath the surface... For now, it would be stepping through
C code, not something I am about to do :) But thank you for thinking
along, much appreciated.
Thanks for putting this out there, you might save plenty of others
some trouble with your workaround.
As it seems not to depend on a PHP version / OS / Soap settings, I
suspect it would either be a result of unknown settings (which I can't
figure out), or a rather unique combination of PHP version / OS /
libraries. Not reportable as a bug as of yet, just a big mystery.
If you think it might be relevant as a user note on PHP's docs, maybe
post one there (if you haven't already).
Ah, well, what am I whining about, the issue is fixed, but I hate fixes
I don't understand :)
Lol. If it's any consolation, I feel the same way. :P

--
Curtis
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ken Fine | last post by:
I'm looking for a 30,000 foot view on this quesition. I want my SQL Server box/IIS server to be able to demand information at will from a remote server running UNIX. I need the information to be...
8
by: xmail123 | last post by:
Hi, As was pointed out whatever you return from a WebMethod needs to be serializable to SOAP. An ArrayList is not serializable. I will be needing to return other data types from web methods. ...
1
by: Dr. Frankenchurn | last post by:
I have a question regarding SOAP. A basic "Hello World" web service was written then requested from an IIS server via TELNET. When a malformed request was sent, a SOAP exception was returned,...
0
by: Cleo | last post by:
Hi, I am trying to call a WebService Method written in Weblogic from VB.NET and I am getting the following error. I am using SOAP Caal s from VB.NET. Please find the wsdl file and my code. ...
0
by: Nalla | last post by:
Hi, I have a requirement to call webservices from my old C++ application.So first I tried with Vc++.net as follows.....There are 2 approach Dotnet frame work and soaptoolkit 3.0 I am not able to...
6
by: john deviney | last post by:
I have a C#/.Net 1.1 client talking to a Java based web service. I need to insert a soap header on the client side which is expected on the server side. Currently, the Java ws provider, Axis, does...
0
by: Amar | last post by:
I am recieving the "The root element is missing" error from my soap extension while attempting to validate an incoming SOAP message request. I suspect the problem resides in the ChainStream method...
0
by: Matt Wood | last post by:
Hi, I have written a Web Service for a customer which expects a SOAP message with Document/Literal encoding, and uses RoutingStyle=SoapServiceRoutingStyle.RequestElement to route the SOAP body...
1
by: Stu | last post by:
Hi, Im using vis studio 2003 and I think wse is out of the question as clients could be using java which doesnt support it. So I managed to find some code which allows you to develop a custom...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.