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 93230 - WSDL Validation: confused when operation names are not unique
Summary: WSDL Validation: confused when operation names are not unique
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: WSDL Tools (show other bugs)
Version: 5.x
Hardware: All Windows XP
: P2 blocker (vote)
Assignee: Ritesh Adval
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-25 23:36 UTC by jlautz
Modified: 2007-02-14 18:52 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Validation errors. (1.42 KB, application/octet-stream)
2007-01-25 23:37 UTC, jlautz
Details
WSDL document used in the scenario. (4.09 KB, application/octet-stream)
2007-01-25 23:38 UTC, jlautz
Details
WSDL file used for retest. (3.16 KB, application/octet-stream)
2007-02-07 22:47 UTC, jlautz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jlautz 2007-01-25 23:36:45 UTC
Seen on Windows XP with Gavotte 070125_12 and JDK 1.5.0_10.

(This is a regression that I'll bet is related to the fix for issue 91450.)

1. Open the attached WSDL and validate it.

This file should be valid. According to the WSDL 1.1 spec, section 2.5
(http://www.w3.org/TR/wsdl#_bindings):

An operation element within a binding specifies binding information for the
operation with the same name within the binding's portType. Since operation
names are not required to be unique (for example, in the case of overloading of
method names), the name attribute in the operation binding element might not be
enough to uniquely identify an operation. In that case, the correct operation
should be identified by providing the name attributes of the corresponding
wsdl:input and wsdl:output elements.

The port type looks like this:

   <portType name="goodRRFOperationPortType">
        <operation name="goodRRFOperationOperation">
            <input name="input1" message="tns:goodRRFOperationOperationRequest"/>
            <output name="output1" message="tns:goodRRFOperationOperationReply"/>
            <fault name="fault1" message="tns:goodRRFOperationOperationFault"/>
        </operation>
        <operation name="goodRRFOperationOperation">
            <input name="input2" message="tns:goodRRFOperationOperationRequest"/>
            <output name="output2" message="tns:goodRRFOperationOperationReply"/>
            <fault name="fault2" message="tns:goodRRFOperationOperationFault"/>
        </operation>
    </portType>
  
And the binding where the error is flagged looks like this:

    <binding name="secondBinding" type="tns:goodRRFOperationPortType">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="goodRRFOperationOperation">
            <soap:operation/>
            <input name="input2">
                <soap:body use="literal"
namespace="http://j2ee.netbeans.org/wsdl/goodRRFOperation"/>
            </input>
            <output name="output2">
                <soap:body use="literal"
namespace="http://j2ee.netbeans.org/wsdl/goodRRFOperation"/>
            </output>
            <fault name="fault2">
                <soap:fault use="literal" name="fault2"
namespace="http://j2ee.netbeans.org/wsdl/goodRRFOperation"/>
            </fault>
        </operation>
    </binding>


It appears from the error messages (attached), that the validator is confused
about which of the two port operations it is supposed to be looking at for the
binding operation, and fails to recognize that it maps to the second port operation.
Comment 1 jlautz 2007-01-25 23:37:22 UTC
Created attachment 37683 [details]
Validation errors.
Comment 2 jlautz 2007-01-25 23:38:07 UTC
Created attachment 37684 [details]
WSDL document used in the scenario.
Comment 3 jlautz 2007-01-26 00:09:33 UTC
Since I dumped everything else in here, I might as well include the contents of
the XML check pane:

XML validation started.

C:/cokebuilds/projects/WSDLSemantics/src/bindingTests/operations/bindingRRFMultiOpsNonUniqueOpName_valid.wsdl:48,12
Input name attribute in binding operation "goodRRFOperationOperation" in binding
"secondBinding" should match input name attribute in the corresponding operation
in portType "goodRRFOperationPortType".  : Ensure that the input name in
portType operation "goodRRFOperationOperation" is the same as the name in the
corresponding binding operation. 

C:/cokebuilds/projects/WSDLSemantics/src/bindingTests/operations/bindingRRFMultiOpsNonUniqueOpName_valid.wsdl:51,12
Output name attribute in binding operation "goodRRFOperationOperation" in
binding "secondBinding" should match output name attribute in the corresponding
operation in portType "goodRRFOperationPortType".  : Ensure that the output name
in portType operation "goodRRFOperationOperation" is the same as the name in the
corresponding binding operation.

C:/cokebuilds/projects/WSDLSemantics/src/bindingTests/operations/bindingRRFMultiOpsNonUniqueOpName_valid.wsdl:46,8
Faults in binding operation "goodRRFOperationOperation" in binding
"secondBinding" should match faults in the corresponding operation in portType
"goodRRFOperationPortType".  : Ensure that the faults in portType operation
"goodRRFOperationOperation" has matching counterparts in the corresponding
binding operation.

1 Error(s),  2 Warning(s).
XML validation finished.
Comment 4 Roderico Cruz 2007-01-26 04:55:49 UTC
You are correct. The validator should consider the names of the messages in the
binding section when matching overloaded operations with those in the porttype
section.
Comment 5 Ritesh Adval 2007-02-05 22:56:52 UTC
This is fixed.
get the reference operation from binding operation, not the first operation 
matching from portType operations.

add Junit tests.
Comment 6 jlautz 2007-02-07 22:45:46 UTC
I don't see this fix in the EP Gavotte 070207_9 build. With virtually same
situation, I get the following messages:

XML validation started.
C:/Documents and Settings/lautz/BpelModule9/src/newWSDL.wsdl:36,12
Warning: Input name attribute in binding operation "newWSDLOperation" in binding
"newWSDLBinding" should match input name attribute in the corresponding
operation in portType "newWSDLPortType".  : Ensure that the input name in
portType operation "newWSDLOperation" is the same as the name in the
corresponding binding operation. 

C:/Documents and Settings/lautz/BpelModule9/src/newWSDL.wsdl:39,12
Warning: Output name attribute in binding operation "newWSDLOperation" in
binding "newWSDLBinding" should match output name attribute in the corresponding
operation in portType "newWSDLPortType".  : Ensure that the output name in
portType operation "newWSDLOperation" is the same as the name in the
corresponding binding operation.

C:/Documents and Settings/lautz/BpelModule9/src/newWSDL.wsdl:34,8
Error: Faults in binding operation "newWSDLOperation" in binding
"newWSDLBinding" should match faults in the corresponding operation in portType
"newWSDLPortType".  : Ensure that the faults in portType operation
"newWSDLOperation" has matching counterparts in the corresponding binding operation.

1 Error(s),  2 Warning(s).
XML validation finished.

WSDL file attached.
Comment 7 jlautz 2007-02-07 22:47:12 UTC
Created attachment 38210 [details]
WSDL file used for retest.
Comment 8 Shivanand Kini 2007-02-09 20:21:01 UTC
I reverified this today. The fix works. Did not get any errors.
Comment 9 jlautz 2007-02-14 18:52:23 UTC
Verified on Windows XP with EP Gavotte 070214_2 and JDK 1.5.0_10.