This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 116987 - wsdl validation fails with schema import without schemaLocation
Summary: wsdl validation fails with schema import without schemaLocation
Status: REOPENED
Alias: None
Product: xml
Classification: Unclassified
Component: Retriever (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker with 2 votes (vote)
Assignee: issues@xml
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-27 22:14 UTC by Shivanand Kini
Modified: 2010-01-29 11:01 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
mail discussion (10.22 KB, application/octet-stream)
2007-10-19 00:22 UTC, Ritesh Adval
Details
same mail discussion in thunderbird format (33.25 KB, application/octet-stream)
2007-10-19 00:22 UTC, Ritesh Adval
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shivanand Kini 2007-09-27 22:14:57 UTC
Steps:
1. Create a bpel module
2. Create a new External WSDL Document from http://geocoder.us/dist/eg/clients/GeoCoderPHP.wsdl
3. Validate the wsdl

Observation:
Errors are reported as follows:

C:/Documents and Settings/skini/My
Documents/NetBeansProjects/BpelModule4/src/geocoder.us/dist/eg/clients/GeoCoderPHP.wsdl:15,15
Error: src-resolve: Cannot resolve the name 'SOAP-ENC:Array' to a(n) 'type definition' component.

The validation should import the soap encoding schema and validate the wsdl against it.
Comment 1 Shivanand Kini 2007-10-01 20:31:18 UTC
XML Retriever retrieves files only if they are defined in schemaLocation.

See getAllLocationOfReferencedEntities(File parsedFile) in
org.netbeans.modules.xml.retriever.impl.DocumentTypeSchemaWsdlParser

For schema files, schemaLocation is optional. The namespace should be used to retrieve the file.

Assigning to retriever module.
Comment 2 Shivanand Kini 2007-10-01 20:36:26 UTC
This was filed on behalf of a mailing list question on nbusers mailing list.
Comment 3 Samaresh Panda 2007-10-02 04:15:47 UTC
Namespace can't possibly be used to find a document. I'm not sure how you would be able to find a document w/o the
location. Sorry, this is not a bug.
Comment 4 Shivanand Kini 2007-10-02 18:24:43 UTC
http://www.w3.org/TR/xmlschema-1/#schema_reference
See #5 in Schema Representation Constraint: Schema Document Location Strategy
Comment 5 Samaresh Panda 2007-10-03 15:25:34 UTC
Fair enough, this is very useful. Let me see if this is possible to fix it in 6.0 or not?
Comment 6 Samaresh Panda 2007-10-03 16:00:52 UTC
On a second look at the wsdl file, there is no schemaLocation in the first place. I added that manually and the
validation works.

- <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"
schemaLocation="http://schemas.xmlsoap.org/soap/encoding/" />
Comment 7 Shivanand Kini 2007-10-03 18:40:22 UTC
i understand that part that there is a work around.
 
But schemaLocation is optional. And I have seen lots of usages of xsd:import with no schemaLocation, but only namespace.
If schemaLocation is not present, then the retriever should try to retrieve the document using the namespace as per the
spec.
Comment 8 Samaresh Panda 2007-10-03 20:26:06 UTC
Please see:
- http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#xsi_schemaLocation
- http://www.w3.org/TR/xmlschema-0/#schemaLocation

The schemaLocation or noNamespaceSchemaLocation attributes are read by the validating processors to find the schemas.
Comment 9 Ritesh Adval 2007-10-19 00:20:28 UTC
We need to use namespace as schemaLocation and at least try to fetch the schema if schemaLocation is missing.
We need to then store it in project catalog.

see attached mail for context:



Comment 10 Ritesh Adval 2007-10-19 00:22:06 UTC
Created attachment 51254 [details]
mail discussion
Comment 11 Ritesh Adval 2007-10-19 00:22:56 UTC
Created attachment 51255 [details]
same mail discussion in thunderbird format
Comment 12 tonybeckham 2007-10-19 04:55:13 UTC
Product Version: NetBeans IDE 6.0 Beta 2 (Build 200710181000)
Java: 1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-87
System: Mac OS X version 10.4.10 running on i386; MacRoman; en_US (nb)

Following the Steps:
1. Create a bpel module
2. Create a new External WSDL Document from http://geocoder.us/dist/eg/clients/GeoCoderPHP.wsdl
3. Validate the wsdl

Output:
XML validation started.
0 Error(s),  0 Warning(s).
XML validation finished
Comment 13 Shivanand Kini 2007-10-19 17:22:22 UTC
tony, try with a later build. see IZ 119402
Comment 14 tonybeckham 2007-10-19 18:33:03 UTC
Still waiting for a new build, Build 200710181000 was the last one...
Comment 15 tonybeckham 2007-10-19 20:01:52 UTC
Product Version: NetBeans IDE 6.0 Beta 2 (Build 200710190908)
Java: 1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-87
System: Mac OS X version 10.4.10 running on i386; MacRoman; en_US (nb)

I am able to reproduce thins in the latest Beta2 build.

XML validation started.
Users/Tony/NetBeansProjects/BpelModule1/src/geocoder.us/dist/eg/clients/GeoCoderPHP.wsdl:15,15
Error: src-resolve: Cannot resolve the name 'SOAP-ENC:Array' to a(n) 'type definition' component.

1 Error(s),  0 Warning(s).
XML validation finished
Comment 16 Samaresh Panda 2007-10-20 01:53:55 UTC
Here is my response to the attached email threads here:
---------
Hi Ritesh,
There is a workaround for this fix. For 6.0, I recommend using the workaround.

Since this is a user requirement, soon after 6.0, I can work on this and get it resolved. I do not recommend making any
changes at this point for 6.0. We do not necessarily have to have a spi to address this issue. If this is indeed a
standard practice, we might as well have it part of our core resolving and fetching algorithm.

Thanks
-- Sam
---------

Tony, try the workaround as well.
Comment 17 tonybeckham 2007-10-22 21:44:38 UTC
Work around works:

Replace:

<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />

with

<import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/" />
Comment 18 tonybeckham 2007-10-22 21:46:11 UTC
Enhancement is a better issue type.