This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 206756 - Adding a web service for PHP SaaS via manager to read from local file does not have correct URL
Summary: Adding a web service for PHP SaaS via manager to read from local file does no...
Status: RESOLVED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: Manager (show other bugs)
Version: 7.0.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Denis Anisimov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-27 22:26 UTC by harrije
Modified: 2012-01-13 21:51 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description harrije 2011-12-27 22:26:35 UTC
To reproduce, use your browser to locate a web service WSDL and save to a local file. For example, use your browser to go to:

    http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL

then in the browser window displaying the oh-so-ugly WSDL, right click and select "save as" to save the WSDL to a file in the location of your choosing.

To see how a bad path for local file is used for the web service in NetBeans manager, go to:

    Services > Web Services

and right click to choose "Add Web Service". When the "Add Web Service" pop up box appears, select "Local File" in lieu of "URL" and click on the Browse button to select the WSDL file previously saved by the browser.

The addition of the web service should complete as expected, but the code snippet resulting from "Drag and Drop" of the newly added web service into a window for editing a PHP file will be wrong.

An example using the previously added weather service, the code snippet will contain:

    $wsdl_url = 'file:/C:/xampp/htdocs/PHP_SandBox/wsdls/Weather.asmx.xml';

Execution of the code snipped will result in:

    SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed to load external entity "file:/C:/xampp/htdocs/PHP_SandBox/wsdls/Weather.asmx.xml"

The problem is the "file:/' prefix which does not match an expected URL to read from a local file because a slash is missing. More specifically, the URL should be:

    $wsdl_url = 'file://C:/xampp/htdocs/PHP_SandBox/wsdls/Weather.asmx.xml';
Comment 1 Denis Anisimov 2012-01-12 10:22:12 UTC
This is common problem not just PHP.
It is a result of saved WS descriptor that contains URL in the form of "file:/uri".
Comment 2 Denis Anisimov 2012-01-12 11:05:23 UTC
There is a difference between Java, PHP and the URL spec.
File.toURI().toURL() gives "file:/path" instead of "file://path".
At the same time Java consider the URL in the form "file://path" as "ftp" protocol
specification. As result method URL.openStream() tries to get content of file via ftp.
So URL "file:/path" work for Java without problem but this  is a problem for PHP.
But URL "file://path" works incorrectly in Java but works for PHP.

So it seems the URL should be corrected only for PHP case in the codegen module.
Comment 3 Denis Anisimov 2012-01-13 08:36:19 UTC
web-main#75e30e76b0a7
Comment 4 Quality Engineering 2012-01-13 21:51:39 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/75e30e76b0a7
User: Denis Anisimov <ads@netbeans.org>
Log: Fix for BZ#206756 - Adding a web service for PHP SaaS via manager to read from local file does not have correct URL