Hi!

As there was no way to make my webservice running (see my mail 
yesterday; I have been trying with a colleague for more than a week 
now), we switched to a simple REST service.

As a background, the service extracts numeric descriptors from audio, 
primarily in the form of MP3, so you need that as an input.

I have tested this nicely with a simple client based on the 
Java-internal URL class, sending the data as Base64 encoded.

It looks pretty much like that:

String data = "musicData=" + base64EncodedString.
URL url = new URL("reallyJustTheBaseURL !");
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(data);
wr.flush();


Now the REST service works fine in Taverna principle, but it is not able 
to compose any request that would be larger than around 7kb; that is 
even though I have switched the service to POST (and I can see on my 
REST application server-side that it in fact does a POST); I tried to 
set exactly the content type that the Java client sends, but to no avail.


If the data to be sent is way larger than the above mentioned ~7kb, I 
get an exception on the command line as follows:


java.net.SocketException: Broken pipe
        at java.net.SocketOutputStream.socketWrite0(Native Method)
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
        at 
org.apache.http.impl.io.AbstractSessionOutputBuffer.flushBuffer(AbstractSessionOutputBuffer.java:106)
        at 
org.apache.http.impl.io.AbstractSessionOutputBuffer.flush(AbstractSessionOutputBuffer.java:113)
        at 
org.apache.http.impl.AbstractHttpClientConnection.doFlush(AbstractHttpClientConnection.java:260)
        at 
org.apache.http.impl.SocketHttpClientConnection.close(SocketHttpClientConnection.java:248)
        at 
org.apache.http.impl.conn.DefaultClientConnection.close(DefaultClientConnection.java:154)
        at 
org.apache.http.impl.conn.AbstractPooledConnAdapter.close(AbstractPooledConnAdapter.java:148)
        at 
org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:130)
        at 
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:483)
        at 
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641)
        at 
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:576)
        at 
net.sf.taverna.t2.activities.rest.HTTPRequestHandler.performHTTPRequest(HTTPRequestHandler.java:278)
        at 
net.sf.taverna.t2.activities.rest.HTTPRequestHandler.doPOST(HTTPRequestHandler.java:178)
        at 
net.sf.taverna.t2.activities.rest.HTTPRequestHandler.initiateHTTPRequest(HTTPRequestHandler.java:129)
        at 
net.sf.taverna.t2.activities.rest.RESTActivity$1.run(RESTActivity.java:231)
        at java.lang.Thread.run(Thread.java:679)


If the data is just a bit larger than the 7kb, there is no exception, 
but the the process does not run correctly, and the output in the 
responseBody is just

Error Trace
net.sf.taverna.t2.reference.impl.ErrorDocumentImpl@11054e7f

the status code is 400



The major difference I can notice is in the headers sent along; A 
Wireshark inspection tells me that Taverna seems to send the all the 
data in the query string, while with my simple client, I can send it as 
(form) data.

So, basically, Taverna sends it as POST method, but uses the URL as GET 
would do -
- that obviously doesn't work with standard configuration of most 
webservers (Apache Tomcat in my case)
- is not really meaningful

I can reason why the URL is constructed this way, because that's the 
only way to input it in the Taverna interface with the URI template.
But this doesn't make any sense, if you change from GET to POST in the 
GUI, you should be able to specify the params separately, so they do not 
become part of the URL.


The only way to fix this was to allow the Webserver to accept HTTP 
headers in the range of several megabytes - which again does not seem 
meaningful to me.

Finally, I am not sure how the limit of around 7kb came into play, as 
the default for the Tomcat 6.0 for the header size was 4 kb.

Would be grateful for some explanations.

Finally, I tried to look up the source code for the REST component, but 
had no success in finding the CVS module that holds 
net.sf.taverna.t2.activities.rest.HTTPRequestHandler; 
http://taverna.cvs.sourceforge.net/taverna/ has just too many modules.

Kind regards,
Rudolf

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
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/

Reply via email to