Community
Participate
Working Groups
Currently, the Browse button for "Have a services.xml" in the bottom-up Axis2 page browse into the workspace. The normal paradigm for operations within Eclipse is to browse into the workspace only.
Created attachment 72369 [details] Fix for the Bug 193371 Hi Kathy , I have fixed the issue using the FileFolderSelectionDialog pointing it to the workspace location with the help of the EFS. I tried to use the FileSelectionDialog and found that it was deprecated. I have tested this fix. Also I have add some additional verification of the result file that we obtain form the browse so that user will immediately get the feedback. Please review and commit. Thanks Lahiru
*** This bug has been marked as a duplicate of bug 184450 ***
Reopening. This defect is not a dup of 184450.
I took a look at the patch. There's a few issues with it: 1. With the way you are getting the IFileStore you are proposing: IFileStore store = EFS.getStore(new URI("file://"+root.getLocation().toOSString())); you are only getting projects that's directly under the workapace root. So linked projects (projects not in the default location) are not included. 2. The current patch resulted in the following exception when running on Windows: java.net.URISyntaxException: Illegal character in authority at index 7: file://D:\eclipse33\eclipse\runtime-WTP201_0907a at java.net.URI$Parser.fail(URI.java:2816) at java.net.URI$Parser.parseAuthority(URI.java:3154) at java.net.URI$Parser.parseHierarchical(URI.java:3065) at java.net.URI$Parser.parse(URI.java:3021) at java.net.URI.<init>(URI.java:578) at org.eclipse.jst.ws.internal.axis2.creation.ui.widgets.bean.ServicesXMLSelectBeanWidget.handleBrowse(ServicesXMLSelectBeanWidget.java:236) at org.eclipse.jst.ws.internal.axis2.creation.ui.widgets.bean.ServicesXMLSelectBeanWidget.access$6(ServicesXMLSelectBeanWidget.java:230) at org.eclipse.jst.ws.internal.axis2.creation.ui.widgets.bean.ServicesXMLSelectBeanWidget$3.widgetSelected(ServicesXMLSelectBeanWidget.java:148) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227) 3. Exceptions are not returned to the user. So when the user click the Browse button, unless the user has the console log on, they just get no response and is stuck on the same page. Please refer to WSDLSelctionWidget.handleWSDLButton() for an example of how to browse for a particular type of file in the workspace. Retargetting to WTP 2.0.2 since we are running out of time for WTP 2.0.1 and this defect is not high in severity.
The current patch does not work. Please revise and resubmit.
Deferring to WTP 3.0.1.
Created attachment 102583 [details] fix to browse the services.xml only in the workspace hi kathy, I'm herewith resubmitting the patch sent by lahiru sandakith with the necessary changes to work with the current source and with the your suggestion of using the DialogResourceBrowser dialog. But i had the problem of how to define the resource to it such that even the imported projects or loaded projects which are not in the workspace are shown in the dialog. current patch will only show the projects in the workspace. any suggestions how to overcome the problem?
Hi Saminda, The patch you provided already takes care of finding files in linked project (projects showing up in the workspace views but the physical location is not in the workspace). I've tried it and it works fine. You might want to reconsider the logic of only allowing files which ends with "services.xml". Do you really need that? Could user have the services.xml stored in a file with other name? If you really want to restrict the file to only be called "services.xml", your current logic would allow for a file named "newservices.xml". Also, how about files with different cases? Once you've revisited the logic for giving the error message, you can have Lahiru commit that to the R3_0_maintenance branch. Also, once the patch is ready to be review and committed, please "Accept" the bug to change it to assign state.
Created attachment 103269 [details] fix for bug 193371 I'm attaching the patch with the requested changes for accepting services.xml file having different names. the patch will also contain services.xml validation functions which is used to determine whether the selected xml file is valid.
Comment on attachment 72369 [details] Fix for the Bug 193371 Marking old patch as obsolete.
Hi Saminda, With the latest patch you are proposing, you are calling servicesXMLUtils.isValidateServicesXML() in ServicesXMLSelectBeanWidget.getStatus() even when the user do not specify their own services.xml. Also, I tried to provide a valid services.xml and the validator still returns false. What scenarios have you tested the patch with? Please take a look at what could be causing the problem. Another point is do you intent to have ServiesXMLUtils be a stateful object or just a collection of utilities that various commands can call. If it is the latter, then the isValidateServicesXML method should be a static method that takes in the path to the services.xml.
Hi kathy, Can u attach the services xml file u used to test? Also i forgot to mention in the patch comment. I used the services xml file created by the axis2 plugin in another web service to test this functionality. It didn't work at first, when i tried to find why it didn't work i saw that the services.xml i gave had a "Description" tag which was not defined in the services schema. the schema only defines the "description" tag. (may be this is a bug. i'll check).after making the tag to lower case the xml was validated successfully (sorry again that i forgot to mention this). (Other tags in the services xml was according to the schema). May be this was the problem in your case also. You are right, i think i'll move this validation to the place where user selects the the file and clicks ok. it will validate the file. if it is invalid throw a message saying that the file is not valid and show the dialog again. yeah it is most probably the latter case. i.e. just a collection of utilities that various commands can call. I was not sure whether there would arise an occasion which would want to process the services xml and retain the data to be passed on to other operations. but hwever my intension for using it is only as a collection of utilities. I'll check with sandakith and make it static if neccessary.
Created attachment 103491 [details] fix for bug 193371 in this patch I've fixed the problem of where the validation is done and making the validation function static. validation will only occur when user browses a services file.
Created attachment 103820 [details] services.xml I tried attachment 103491 [details] and still have problem. Now it does not complain when I just leave it to "generate a default services.xml". So I go through a bottom up Axis2 scenario with converter.java from the tutorial and got a services.xml file generated. Then when I go through the scenario a second time browsing for that same services.xml file, I got the error: You must select a valid services.xml file. I did not even change the services.xml file. Here's the services.xml file that's generated by Axis2. The testing I did before is I filled in the Description tag with some input from an existing services.xml. Please try the scenario again.
Created attachment 103888 [details] working services.xml file Hi, I tried the attached file. yes, it does not work. it is because of the "Description" tag. as i mentioned in the earlier comment, i changed the "Description" tag to "description" (only made the Capital letter "D" to a simple letter "d"). now it works fine. the problem is not in the patch, it is in the services.xml generation process. the patch fails to identify the xml correctly because of the case sensitivity of the contents in the file services.xml. so i'm currently looking in to the services.xml generation process also to fix that. (i tried to find a schema validation which does not consider case-sensitivity, but couldn't find a way) Sorry for the late reply.
Created attachment 103931 [details] fix for bug 193371 Hi Kathy, Sandakith suggested a better idea. Instead of changing the ServiceXml creation process i'm changing the schema to accept the "Description" tag also. I checked it will the file u sent and it work. Check this patch with yo original services file and let me know the result. Saminda
assigning the issue to samindaw..
I have reviewed and committed the latest patch to the cvs. Saminda, do you have any other improvements to this. If not, we can verify and close this issue.
I tried to reproduce the issues 2 and 3 (which was mentioned after the 1st patch is put). The 2nd issue may not be applicable since the code which throws the exception is no longer in the patch. The 3rd issue i'm not sure how can occur with the current patch since by clicking on browse the swt control takes over until selection of the file and there is no try catch statements used to halt any exceptions thrown after the file selection. So i need the exact scenario of hw to reproduce this if it is not relevant to the 1st patch. Other than that i think this issue is resolved.
Yes. I was able to verify that the problem is fixed with attachment 103931 [details]. Thaks for the patch!
Great .. I verified it too with the latest code base. Thanks Lahiru Sandakith.
Closing.