Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 179072 - [validation] WSDL Validator returns error when importing only namespace
Summary: [validation] WSDL Validator returns error when importing only namespace
Status: CLOSED FIXED
Alias: None
Product: WTP Webservices
Classification: WebTools
Component: wst.wsdl (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Valentin Baciu CLA
QA Contact: Valentin Baciu CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-23 12:52 EDT by Kevin Quan CLA
Modified: 2009-06-11 14:33 EDT (History)
2 users (show)

See Also:


Attachments
Patch and unit test (6.22 KB, patch)
2009-02-27 10:45 EST, Valentin Baciu CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Quan CLA 2007-03-23 12:52:33 EDT
In the Eclipse WSDL validator from the RAD7 base, an import without a schemaLocation attribute returns an error.  For example:

    <xsd:schema targetNamespace="http://tempuri.org/DocLiteral/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<xsd:import namespace="http://ThisResultsInAnError.com/"/>
    </xsd:schema>

returns the error:

schema_reference.4: Failed to read schema document 'null', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>., Line: 2, Column: 58

This error can be removed by specifying a schemaLocation attribute in the import element:

<xsd:import namespace="http://ThisResultsInAnError.com/" schemaLocation="test.xsd"/>

However, the schemaLocation attribute should be optional as described in the spec: http://www.w3.org/TR/xmlschema-1/#composition-schemaImport
Comment 1 Valentin Baciu CLA 2008-12-11 17:02:31 EST
For some reason all validation problems reported by the inline schema validator - errors or warnings - are turned into WSDL validation errors. In this case Xerces reports only a warning but it's being turned into an error by the WSDL validator.

I'll try to figure out why this was done.
Comment 2 Lawrence Mandel CLA 2008-12-11 20:34:42 EST
This looks like a bug. Valentin, feel free to ping me or drop by if you want to review any part of the code.
Comment 3 Valentin Baciu CLA 2008-12-11 22:54:47 EST
Thank you Lawrence, will do.
Comment 4 Hristo Sabev CLA 2009-02-20 08:20:55 EST
Hi,

This also gives an error in the follwoing situation:

Type TA is defined inside WSDL WA and inside Namespace NA.

WSDL WB imports wsdl WA. Inside the <types> section of wsdl WB there's an <xsd:import namespace="NA"> statement.

This import is rendered wrong, because it misses location attribute. However it should not be neither error nor warning because there's a wsdl:import statement that imports WA.

Regards,
Hristo
Comment 5 Valentin Baciu CLA 2009-02-27 10:45:21 EST
Created attachment 127009 [details]
Patch and unit test

Surgical fix to take into account the error severity. I've also added a new JUnit.
Comment 6 Valentin Baciu CLA 2009-02-27 11:06:37 EST
Patch and unit test committed and released for WTP 3.1 builds > v200902271605 UTC
Comment 7 Valentin Baciu CLA 2009-06-11 14:33:04 EDT
Closing.