[jira] Created: (WSFPHP-401) WSClient::getProxy() crashes with a fatal error if the service is not available

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (WSFPHP-401) WSClient::getProxy() crashes with a fatal error if the service is not available

JIRA jira@wso2.org
WSClient::getProxy() crashes with a fatal error if the service is not available
-------------------------------------------------------------------------------

                 Key: WSFPHP-401
                 URL: https://wso2.org/jira/browse/WSFPHP-401
             Project: WSO2 WSF/PHP
          Issue Type: Bug
          Components: WSClient
    Affects Versions: 2.0.0
            Reporter: Lucas S. Bickel
         Attachments: wso2-wsf-php-src-2.0.0-wsf_wsdl.php-receiver_fault_on_upstream_unavailable.patch

If a WSDL file returns a 403 HTTP return value the following errors gets raised:

<pre>
PHP Warning:  file_get_contents(http://localhost:8080/SearchService?wsdl) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
 in wsf_wsdl.php on line 176
PHP Warning:  DOMDocument::loadXML() [<a href='function.DOMDocument-loadXML'>function.DOMDocument-loadXML</a>]: Empty string supplied as input in wsf_wsdl.php on line 236
PHP Fatal error:  WSClient::getProxy() [<a href='function.WSClient-getProxy'>function.WSClient-getProxy</a>]: Error occurred in script: WSDL http://localhost:8080/ams.basis06.com/addresses/services/SearchService?wsdl could not be loaded. in /nexbyte/webstamp/program/include/address_service.inc on line 325
</pre>

The last fatal error then kills the php interpreter. I believe that this should return a WSFault("Receiver") Exception that i may then handle in my code. This also seems to be the problem described in http://wso2.org/forum/thread/5279

As a fix i propose checking the results from the file_get_contents call in wsf_get_wsdl_str_from_url. This way the last warning can be replaced with a WSFault (we could even do schema validation on the wsdl at that stage!).

Im adding a patch to this issue that fixes the problem by checking that the returned wsdl is not empty().

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://wso2.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

_______________________________________________
Wsf-c-dev mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-c-dev
Reply | Threaded
Open this post in threaded view
|

[jira] Assigned: (WSFPHP-401) WSClient::getProxy() crashes with a fatal error if the service is not available

JIRA jira@wso2.org

     [ https://wso2.org/jira/browse/WSFPHP-401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nandika Jayawardana reassigned WSFPHP-401:
------------------------------------------

    Assignee: Nandika Jayawardana

> WSClient::getProxy() crashes with a fatal error if the service is not available
> -------------------------------------------------------------------------------
>
>                 Key: WSFPHP-401
>                 URL: https://wso2.org/jira/browse/WSFPHP-401
>             Project: WSO2 WSF/PHP
>          Issue Type: Bug
>          Components: WSClient
>    Affects Versions: 2.0.0
>            Reporter: Lucas S. Bickel
>            Assignee: Nandika Jayawardana
>         Attachments: wso2-wsf-php-src-2.0.0-wsf_wsdl.php-receiver_fault_on_upstream_unavailable.patch
>
>
> If a WSDL file returns a 403 HTTP return value the following errors gets raised:
> <pre>
> PHP Warning:  file_get_contents(http://localhost:8080/SearchService?wsdl) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
>  in wsf_wsdl.php on line 176
> PHP Warning:  DOMDocument::loadXML() [<a href='function.DOMDocument-loadXML'>function.DOMDocument-loadXML</a>]: Empty string supplied as input in wsf_wsdl.php on line 236
> PHP Fatal error:  WSClient::getProxy() [<a href='function.WSClient-getProxy'>function.WSClient-getProxy</a>]: Error occurred in script: WSDL http://localhost:8080/ams.basis06.com/addresses/services/SearchService?wsdl could not be loaded. in /nexbyte/webstamp/program/include/address_service.inc on line 325
> </pre>
> The last fatal error then kills the php interpreter. I believe that this should return a WSFault("Receiver") Exception that i may then handle in my code. This also seems to be the problem described in http://wso2.org/forum/thread/5279
> As a fix i propose checking the results from the file_get_contents call in wsf_get_wsdl_str_from_url. This way the last warning can be replaced with a WSFault (we could even do schema validation on the wsdl at that stage!).
> Im adding a patch to this issue that fixes the problem by checking that the returned wsdl is not empty().

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://wso2.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

_______________________________________________
Wsf-c-dev mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-c-dev
Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (WSFPHP-401) WSClient::getProxy() crashes with a fatal error if the service is not available

JIRA jira@wso2.org
In reply to this post by JIRA jira@wso2.org

     [ https://wso2.org/jira/browse/WSFPHP-401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nandika Jayawardana resolved WSFPHP-401.
----------------------------------------

    Fix Version/s: Current (nightly)
       Resolution: Fixed

Applied the patch. Also corrected the other call to file_get_contents function in the same file. Thanks for the patch.



> WSClient::getProxy() crashes with a fatal error if the service is not available
> -------------------------------------------------------------------------------
>
>                 Key: WSFPHP-401
>                 URL: https://wso2.org/jira/browse/WSFPHP-401
>             Project: WSO2 WSF/PHP
>          Issue Type: Bug
>          Components: WSClient
>    Affects Versions: 2.0.0
>            Reporter: Lucas S. Bickel
>            Assignee: Nandika Jayawardana
>             Fix For: Current (nightly)
>
>         Attachments: wso2-wsf-php-src-2.0.0-wsf_wsdl.php-receiver_fault_on_upstream_unavailable.patch
>
>
> If a WSDL file returns a 403 HTTP return value the following errors gets raised:
> <pre>
> PHP Warning:  file_get_contents(http://localhost:8080/SearchService?wsdl) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
>  in wsf_wsdl.php on line 176
> PHP Warning:  DOMDocument::loadXML() [<a href='function.DOMDocument-loadXML'>function.DOMDocument-loadXML</a>]: Empty string supplied as input in wsf_wsdl.php on line 236
> PHP Fatal error:  WSClient::getProxy() [<a href='function.WSClient-getProxy'>function.WSClient-getProxy</a>]: Error occurred in script: WSDL http://localhost:8080/ams.basis06.com/addresses/services/SearchService?wsdl could not be loaded. in /nexbyte/webstamp/program/include/address_service.inc on line 325
> </pre>
> The last fatal error then kills the php interpreter. I believe that this should return a WSFault("Receiver") Exception that i may then handle in my code. This also seems to be the problem described in http://wso2.org/forum/thread/5279
> As a fix i propose checking the results from the file_get_contents call in wsf_get_wsdl_str_from_url. This way the last warning can be replaced with a WSFault (we could even do schema validation on the wsdl at that stage!).
> Im adding a patch to this issue that fixes the problem by checking that the returned wsdl is not empty().

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://wso2.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

_______________________________________________
Wsf-c-dev mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-c-dev