Hello,

I only changed one tiny bit of your code in the WorkflowdetailsFragment class. 
Look at this gist:

https://gist.github.com/ianwdunlop/2c3615e9094827fabd83

You might be running into issues with the http connection closing during debug 
mode which I encountered yesterday.  It will cause a broken pipe exception. You 
may have to run the app as normal when testing this or maybe move your 
breakpoints to after the connection has sent the request.

Cheers,

Ian

-----Original Message-----
From: Larry Akah [mailto:[email protected]] 
Sent: 08 July 2015 10:52
To: [email protected]
Subject: Re: GSOC Taverna Mobile: Uploading workflows to the Taverna player

Hello,
I've done that but i still don't get any workflow created on the player.
point me to the snippet that you have.

Thanks

2015-07-08 10:29 GMT+01:00 Ian Dunlop <[email protected]>:

> Hello,
>
> It's just the line that encodes the workflow that I changed by telling 
> it to change all the '-' characters to a '+'
>
> String data = "{\"document\":\"data:application/octet-stream;base64," 
> + Base64.encodeToString(sb.toString().getBytes("UTF-8"),
> Base64.URL_SAFE|Base64.NO_WRAP).replace('-', '+') +"\"}";
>
> Cheers,
>
> Ian
>
> -----Original Message-----
> From: Larry Akah [mailto:[email protected]]
> Sent: 07 July 2015 17:14
> To: [email protected]
> Subject: Re: GSOC Taverna Mobile: Uploading workflows to the Taverna 
> player
>
> Hello,
> Please can i have the complete code snippet that is working at the 
> time? i can't seem to find myself. is it that on my repo or somewhere else?
>
> Thanks
>
> 2015-07-07 14:34 GMT+01:00 Ian Dunlop <[email protected]>:
>
> > Hello,
> >
> > I've tried uploading via the app and it all seems to be OK now. I 
> > get the response 201 created and you can see the workflows on the player.
> > Not sure how you get the actual response content from the http 
> > connection though :) Now all you have to do is figure out how to 
> > actually pass in the inputs for the workflow and run it......
> >
> > Also, still not sure what I am logging into on the first screen - 
> > does it do anything. Anyway, not as important as getting an actual 
> > workflow run working so concentrate on that.
> >
> > Cheers,
> >
> > Ian
> >
> > -----Original Message-----
> > From: Larry Akah [mailto:[email protected]]
> > Sent: 07 July 2015 12:25
> > To: [email protected]
> > Subject: Re: GSOC Taverna Mobile: Uploading workflows to the Taverna 
> > player
> >
> > ok, i will try that.
> >
> > Thanks
> >
> > 2015-07-07 12:10 GMT+01:00 Ian Dunlop <[email protected]>:
> >
> > > Hello,
> > >
> > > I changed the encoding part to this:
> > >
> > > String data = "{\"document\":\"data:application/octet-stream;base64,"
> > > +
> > >
> > > Base64.encodeToString(sb.toString().getBytes("UTF-8"),
> > > Base64.URL_SAFE|Base64.NO_WRAP).replace('-', '+') +"\"}";
> > >
> > > Basically I did a string replace on the Base64 encoded workflow 
> > > using .replace('-', '+')
> > >
> > > Then I tried uploading to the player and it worked. I haven't 
> > > figured out what your app does with the response but the request 
> > > was successful on the player.
> > >
> > > Cheers,
> > >
> > > Ian
> > >
> > > -----Original Message-----
> > > From: Larry Akah [mailto:[email protected]]
> > > Sent: 07 July 2015 11:58
> > > To: [email protected]
> > > Subject: Re: GSOC Taverna Mobile: Uploading workflows to the 
> > > Taverna player
> > >
> > > Hello,
> > > Wait, but i am trying to upload workflow id 34 even with the '+'
> > > used and i still get the 'Internal Server Error'. This is the 
> > > base64 encoded
> > > workflow:
> > >
> > >
> > >
> >
> PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHM6c2N1ZmwgeG1sbnM6cz0iaHR0cDovL29yZy5lbWJsLmViaS5lc2NpZW5jZS94c2N1ZmwvMC4xYWxwaGEiIHZlcnNpb249IjAuMiIgbG9nPSIwIj4KICA8czp3b3JrZmxvd2Rlc2NyaXB0aW9uIGxzaWQ9InVybjpsc2lkOnd3dy5teWdyaWQub3JnLnVrOm9wZXJhdGlvbjpLNlpDRzZJV05TMCIgYXV0aG9yPSIiIHRpdGxlPSIiIC8+CiAgPHM6cHJvY2Vzc29yIG5hbWU9IlN0cmluZ19Db25zdGFudCIgYm9yaW5nPSJ0cnVlIj4KICAgIDxzOnN0cmluZ2NvbnN0YW50Pmh0dHA6Ly93d3cuY3MubWFuLmFjLnVrL35nb2RlcmlzYS9QaG90by5qcGc8L3M6c3RyaW5nY29uc3RhbnQ+CiAgPC9zOnByb2Nlc3Nvcj4KICA8czpwcm9jZXNzb3IgbmFtZT0iR2V0X2ltYWdlX2Zyb21fVVJMIj4KICAgIDxzOmxvY2FsPm9yZy5lbWJsLmViaS5lc2NpZW5jZS5zY3VmbHdvcmtlcnMuamF2YS5XZWJJbWFnZUZldGNoZXI8L3M6bG9jYWw+CiAgPC9zOnByb2Nlc3Nvcj4KICA8czpsaW5rIHNvdXJjZT0iU3RyaW5nX0NvbnN0YW50OnZhbHVlIiBzaW5rPSJHZXRfaW1hZ2VfZnJvbV9VUkw6dXJsIiAvPgogIDxzOmxpbmsgc291cmNlPSJHZXRfaW1hZ2VfZnJvbV9VUkw6aW1hZ2UiIHNpbms9InZpeiIgLz4KICA8czpzaW5rIG5hbWU9InZpeiIgLz4KPC9zOnNjdWZsPgoKCg==
> > > >
> > >
> > > This is the code am using to test the upload
> > >
> > >    String data =
> > > "{\"document\":\"data:application/octet-stream;base64," +
> > > >
> > > >
> > > "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHM6c2N1Zmwge
> > > G1
> > > sb
> > > nM6cz0iaHR0cDovL29yZy5lbWJsLmViaS5lc2NpZW5jZS94c2N1ZmwvMC4xYWxwaGE
> > > iI
> > > HZ
> > > lcnNpb249IjAuMiIgbG9nPSIwIj4KICA8czp3b3JrZmxvd2Rlc2NyaXB0aW9uIGxza
> > > WQ
> > > 9I
> > > nVybjpsc2lkOnd3dy5teWdyaWQub3JnLnVrOm9wZXJhdGlvbjpLNlpDRzZJV05TMCI
> > > gY
> > > XV
> > > 0aG9yPSIiIHRpdGxlPSIiIC8+CiAgPHM6cHJvY2Vzc29yIG5hbWU9IlN0cmluZ19Db
> > > 0aG9yPSIiIHRpdGxlPSIiIC8+25
> > > 0aG9yPSIiIHRpdGxlPSIiIC8+zd
> > > GFudCIgYm9yaW5nPSJ0cnVlIj4KICAgIDxzOnN0cmluZ2NvbnN0YW50Pmh0dHA6Ly9
> > > 3d
> > > 3c
> > > uY3MubWFuLmFjLnVrL35nb2RlcmlzYS9QaG90by5qcGc8L3M6c3RyaW5nY29uc3RhbnQ+C
> > > iAgPC9zOnByb2Nlc3Nvcj4KICA8czpwcm9jZXNzb3IgbmFtZT0iR2V0X2ltYWdlX2Z
> > > yb
> > > 21
> > > fVVJMIj4KICAgIDxzOmxvY2FsPm9yZy5lbWJsLmViaS5lc2NpZW5jZS5zY3VmbHdvc
> > > mt
> > > lc
> > > nMuamF2YS5XZWJJbWFnZUZldGNoZXI8L3M6bG9jYWw+CiAgPC9zOnByb2Nlc3Nvcj4
> > > nMuamF2YS5XZWJJbWFnZUZldGNoZXI8L3M6bG9jYWw+KI
> > > nMuamF2YS5XZWJJbWFnZUZldGNoZXI8L3M6bG9jYWw+CA
> > > 8czpsaW5rIHNvdXJjZT0iU3RyaW5nX0NvbnN0YW50OnZhbHVlIiBzaW5rPSJHZXRfa
> > > W1
> > > hZ
> > > 2VfZnJvbV9VUkw6dXJsIiAvPgogIDxzOmxpbmsgc291cmNlPSJHZXRfaW1hZ2VfZnJ
> > > vb
> > > V9
> > > VUkw6aW1hZ2UiIHNpbms9InZpeiIgLz4KICA8czpzaW5rIG5hbWU9InZpeiIgLz4KP
> > > C9
> > > zO
> > > nNjdWZsPgoKCg=="+"\"}";
> > > >                 String post = "{\"workflow\":"+data+"}";
> > > >
> > > >                 System.out.println("BODY=>"+post);
> > > >                 connection.setRequestMethod("POST");
> > > >                 connection.setRequestProperty("Authorization",
> > > basicAuth);
> > > >                 connection.setRequestProperty("Content-Type",
> > > > "application/json");
> > > >                 
> > > > connection.setRequestProperty("Content-Encoding",
> > > "UTF-8");
> > > >                 connection.setUseCaches (false);
> > > >                 connection.setDoOutput(true);
> > > >                 connection.connect(); //send request
> > > >
> > > >                 DataOutputStream dos = new 
> > > > DataOutputStream(connection.getOutputStream());
> > > >
> > > >                 dos.writeBytes(post);//write post data which is 
> > > > a formatted json data representing body of workflow
> > > >               //  dos.writeChars(post);
> > > >                // dos.write(post.getBytes("UTF-8"));
> > > >                // dos.writeUTF(post);
> > > >
> > > >                 dos.flush();
> > > >                 dos.close();
> > > >
> > > >                 System.out.println("Post Response Code:
> > > > "+connection.getResponseCode());
> > > >                 System.out.println("Post response message:
> > > > "+connection.getResponseMessage());
> > > >                 connection.disconnect();
> > > >
> > >
> > > Cheers
> > >
> > > 2015-07-07 11:45 GMT+01:00 Larry Akah <[email protected]>:
> > >
> > > > Ah, ok. Let me try some options out but i think the former would 
> > > > require a new implementation of android's base64 because i have 
> > > > tried all the possible options and they all give error.
> > > >
> > > > Cheers
> > > >
> > > > 2015-07-07 11:41 GMT+01:00 Ian Dunlop <[email protected]>:
> > > >
> > > >> Hello,
> > > >>
> > > >> We think we have figured out the issue with the encoding. Java
> > > >> Base64 uses a '-' instead of a '+' when encoding. Command line 
> > > >> in Linux and Ruby expect a '+'. When we converted the raw 
> > > >> Base64 encoded workflow from the android request and changed all the 
> > > >> '-'
> > characters to a '+'
> > > it works ok.
> > > >> So either we need to figure out how to tell Java to use '+'
> > > >> instead of
> > > '-'
> > > >> or we change the encoded workflow string using string replace 
> > > >> before adding it to the request string.
> > > >>
> > > >> Lots of thanks to Finn for helping me to debug this.
> > > >>
> > > >> Cheers,
> > > >>
> > > >> Ian
> > > >>
> > > >> -----Original Message-----
> > > >> From: Larry Akah [mailto:[email protected]]
> > > >> Sent: 07 July 2015 11:37
> > > >> To: [email protected]
> > > >> Subject: Re: GSOC Taverna Mobile: Uploading workflows to the 
> > > >> Taverna player
> > > >>
> > > >> Is it possible that i get the body of the request that the 
> > > >> player is actually receiving?
> > > >>
> > > >> Cheers
> > > >>
> > > >> 2015-07-07 11:36 GMT+01:00 Larry Akah <[email protected]>:
> > > >>
> > > >> > workflow id number 34 is the workflow i've been working with
> > > >> >
> > > >> >
> > > >> > 2015-07-07 10:27 GMT+01:00 Ian Dunlop 
> > > >> > <[email protected]
> > >:
> > > >> >
> > > >> >> Hello,
> > > >> >>
> > > >> >> It's hard to tell from the logs if the output relates to 
> > > >> >> what you are doing, what workflow are you trying to upload. 
> > > >> >> The logs are full of "parser
> > > >> >> error: PCDATA invalid Char value ". Maybe there are 
> > > >> >> characters in it that the tavern player XML parser cannot 
> > > >> >> read. Anyone else have any
> > > >> ideas.
> > > >> >>
> > > >> >> Cheers,
> > > >> >>
> > > >> >> Ian
> > > >> >>
> > > >> >> -----Original Message-----
> > > >> >> From: Larry Akah [mailto:[email protected]]
> > > >> >> Sent: 06 July 2015 17:52
> > > >> >> To: [email protected]
> > > >> >> Subject: Re: GSOC Taverna Mobile: Uploading workflows to the 
> > > >> >> Taverna player
> > > >> >>
> > > >> >> What do the server logs reveal from the recent requests just 
> > > >> >> few moments ago? I could use some help from them.
> > > >> >>
> > > >> >>
> > > >> >> Cheers
> > > >> >>
> > > >> >> 2015-07-06 12:22 GMT+01:00 alaninmcr <[email protected]>:
> > > >> >>
> > > >> >> > On 06/07/2015 12:03, Ian Dunlop wrote:
> > > >> >> >
> > > >> >> >> Hello,
> > > >> >> >>
> > > >> >> >> I just sent workflow 16 to the taverna player by base64 
> > > >> >> >> encoding it on the command line and using curl and it all 
> > > >> >> >> worked ok. Here is the
> > > >> >> >> base64 version
> > > >> >> >> https://dl.dropboxusercontent.com/u/4958764/wf16.base64
> > > >> >> >> Maybe you need to ensure it is UTF-8 character set.
> > > >> >> >>
> > > >> >> >
> > > >> >> > Also that it is not broken into lines. That file correctly 
> > > >> >> > keeps the
> > > >> >> > base64 all in one line. Some base64 methods will, by 
> > > >> >> > default, break it into human-friendly lines which can be 
> > > >> >> > confusing for the reading
> > > >> system.
> > > >> >> >
> > > >> >> >  Cheers,
> > > >> >> >>
> > > >> >> >> Ian
> > > >> >> >>
> > > >> >> >
> > > >> >> > Alan
> > > >> >> >
> > > >> >>
> > > >> >>
> > > >> >>
> > > >> >> --
> > > >> >> *Akah Larry N.H*
> > > >> >>
> > > >> >> *Lead Software Engineer @ GiftedMom* *Founder IceTeck Inc*
> > > >> >> *www.iceteck.com*
> > > >> >>
> > > >> >> Developing technologies for emergence and sustainable
> development.
> > > >> >>
> > > >> >
> > > >> >
> > > >> >
> > > >> > --
> > > >> > *Akah Larry N.H*
> > > >> >
> > > >> > *Lead Software Engineer @ GiftedMom* *Founder IceTeck Inc*
> > > >> > *www.iceteck.com*
> > > >> >
> > > >> > Developing technologies for emergence and sustainable development.
> > > >> >
> > > >> >
> > > >>
> > > >>
> > > >> --
> > > >> *Akah Larry N.H*
> > > >>
> > > >> *Lead Software Engineer @ GiftedMom* *Founder IceTeck Inc*
> > > >> *www.iceteck.com*
> > > >>
> > > >> Developing technologies for emergence and sustainable development.
> > > >>
> > > >
> > > >
> > > >
> > > > --
> > > > *Akah Larry N.H*
> > > >
> > > > *Lead Software Engineer @ GiftedMom* *Founder IceTeck Inc*
> > > > *www.iceteck.com*
> > > >
> > > > Developing technologies for emergence and sustainable development.
> > > >
> > > >
> > >
> > >
> > > --
> > > *Akah Larry N.H*
> > >
> > > *Lead Software Engineer @ GiftedMom* *Founder IceTeck Inc*
> > > *www.iceteck.com*
> > >
> > > Developing technologies for emergence and sustainable development.
> > >
> >
> >
> >
> > --
> > *Akah Larry N.H*
> >
> > *Lead Software Engineer @ GiftedMom* *Founder IceTeck Inc*
> > *www.iceteck.com*
> >
> > Developing technologies for emergence and sustainable development.
> >
>
>
>
> --
> *Akah Larry N.H*
>
> *Lead Software Engineer @ GiftedMom*
> *Founder IceTeck Inc*
> *www.iceteck.com*
>
> Developing technologies for emergence and sustainable development.
>



--
*Akah Larry N.H*

*Lead Software Engineer @ GiftedMom*
*Founder IceTeck Inc*
*www.iceteck.com*

Developing technologies for emergence and sustainable development.

Reply via email to