Uploaded image for project: 'Apache Taverna'
  1. Apache Taverna
  2. TAVERNA-187

Wrong/invalid element name from XML splitters for inner complex types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: To Do
    • Major
    • Resolution: Unresolved
    • None
    • None

    Description

      Katy reported on 2010-01-21 to Alan (workflow attached):

      I'm having some trouble with a complex type asynchronous web service. I
      think there is a problem with the xml splitters because I am getting an
      error for simply supplying the individual pieces to pass into a splitter
      service.

      Would you mind having a quick look for me please? The workflow is attached
      and the service is here in biocat:
      http://www.biocatalogue.org/services/147-wsnetchop_3_1_910208#overview

      I am getting the error in the first splitter service sequences_sequences
      and I was using the example sequence from the biocat documentation
      (ACDEFGHIKLMNPQRSTVWY)

      Alan is able to reproduce this stack trace:

      I can confirm that Taverna 2.1 runs the workflow but gets an errorDocument with:

      Error Trace
      net.sf.taverna.t2.reference.impl.ErrorDocumentImpl@a90033
      net.sf.taverna.t2.reference.impl.ErrorDocumentImpl@5bf8a2
      net.sf.taverna.t2.reference.impl.ErrorDocumentImpl@ab4e86
      net.sf.taverna.t2.reference.impl.ErrorDocumentImpl@57ad50
      net.sf.taverna.t2.reference.impl.ErrorDocumentImpl@3fb58e
      org.jdom.IllegalNameException: The name ">sequences>entry" is not legal for JDOM/XML elements: XML names cannot begin with the character ">".
      org.jdom.Element.setName(Element.java:206)
      org.jdom.Element.<init>(Element.java:140)
      org.jdom.Element.<init>(Element.java:152)
      net.sf.taverna.wsdl.xmlsplitter.XMLInputSplitter.execute(XMLInputSplitter.java:61)
      net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLInputSplitterActivity$1.run(XMLInputSplitterActivity.java:88)
      java.lang.Thread.run(Thread.java:613)

      Inspection shows that the XMLInputSplitter does on line 61:

      Element outputElement = (this.typeDescriptor.getName().length() > 0 ? new Element(
      				this.typeDescriptor.getName())
      				: new Element(this.typeDescriptor.getType()));
      

      So this is to create the <entry> element for the topmost XML splitter sequence_sequence in the workflow.

      The webservice is defined at http://www.cbs.dtu.dk/ws/NetChop/NetChop_3_1.wsdl and the imported http://www.cbs.dtu.dk/ws/common/ws_common_1_0.xsd shows this complex type as:

      <xsd:complexType name="sequences">
      		<xsd:sequence>
      			<xsd:element name="entry" maxOccurs="unbounded">
      				<xsd:complexType>
      					<xsd:sequence>
      						<xsd:element name="ident">
      							<xsd:simpleType>
      								<xsd:restriction base="xsd:string">
      									<xsd:pattern value=".*"/>
      								</xsd:restriction>
      							</xsd:simpleType>
      						</xsd:element>
      						<xsd:element name="seq">
      							<xsd:simpleType>
      								<xsd:restriction base="xsd:string">
      									<xsd:pattern value="[A-Za-z\n]+"/>
      								</xsd:restriction>
      							</xsd:simpleType>
      						</xsd:element>
      					</xsd:sequence>
      				</xsd:complexType>
      			</xsd:element>
      		</xsd:sequence>
      	</xsd:complexType>
      

      Taverna seems to loose that name="entry" bit - because instead of the splitter making an element <entry> it is trying to make an element >sequences>entry

      Inspection in Debug mode shows that setName() is never called when creating the net.sf.taverna.wsdl.parser.ComplexTypeDescriptor – and so the code snippet will instead use the type - which has been set as the local part of the fully qualified name {{

      {http://www.cbs.dtu.dk/ws/ws-common}

      >sequences>entry}}

      It seems the setName() method has logic for this:

      public void setName(String name) {
      		int i;
      		if ((i = name.lastIndexOf('>')) != -1) {
      			this.name = name.substring(i + 1);
      		} else {
      			this.name = name;
      		}
      	}
      

      but net.sf.taverna.wsdl.parser.WSDLParser.constructComplexType() does not call this, only:

      result.setType(type.getQName().getLocalPart());
      			cachedComplexTypes.put(type.getQName().toString(), result);
      			List containedElements = type.getContainedElements();
      			if (containedElements != null) {
      				result.getElements().addAll(
      						constructElements(containedElements));
      			}
      			result.setQname(type.getQName());
      

      Even a crude attempt to add setName() here (using Display tab in Eclipse) and reconstructing the workflow from scratch does not seem to work, as at a later stage when creating the splitters, the splitter definitions is serialised and deserialised as XML, and the name seems to be lost again.

      Attachments

        Activity

          People

            Unassigned Unassigned
            stain Stian Soiland-Reyes
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 16h
                16h
                Remaining:
                Time Spent - 2h Remaining Estimate - 14h
                14h
                Logged:
                Time Spent - 2h Remaining Estimate - 14h
                2h