Bug #73043 [Com]: WSDL: import schema if WSDL uri does NOT end with a slash

From: Date: Tue, 20 Sep 2016 13:40:00 +0000
Subject: Bug #73043 [Com]: WSDL: import schema if WSDL uri does NOT end with a slash
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204153@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73043&edit=1 ID: 73043 Comment by: dzuelke at gmail dot come Reported by: filip dot rydlo at gmail dot com Summary: WSDL: import schema if WSDL uri does NOT end with a slash Status: Not a bug Type: Bug Package: SOAP related Operating System: Debian 8.5 Jessie x64 PHP Version: 5.6.26RC1 Block user comment: N Private report: N New Comment: The WSDL is located at the URL https://pg.eet.cz/eet/services/EETServiceSOAP/v3?wsdl`. It references an XML Schema file at EETXMLSchema.xsd, which is a relative location, so it's looked for relative to the containing document, at https://pg.eet.cz/eet/services/EETServiceSOAP/EETXMLSchema.xsd`. The correct location is https://pg.eet.cz/eet/services/EETServiceSOAP/v3/EETXMLSchema.xsd`, but that's not PHP's problem. You should contact the owner of the service and ask them to fix the issue. Not only PHP, but all other clients that adhere to the spec will be unable to load this file, so it's in their interest to get it resolved. Failing that, you can 1. use an XML catalog entry on your local system to re-define where EETXMLSchema.xsd is located; 2. load the WSDL file from the origin URL, cache it locally, and rewrite the schemaLocation to contain a full relative path (/eet/services/EETServiceSOAP/v3/EETXMLSchema.xsd) or even an absolute URL. Then load that local WSDL. You really want to do option 2 in production anyway, because otherwise, your SoapClient instantiation will fetch the remote WSDL file on each instantiation, which slows down your app, and may break things even if you don't make a SOAP call if the endpoint is down. Previous Comments: ------------------------------------------------------------------------ [2016-09-09 18:35:52] filip dot rydlo at gmail dot com This was a nightmare! OK. The local alternative (workaround) works fine. Thanx again! But if they ever change the WSDL... well, then it will be REAL fuuuuuuuun! :-))) ------------------------------------------------------------------------ [2016-09-09 15:48:30] filip dot rydlo at gmail dot com Thank You, Requinix! I will try that. Of course with the $options= array(... , 'location' => 'https://pg.eet.cz/eet/services/EETServiceSOAP/v3/'); //trailing slash ------------------------------------------------------------------------ [2016-09-09 14:26:24] requinix@php.net The original URL has never worked for me, so I don't know. An alternative is to download and use the WSDLs locally. Any relative schemaLocation should continue to work without adjustment. ------------------------------------------------------------------------ [2016-09-09 14:22:36] filip dot rydlo at gmail dot com Unfortunatelly: Yes, I am. I have common sense. So, sadly, this simple fix was, of course, the *first* thing I have tried! Try the fixed link in a web browser for yourself. The original link does. It does NOT work as of today: 2016-09-09T16:20:00+0200 : https://pg.eet.cz/eet/services/EETServiceSOAP/v3/?wsdl ------------------------------------------------------------------------ [2016-09-09 14:06:59] requinix@php.net >> however PHP is behaving correctly. >Are You *absolutely* sure about all this? As I said, I welcome any evidence or documentation or such indicating the opposite, but I'm quite sure I'm right. Are *you* sure that you have the correct WSDL URL? Try using /v3/?wsdl in your code instead - I bet it will work. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=73043 -- Edit this bug report at https://bugs.php.net/bug.php?id=73043&edit=1

« previous php.bugs (#204153) next »