Bug 201346 - WSDL parser complains when more than one schema section has same TNS
Summary: WSDL parser complains when more than one schema section has same TNS
Status: CLOSED DUPLICATE of bug 199615
Alias: None
Product: WTP Webservices
Classification: WebTools
Component: wst.wsdl (show other bugs)
Version: 1.5.4   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 2.0.1 M201   Edit
Assignee: Valentin Baciu CLA
QA Contact: Craig Salter CLA
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2007-08-27 20:07 EDT by Sachin Thatte CLA
Modified: 2007-09-12 10:38 EDT (History)
2 users (show)

See Also:


Attachments
WSDL that reports error. (3.75 KB, text/xml)
2007-08-27 20:07 EDT, Sachin Thatte CLA
no flags Details
Deleted line numbers 36 and 37 from original wsdl. (3.68 KB, text/xml)
2007-08-27 20:09 EDT, Sachin Thatte CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sachin Thatte CLA 2007-08-27 20:07:39 EDT
Created attachment 77082 [details]
WSDL that reports error.

Build ID:  M20070212-1330

Steps To Reproduce:
Legal WSDLs report error such as:

src-resolve: Cannot resolve the name 'dsns0:CUSTOMER_KEY' to a(n) 'element declaration' component.

I will attach WSDL that reports error and wsdl that does not report error.


More information:
From the attached WSDL, delete lines 27, 28 and the error will be gone. Deleted lines merge the two schema sections that have same TNS into a single schema section.
Comment 1 Sachin Thatte CLA 2007-08-27 20:09:29 EDT
Created attachment 77083 [details]
Deleted line numbers 36 and 37 from original wsdl.
Comment 2 Sachin Thatte CLA 2007-09-06 13:58:42 EDT
Any update on this bug? 
Thanks.
Comment 3 Richard Mah CLA 2007-09-06 14:28:39 EDT
To elaborate on the issue further, there are 3 inline schemas A, B and C.  Schemas B and C have the same tns.  Schema A tries to reference an element in Schemba B but validation fails with the error.

Valentin, can you comment from a validation perspective?

A related bug has also been found.  While using the set Element reference dialog to set a Part's Element reference, the appropriate namespace is not added to the WSDL definition.  This occurs when the Element is from an inline schema with a different targetnamespace than the WSDL definition.  The fix for this would be to add the inline schema targetnamespace to the WSDL definition (xmlns:prefix="ld:CUSTOMER") and use the prefix when setting the Part's Element reference.
Comment 4 Craig Salter CLA 2007-09-06 14:40:44 EDT
From my understanding of the Xerces schema model this one will be quite a challenge to fix. Sachin, feel free to donate a patch... we'd love to have more folks contributing to the upkeep of the xml validators. 
Comment 5 Valentin Baciu CLA 2007-09-06 14:45:09 EDT
From the WSDL validation point of view this looks like a duplicate of bug
199615. As I said in there, the WSDL validator has never supported this
scenario.
Comment 6 Valentin Baciu CLA 2007-09-06 14:56:39 EDT
Marking as duplicate of bug 199615. Richard, please open a separate bug for your other finding.

*** This bug has been marked as a duplicate of bug 199615 ***
Comment 7 Valentin Baciu CLA 2007-09-10 15:26:56 EDT
Closing. Please re-open if you do not concur.
Comment 8 Sachin Thatte CLA 2007-09-11 16:09:19 EDT
Richard Mah suggested:

"The fix for this would be to add the inline schema targetnamespace to the WSDL definition (xmlns:prefix="ld:CUSTOMER") and use the prefix when setting the Part's Element reference."


Richard,
Can you clarify what change to the wsdl would make this problem go away? If you can attach a modified wsdl that does not show the error in WTP, it would help me possibly workaround the issue.

Thanks.
Comment 9 Richard Mah CLA 2007-09-12 10:38:18 EDT
Please see https://bugs.eclipse.org/bugs/show_bug.cgi?id=202516 for an example of the problem and the solution.  Thanks Sachin.