I've just checked in r414181 to fix these two JIRAs.

WODEN-25 [1]: DOMWSDLReader.parseBinding() check that we have a valid
NCName before setting it on the new BindingImpl
WODEN-29 [2]: DescriptionElement.setTargetNamespace() should filter
down to child elements

* For elements that have a name attribute which is defined as an
NCName in the spec I have ensured that for all
org.apache.woden.internal.wsdl20.Xxx.setName() where Xxx is a class
containing a setName() method, setName() now takes an NCName as
parameter instead of a QName.

Fixing WODEN-25 meant fixing WODEN-29 at the same time - in order to
fix failing unit tests. Which means:

* getName() methods continue to return a QName as this is useful to
the client code. The namespace of the QName is now taken from the
'root parent'. So in effect DescriptionElement.setTargetNamespace()
changes the namespace of all name attributes on XxxElement objects it
contains.

* in order that a component's {name} property is a correct QName the
associated XxxElement must have been added to a DescriptionElement (or
the relevant child of a DescriptionElement). So for example if you
want to InterfaceOperation.getName() then the
InterfaceOperationElement must have been added to an InterfaceElement
and that must have been added to a DescriptionElement and
setTargetNamespace() must have been called on the DescriptionElement.
If one of those hasn't happened the namespace of the QName returned by
getName() will be the empty string.

Note: The Endpoint.getName() method returns an NCName unlike all the
other getName() methods. This is because the spec's element component
{name} property is defined as an NCName but the xml representation
defines the name attribute together with the targetNamespace as
forming the QName of the endpoint! Will follow up on w3c list.

Also, I have had to remove a test case which no longer makes sense as
it is no longer possible to set the namespace of the name attribute of
the InterfaceOperationElement to be different to the namespace of the
name attribute of its enclosing InterfaceElement. This is because the
setName() method now takes an NCName.

   // Test that the method returns false if the namespaces are different.
   try
   {
     DescriptionImpl desc = new DescriptionImpl();
     InterfaceImpl interfac = (InterfaceImpl)desc.createInterfaceElement();
     interfac.setName(new QName("http://www.sample.org";, "interfacename"));
     InterfaceOperationImpl interfaceOperation = new InterfaceOperationImpl();
     interfaceOperation.setName(new QName("http://www.sample2.org";,
"interfaceoperation"));
     if(val.testAssertionInterfaceOperation0029(interfaceOperation,
interfac, reporter))
     {
       fail("The testAssertionInterfaceOperation0029 method returned
true for an interface operation with a different namespace than the
containing interface.");
     }
   }
   catch(WSDLException e)
   {
     fail("There was a problem running the test assertion method " + e);
   }
 }

[1] http://issues.apache.org/jira/browse/WODEN-25?page=comments
[2] http://issues.apache.org/jira/browse/WODEN-29?page=comments

Cheers,
Jeremy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to