Bug 241275 - No Validation error generating Web Service client if dialog hidden
Summary: No Validation error generating Web Service client if dialog hidden
Status: CLOSED FIXED
Alias: None
Product: WTP Webservices
Classification: WebTools
Component: wst.ws (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 3.0.1   Edit
Assignee: Eric Peters CLA
QA Contact: Kathy Chan CLA
URL:
Whiteboard: PMC_approved
Keywords: contributed
: 241965 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-07-17 11:42 EDT by Eric Peters CLA
Modified: 2008-10-29 14:47 EDT (History)
3 users (show)

See Also:
david_williams: pmc_approved+
kathy: pmc_approved? (raghunathan.srinivasan)
kathy: pmc_approved? (naci.dai)
kathy: pmc_approved? (deboer)
kathy: pmc_approved? (neil.hauge)
kathy: pmc_approved? (kaloyan)


Attachments
Patch for validation part of this defect. (7.53 KB, text/plain)
2008-07-24 16:46 EDT, Peter Moogk CLA
no flags Details
patch (21.55 KB, patch)
2008-07-29 11:09 EDT, Eric Peters CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Peters CLA 2008-07-17 11:42:35 EDT
Build ID: R-3.0-20080616152118

Steps To Reproduce:
1. Create a Dynamic Web Project (new workspace) with an e.g. Echo Java Bean, targeting e.g. Tomcat 55, and server targets e.g. JRE 1.5
2. Create a web service from the bean
3. Now change the Java Version of the facet to 6.0 (need to deselect the targeted runtime for first in order to increase version)
4. Creating client in the same project results in validation error on first page of wizard: "The Tomcat 5.5 server does not support the Client project"
5. Now Hide All Popup Dialogs for WS's (Preferences > Web Services > Pop up Dialog Selection)
6. Now again create the client, it is created without error into the dynamic web project but cannot run/deploy as the class files are compiled with JRE 6.0 yet server only has JRE 1.5.


More information:
Comment 1 Kathy Chan CLA 2008-07-17 12:00:35 EDT
Eric,

I suspect this is a problem since WTP 1.5.  I think all validation is bypassed, not just this check.  Could you please verify?  Thanks!

Tentatively targetting WTP 3.1 for now.
Comment 2 Eric Peters CLA 2008-07-17 13:51:02 EDT
Assume all the validation is turned off, creating a web service client from bad wsdl gives exception dialog instead of nice validation error when the wizard is used:

IWAB0399E Error in generating Java from WSDL:  org.xml.sax.SAXException: Fatal Error: URI=file:/D:/WTP/R-3.0-20080616152118/runtime-New_configuration_0717_2/WP/WebContent/wsdl/Echo.wsdl Line=6: Attribute name "elemen" associated with an element type "schema" must be followed by the ' = ' character.
Comment 3 Kathy Chan CLA 2008-07-18 18:00:19 EDT
Eric, please look into what it takes to fix this and see if it could be contained in WTP 3.0.1.  Supporting creation of bottom-up Web service from Java bean in Java project does open up the situation of the user getting a validation error in the banner when going to the first page.  In the other cases, typically the user would only get an error after they've made some changes on the page.
Comment 4 Eric Peters CLA 2008-07-24 08:08:59 EDT
While working on fix I see that assumptions and statements in previous notes are incorrect: there IS validation taking place when the wizard does not appear, just not for the 2 cases in the defect.

Comment 5 Peter Moogk CLA 2008-07-24 16:46:07 EDT
Created attachment 108395 [details]
Patch for validation part of this defect.
Comment 6 Eric Peters CLA 2008-07-29 07:12:58 EDT
*** Bug 241965 has been marked as a duplicate of this bug. ***
Comment 7 Eric Peters CLA 2008-07-29 07:14:18 EDT
This fix will also address Bug 241965- Exception in Web Service wizard if no server runtimes defined
Comment 8 Eric Peters CLA 2008-07-29 08:22:25 EDT
Also changes validation error message for BUJ from Bean in Java project for ANT & hidden wizard, when service type requires a runtime & no server runtimes exist & the service project does not exist...

WAS:
No suitable server can be found for the Apache Axis Web service runtime. Go to Window > Preferences. Select Server > Runtime Environments and configure a server runtime.
Should be (to match error in WS wizard):
No server can be found and WebServiceProject does not exist. Choose an existing project or use the preferences to configure a server runtime.
Comment 9 Eric Peters CLA 2008-07-29 11:09:15 EDT
Created attachment 108660 [details]
patch

obsoletes previous patch
Comment 10 Eric Peters CLA 2008-07-29 11:43:40 EDT
If this problem is not fixed:
1. A bottom-up Java Bean web service created from a bean existing in a Java project can be created but will not work at runtime (due to class version error/exception)
2. A Web Service client created in a Java Project cannot be deployed/started as the Java Project facet versions are not supported by the targeted server
3. A Web Service created from a wsdl with validation errors will results in an ugly exception dialog & stack-trace (or console error if created using ANT), instead of a nice dialog indicating the WSDL is invalid
4. If there are no server runtimes defined (which is the default in WTP), then creating a web service or web service client will result in exceptions dialog/message and the ws or ws client cannot be created.
5. There will be misleading error messages indicating when creating web services or web service clients indicating that a server needs to exist for this task, when in fact the requirement is that one or both of the following need to exist: the project, the server.

The fixes code involved for the problem above is either trivial, or re-uses pre-existing code for the most part- there is not much new here. The fixes have been unit-tested thoroughly as per the unit-test notes below.

Unit testing for validation of projects & exceptions realted to no server defined included:

BUJava in Java Project

 Service Project exists

  Java Project Facets matches
   WS wizard
    no server rts defined
    stubs only rts defined
   ANT
    little testing- opened 242312
   Hide WS wizard
    rt defined, server not created
    no server rts defined

  Java Project Facets do not match 
   WS wizard
    server exists
    no server rts defined
    stubs only rts defined
    rt defined, server not created
   ANT
    little testing- opened 242312
   Hide WS wizard
    rt defined, server not created
 
 Service Project does not exist

  Java Project Facets matches
   WS wizard
    no server rts defined
    stubs only rts defined
    rt defined, server not created
   ANT
    little testing- opened 242312
   Hide WS wizard
    rt defined, server not created
    no server rts defined
    stubs only rts defined

  Java Project Facets do not match 
   WS wizard
    server exists
   ANT
    little testing- opened 242312
   Hide WS wizard
    stubs only rts defined

WS Client in Java Project

 Java Project exists

  Java Project Facets matches
   WS wizard
    no server rts defined
    stubs only rts defined
    rt defined, server not created
   ANT
    stubs only rts defined
   Hide WS wizard
    rt defined, server not created
    stubs only rts defined
    no server rts defined

  Java Project Facets do not match 
   WS wizard
    stubs only rts defined
    rt defined, server not created
   ANT
    stubs only rts defined
   Hide WS wizard
    stubs only rts defined
    rt defined, server not created
 
 Java Project does not exist

  Java Project Facets matches
   WS wizard
    no server rts defined
    server exists
    rt defined, server not created
   ANT
    no server rts defined
    server exists
    stubs only rts defined
   Hide WS wizard
    rt defined, server not created
    no server rts defined
    stubs only rts defined
  


    
Comment 11 Kathy Chan CLA 2008-07-29 13:10:50 EDT
Comment on attachment 108395 [details]
Patch for validation part of this defect.

Eric's patch includes the patch from Peter.
Comment 12 Kathy Chan CLA 2008-07-29 14:27:23 EDT
Patch reviewed.  Requesting PMC approval for WTP 3.0.1.
Comment 13 David Williams CLA 2008-07-30 01:17:18 EDT
Sounds a bit like a corner case, or several corner cases, but imagine it's the least experienced users that would hit these issues, so should increase usability. 

thanks. 
Comment 14 Peter Moogk CLA 2008-07-30 15:03:29 EDT
The changes for this defect have been committed and released to the HEAD and V301 stream under v200807301838.
Comment 15 Kathy Chan CLA 2008-10-27 14:17:31 EDT
This defect has been in resolve state for a while.  Please verify this with the appropriate WTP driver which can be found in:

http://download.eclipse.org/webtools/downloads/

We would verify and close the defect on the originator's behalf if it has not been verified 2 weeks after it's been changed to Verified state.
Comment 16 Eric Peters CLA 2008-10-29 14:47:21 EDT
verified in M-3.0.3-20080925125100