Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 337831

Summary: SIE not adequate with WSDL/schema missing TNS
Product: z_Archived Reporter: Stanislav Nichev <stanislav.nichev>
Component: WTP IncubatorAssignee: Dimitar Tenev <dimitar.tenev>
Status: NEW --- QA Contact: Dimitar Tenev <dimitar.tenev>
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
attaching bugzilla docs none

Description Stanislav Nichev CLA 2011-02-22 09:10:22 EST
Build Identifier: 

Hi Colleagues,                                                           
                                                                         
The attached WSDL has WS-I warnings (WSDL, and its schema are missing    
TNS), but is valid.                                                      
                                                                         
Consequences:                                                            
SIE Commands does not act adequate - try them.                           
Undo throws exceptions (see the attached stacktrace.txt)                 
SIE does not show operation's parameters.                                
                                                                         
Best regards,                                                            
Dimitar                                                                  
                                                                         
    Memo                                                                 
    11.05.2010 15:57:05      Dimitar Donchev                             
Hi,                                                                      
                                                                         
I have done a little bit of research, for that corner case in the wsdl   
spec - when no targetnamespace is specified or it is an ""(empty string) 
Unfortunately, I have not found concrete guidelines how references       
should be supported or not in this case. For shure nor the validation,   
emerges with an error, nor the refferences are shown.                    
                                                                         
However this corner case has revealed yet another misbehaviour- when     
adding a parameter, the newly created element is placed unpredictably in 
a new schema or in an old one, thus the document gets polluted with      
empty namespace(schemas) or with redundant such.                         
                                                                         
I'll be working on this and mentioned above issues.                      
                                                                         
Regards,                                                                 
Dido.                

    Memo                                                                 
    21.05.2010 13:00:36      Dimitar Donchev                             
Helo again,                                                              
                                                                         
    A lot of changes have been made conserning this issue. As a result,  
the behaviour of the editor with this document should include:           
   - Commands act adequate.                                              
                                                                         
   - No Exceptions thrown on undo/redo                                   
                                                                         
   - It is normal for the SIE NOT TO SHOW the parameters, just as the    
wst editor doesn't by the way.                                           
                                                                         
Fixes for bugs related to the issues mentioned above. (they should be    
validated too).                                                          
                                                                         
 - Try to add a parameter to an operation in this doc.                   
The default xmlns prefix should be fixed to a default value, thus making 
the EMF model able to resolve references. Therefore all the broken refs  
in the model should be fixed and not only the new parameter, but maybe   
other should be shown.                                                   
(A bugzila is to be written to Eclispe for the lack of validation for    
those refs!)                                                             
Undo on this operation should work, removing the added xmlns namespace   
AND unfortunately breaking all the references in the EMF model (setting  
them to their original state actually).                                  
                                                                         
 - Try to import a type(via te browse types dialog), from a schema with  
NO targetNamespace. The outcome should be an error message, with         
explaination.                                                            
                                                                         
Code Review : Dinko Ivanov & Dimitar Tenev                               
Tests - 3 new tests in the changeList & most of the fixed ones.          
                                                                         
Regards,                                                                 
Dido                                                                     
                                                                         
    Memo                                                                 
    25.05.2010 11:26:20      Dimitar Donchev                             
In Eclipse bugzila : Similar issue (null tns definitions element):       
https://bugs.eclipse.org/bugs/show_bug.cgi?id=212508                     
                                                                         
I have created an eclipse bugzila for the issue with the missing message 
 refs : https://bugs.eclipse.org/bugs/show_bug.cgi?id=314235             
                                                                         
    Reply                                                                
    29.05.2010 14:26:33      Georgi Konstantinov                         
When you choose type from schema file which has no targetNamespace       
the attached dialog is shown. In my opinion message must be improved.    
                                                    

    Memo                                                                    
    31.05.2010 11:13:43      Dimitar Donchev                                
Hi,                                                                         
                                                                            
References to types and elements without targetNamespace (no                
targetNamespace attribute defined in their schema) are quite complex.       
I will list several cases here, which along with the one mentioned          
above should be cleared and then the behaviour of the editors should be     
determined and implemented.                                                 
                                                                            
                                                                            
                                                                            
If it is possible to refer:                                                 
                                                                            
  WSDL Document :                                                           
                                                                            
  - types from an other *.xsd document with schema with NO TNS.             
(If the wsdl is WSI-Complient the import should look like :                 
    <schema>                                                                
      <import schemaLocation="...."/>                                       
    </schema>                                                               
but since the importing and imported schemas have the same TNS(none) -      
the use of import is invalid.                                               
Therefore such usecase should probably be dsiabled!                         
                                                                            
  - types from another <schema>, with no TNS , in the same document.        
                                                                            
    - in a wsdl document with two <schema> elements both without a TNS,     
both containing elements/types with the matching names. Is it possible      
for theese types to be reffered, and if so - which type will be the         
reffered, when the names and namespaces of two types match.                 
                                                                            
  XSD Document:                                                             
                                                                            
    - in a <schema> with no TNS, references betweens the types in the       
same doc (should be possible ;) ) .                                         
                                                                            
    - types fom an other .xsd containing a <schema> with no TNS.            
                                                                            
    - The same as above, but the importing schema allso to be with no       
TNS.                                                                        
                                                                            
Another case should be defined too: when in the wsdl document contains      
two schemas with same target namespaces and same types. Is the wsdl         
valid, and if so which of the two types should be reffered?                 
                                                                            
The current behaviour of the editors regarding importing such schemas       
and setting such types is inconistent. Sometimes it succeeds, sometimes     
different error messages emerge. This variety is because the code           
executig the cases above is distributed in a few commands.                  
                                                                            
The fix should sync all the commands above, to show similar messages,       
when operation is impossible too.                                           
                                                                            
Regards,                                                                    
Dido                                                                        


Reproducible: Always
Comment 1 Stanislav Nichev CLA 2011-02-22 09:11:48 EST
Created attachment 189488 [details]
attaching bugzilla docs