You are viewing a plain text version of this content. The canonical link for it is here.
Posted to woden-dev@ws.apache.org by Graham Turrell <GT...@uk.ibm.com> on 2007/01/26 18:24:33 UTC

[WODEN] InterfaceOperation questions


Hi John,

Could you answer a conundrum I'm having with the unit test for
InterfaceOperation component test suite as part of WODEN-54 ?

I'm getting an unexpected NPE on DescriptionElement.toComponent() after
doing the following:

      private DescriptionElement fDescriptionElement = null;
      private Description fDescription = null;
      private InterfaceElement fInterfaceElement = null;
      private InterfaceOperationElement fInterfaceOperationElement = null;
      private final String INTF_NAME = "interfaceOperationName";
      private final String INTOP_NAME = "faultName";
      private URI fPattern = null;

            fDescriptionElement = new DescriptionImpl();
            fInterfaceElement = fDescriptionElement.addInterfaceElement();
            fInterfaceElement.setName(new NCName(INTF_NAME));
            fInterfaceOperationElement =
fInterfaceElement.addInterfaceOperationElement();
            fInterfaceOperationElement.setName(new NCName(INTOP_NAME));

            fPattern = new URI("http://www.w3.org/0000/00/wsdl/in-out");
            fInterfaceOperationElement.setPattern(fPattern);

            fDescription = fDescriptionElement.toComponent();

I have (I believe!) checked against the spec that all the mandatory
attirbutes and properties for <description> <interface> <operation> are set
in the above code. So either I've missed something in the spec or there is
a bug in the code.

The reason for the NPE is that when  toComponent() is called, the
ComponentModelBuilder calls its method buildInterfaceOperationExtensions().
The first thiing this does is

            ExtensionRegistry er = fDesc.getExtensionRegistry();
            URI[] extNamespaces = er

.queryComponentExtensionNamespaces(InterfaceOperation.class);

This therefore assumes that an ExtensionRegistry has been created
(presumably via Description.setExtensionRegistry())

So my questions are:
-  why does the ComponentModelBuilder code insist on an ExtensionRegistry
having been previously set on the Description? (I didn't expect it to be
mandatory?)
- if this is a correct expection, should
buildInterfaceOperationExtensions() really throw an NPE?

Any observations would be very welcome from all ! Many thanks.

I'm poised ready to complete WODEN-54 with a final commit, hopefully
including a solution to this, but if not, will open another.

Kind Regards,

Graham Turrell


---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org