Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 235821 - Misleading error reporting in WSDL validator
Summary: Misleading error reporting in WSDL validator
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 with 2 votes (vote)
Target Milestone: 3.1 M5   Edit
Assignee: Amy Wu CLA
QA Contact: Valentin Baciu CLA
URL:
Whiteboard:
Keywords:
Depends on: 252257
Blocks: 261070
  Show dependency tree
 
Reported: 2008-06-05 09:48 EDT by Den CLA
Modified: 2009-06-11 14:35 EDT (History)
4 users (show)

See Also:


Attachments
sample wsdl (2.07 KB, text/xml)
2008-06-07 04:51 EDT, Den CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Den CLA 2008-06-05 09:48:41 EDT
For the WSDL file the WSDL validator reports that a port
type is not defined, even though it is.

The reason of the validation failure is <xsd:annotation> element inserted into
the portTypes' operations.  

Incorrect:
<wsdl:portType name="test">
    <wsdl:operation name="NewOperation">
    
    		<xsd:annotation>
		</xsd:annotation>
                    
      <wsdl:input message="tns:NewOperationRequest"/>
      <wsdl:output message="tns:NewOperationResponse"/>
    </wsdl:operation>
  </wsdl:portType>

Correct:
<wsdl:portType name="test">
    <wsdl:operation name="NewOperation">

      <wsdl:input message="tns:NewOperationRequest"/>
      <wsdl:output message="tns:NewOperationResponse"/>
    </wsdl:operation>
  </wsdl:portType>

It is desirable to provide a more specific error message pointing to the root
cause of the problem.
Comment 1 Valentin Baciu CLA 2008-06-05 11:05:32 EDT
Can you please attach a small sample WSDL document that demonstrates the problem. Thank you.
Comment 2 Den CLA 2008-06-07 04:51:36 EDT
Created attachment 104081 [details]
sample wsdl
Comment 3 Geoff Ruscoe CLA 2008-07-30 17:47:15 EDT
I would like to get this bumped up in priority, or at least get some action going on this.

These errors occur in all of our wsdls that are generated using JAX-WS from our @WebService classes.

They are easily fixed by adding the xmlns="[the default namesapce]" into the port and the binding, but since they are auto generated, this really is not a fix.

Has anybody been able to look at this yet?

Thanks
Comment 4 Valentin Baciu CLA 2008-07-30 19:16:08 EDT
I took a quick look at the problem. A few things are happening:
- in older WTP versions, the WSDL validator used the original WSDL schema and did a validating XML parsing as the first step in the validation. This old schema would have flagged the xsd:annotation elements as not allowed at that location in the operation element
- in WTP 2.0, as part of the fix for bug 173600 the WSDL schema was updated to  a more recent version which is more flexible and allows extensibility elements (from namespaces other than WSDL) for many more WSDL elements.
- the example WSDL passes the XML validating parsing but when the JWSDL/WSDL4J model is built from the DOM, the code is too strict and does not recognize this extra flexibility.

See the while loop in org.eclipse.wst.wsdl.validation.internal.wsdl11.WSDLDocument.parseOperation(Element, PortType, Definition) and note how it throws an exception when elements other then input, output or fault are detected.

A fix would have to check the element's namespace and not throw the exception if the element if from a namespace other than the WSDL namespace.

A similar fix would have to be made for other parse* methods to ensure the code is aligned with the schema.

I will try to provide a fix for 3.0.1 but 3.0.2 is more likely.
Comment 5 Valentin Baciu CLA 2008-07-30 19:35:33 EDT
The right fix would also attempt to create WSDL extensibility elements from the elements from different namespaces but that will have to wait until bug 197197 is addressed.
Comment 6 Valentin Baciu CLA 2008-07-30 19:47:29 EDT
And further, the WS-I validator will not like this type of WSDL either, because it is using a WSDL reader based on the one in WSDL4J 1.4 which doesn't tolerate extensibility elements for operations.
Comment 7 Valentin Baciu CLA 2008-09-15 16:27:27 EDT
The more I look at this, the more it seems to me the right fix will have to wait until WTP 3.1.
Comment 8 Valentin Baciu CLA 2008-11-06 11:06:16 EST
Amy, please consider this bug fix along with the effort to upgrade the WSDL and WS-I validators to use WSDL4J 1.5.1.
Comment 9 Hristo Sabev CLA 2008-12-04 03:39:27 EST
This problem is quite important for SAP AG too. It causes the validator to show errors on almost each wsdl provided/published by SAP.

Regards,
Hristo

Comment 10 Hristo Sabev CLA 2008-12-04 03:57:49 EST
Forgot to add that the element that the extensibility element that causes most trouble for SAP is the policy element. I.e. putting the element <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">...</Policy> inside the operation leads to the same issue.

Regards,
Hristo

Comment 11 Amy Wu CLA 2008-12-08 11:56:42 EST
I've verified that once the patch for bug 252257 is put in, the scenarios described in this bug will be fixed.
Comment 12 Hristo Sabev CLA 2008-12-09 03:27:00 EST
What are the chances that this gets fixed for 3.0.4?

As explained this is really crucial for us.

Regards,
Hristo

Comment 13 Amy Wu CLA 2008-12-10 18:58:22 EST
For sure we cannot backport the right way to fix this (upgrading WSDL4J) into WTP 3.0.4. That would be too much effort/change for a maintenance release.

I can look into perhaps just having the WSDL validator ignore the foreign tags between the wsdl:operation tags and not complain about it.  But if any WTP/WSDL adopters want to add their own extensions validator, they will not get a chance to validate the "foreign" tags.  Valentin's comment from comment #6 is also another complication that may make this bug difficult to fix in 3.0.4.
Comment 14 Hristo Sabev CLA 2008-12-19 03:57:33 EST
Hi,

This would still work for us. Judging from my point of view is better to skip validation of extensibility elements rather then showing errors on them.

Regards,
Hristo

Comment 15 Amy Wu CLA 2009-01-14 14:02:06 EST
i've released the fix to bug 252257, so this bug will should be fixed in the next ibuild.

i've also opened bug 261070 to track trying to backport some part of this fix into wtp 3.0.4.
Comment 16 Kathy Chan CLA 2009-02-11 21:56:06 EST
This bug has been in resolved state for a while.  Please verify this defect with the latest WTP 3.0.4 or WTP 3.5 build from:

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

If this is not verified within 2 weeks, we'll be verifying the bug on your behalf.  Thanks!
Comment 17 Valentin Baciu CLA 2009-06-11 14:35:12 EDT
Closing.