#59 Binding.getPortType doesn't return null if undefined porttyp

open
nobody
None
5
2013-03-30
2013-03-30
Anonymous
No

As long as wsdl:binding contains an attribute named "type" in the WSDL file, the Binding.getPortType() method will not return NULL no matter if the PortType is defined in the file or not. I suspect this is a bug because i experience opposite behaviour of the Port.getBinding(). It returns NULL if the attribute "binding" is not defined in the wsdl:port OR if the Binding that is referenced doesnt exist/is not defined within the WSDL.

However, I have discovered the method PortType.isUndefined(), but lack of the API documentation makes me not confident in trusting that this is the right place to the validation on.

Discussion

  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2013-03-30

    Sorry for not logging in before posting this bug. I have add that I'm using wsdl4j version 1.6.2

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2013-03-30

    Sorry for the confusion, my mistake! both methods, getBinding() and getPortType() does not return NULL if the Binding/PortType is not defined. They both return an initiated object which has isUndefined() = true. So I think I stick to this method when validating the WSDL. However, It might help having a better documentation of what isUndefined really do.