Hi there
I'm trying to build a web service that I can use with Taverna. The web
service that I have created works fine. I have tested it with soapUI
and that also confirms it to be working. However when I try and use it
with Taverna I get errors.
I'll start at the beginning explaining what I have done:
Using Eclipse I am creating a web service with the following class:
package com.jannetta.msc;
import javax.jws.WebMethod;
public class Sequences implements SequencesInt{
@WebMethod()
/* This Method returns the length of a DNA sequence */
public double calcSeqLength(String seq) {
return seq.length();
}
@WebMethod()
/* This Method returns the GC ratio of a DNA sequence */
public double calcSeqGC(String seq) {
int gctotal = 0;
for (int i = 0; i < seq.length(); i++) {
// Retrieve one nucleotide at a time
String nuc = seq.substring(i, i + 1);
// if this is a G or C add one to counter
if (nuc.equals("G")) {
gctotal++;
} else if (nuc.equals("C")) {
gctotal++;
}
}
// The total length of sequence
double total = seq.length();
// Calc and return the ratio
return (gctotal / total);
}
}
This results in a service available at
http://localhost:8080/WebServiceProject/services/Sequences?wsdl
Testing the service with soapUI, it works fine.
I can successfully add the service to Taverna. When I use one of the
methods in a workflow, the box looks something like this:
+---------------------------------------+
| parameters |
|-----------------------------------------|
| calcSeq |
|----------------------+------------------|
|attachmentList | parameters |
+---------------------+------------------+
Firstly, I don't understand why there are two output boxes. I did
however add an input to parameters (top one) and outputs to
attachmentList and parameters (bottom one). When running the workflow
it results in the following error for both outputs:
org.xml.sax.SAXParseException: Content is not allowed in prolog.
org.apache.xerces.parsers.DOMParser.parse(unknown file)
org.apache.xerces.jaxp.DocumentBuilderImpl.parse(unknown file)
javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
net.sf.taverna.wsdl.soap.AbstractBodyBuilder.populateElementWithObjectData(AbstractBodyBuilder.java:238)
net.sf.taverna.wsdl.soap.AbstractBodyBuilder.createBodyElementForData(AbstractBodyBuilder.java:150)
net.sf.taverna.wsdl.soap.AbstractBodyBuilder.build(AbstractBodyBuilder.java:123)
net.sf.taverna.wsdl.soap.LiteralBodyBuilder.build(LiteralBodyBuilder.java:81)
net.sf.taverna.wsdl.soap.WSDLSOAPInvoker.makeSoapBody(WSDLSOAPInvoker.java:194)
net.sf.taverna.wsdl.soap.WSDLSOAPInvoker.makeRequestEnvelope(WSDLSOAPInvoker.java:180)
net.sf.taverna.wsdl.soap.WSDLSOAPInvoker.invoke(WSDLSOAPInvoker.java:136)
net.sf.taverna.t2.activities.wsdl.T2WSDLSOAPInvoker.invoke(T2WSDLSOAPInvoker.java:265)
net.sf.taverna.t2.activities.wsdl.WSDLActivity$1.run(WSDLActivity.java:267)
java.lang.Thread.run(Thread.java:619)
I Googled the "Content is not allowed in prolog" and all I can find is
something about changing utf-8 to utf-16. Where and how does one do
that.
Another problem is that even when I have two inputs, the Taverna box
for the methods still only has one input.
So, in short, I pretty much don't know what goes on and how things are
suppose to work.
Any help world be greatly appreciated. Just ask if I need to provide
further information.
Regards
Jannetta
--
===================================
Web site: http://www.jannetta.com
Email: [email protected]
===================================
------------------------------------------------------------------------------
_______________________________________________
taverna-users mailing list
[email protected]
[email protected]
Web site: http://www.taverna.org.uk
Mailing lists: http://www.taverna.org.uk/about/contact-us/