2015-07-02 13:10 GMT+01:00 Ian Dunlop <[email protected]>:
> Hello,
>
> What is the output from
>
> datajson.toString()
>
Output: { "document":
"data:application\/octet-stream;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48czpzY3VmbCB4bWxuczpzPSJo\ndHRwOi8vb3JnLmVtYmwuZWJpLmVzY2llbmNlL3hzY3VmbC8wLjFhbHBoYSIgdmVyc2lvbj0iMC4y\nIiBsb2c9IjAiPiAgPHM6d29ya2Zsb3dkZXNjcmlwdGlvbiBsc2lkPSJ1cm46bHNpZDp3d3cubXln\ncmlkLm9yZy51azpvcGVyYXRpb246SzZaQ0c2SVdOUzAiIGF1dGhvcj0iIiB0aXRsZT0iIiAvPiAg\nPHM6cHJvY2Vzc29yIG5hbWU9IlN0cmluZ19Db25zdGFudCIgYm9yaW5nPSJ0cnVlIj4gICAgPHM6\nc3RyaW5nY29uc3RhbnQ+aHR0cDovL3d3dy5jcy5tYW4uYWMudWsvfmdvZGVyaXNhL1Bob3RvLmpw\nZzwvczpzdHJpbmdjb25zdGFudD4gIDwvczpwcm9jZXNzb3I+ICA8czpwcm9jZXNzb3IgbmFtZT0i\nR2V0X2ltYWdlX2Zyb21fVVJMIj4gICAgPHM6bG9jYWw+b3JnLmVtYmwuZWJpLmVzY2llbmNlLnNj\ndWZsd29ya2Vycy5qYXZhLldlYkltYWdlRmV0Y2hlcjwvczpsb2NhbD4gIDwvczpwcm9jZXNzb3I+\nICA8czpsaW5rIHNvdXJjZT0iU3RyaW5nX0NvbnN0YW50OnZhbHVlIiBzaW5rPSJHZXRfaW1hZ2Vf\nZnJvbV9VUkw6dXJsIiAvPiAgPHM6bGluayBzb3VyY2U9IkdldF9pbWFnZV9mcm9tX1VSTDppbWFn\nZSIgc2luaz0idml6IiAvPiAgPHM6c2luayBuYW1lPSJ2aXoiIC8+PC9zOnNjdWZsPg==\n"
}
> postJson.toString()
>
Output: { "workflow":
"{\"document\":\"data:application\\\/octet-stream;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48czpzY3VmbCB4bWxuczpzPSJo\\ndHRwOi8vb3JnLmVtYmwuZWJpLmVzY2llbmNlL3hzY3VmbC8wLjFhbHBoYSIgdmVyc2lvbj0iMC4y\\nIiBsb2c9IjAiPiAgPHM6d29ya2Zsb3dkZXNjcmlwdGlvbiBsc2lkPSJ1cm46bHNpZDp3d3cubXln\\ncmlkLm9yZy51azpvcGVyYXRpb246SzZaQ0c2SVdOUzAiIGF1dGhvcj0iIiB0aXRsZT0iIiAvPiAg\\nPHM6cHJvY2Vzc29yIG5hbWU9IlN0cmluZ19Db25zdGFudCIgYm9yaW5nPSJ0cnVlIj4gICAgPHM6\\nc3RyaW5nY29uc3RhbnQ+aHR0cDovL3d3dy5jcy5tYW4uYWMudWsvfmdvZGVyaXNhL1Bob3RvLmpw\\nZzwvczpzdHJpbmdjb25zdGFudD4gIDwvczpwcm9jZXNzb3I+ICA8czpwcm9jZXNzb3IgbmFtZT0i\\nR2V0X2ltYWdlX2Zyb21fVVJMIj4gICAgPHM6bG9jYWw+b3JnLmVtYmwuZWJpLmVzY2llbmNlLnNj\\ndWZsd29ya2Vycy5qYXZhLldlYkltYWdlRmV0Y2hlcjwvczpsb2NhbD4gIDwvczpwcm9jZXNzb3I+\\nICA8czpsaW5rIHNvdXJjZT0iU3RyaW5nX0NvbnN0YW50OnZhbHVlIiBzaW5rPSJHZXRfaW1hZ2Vf\\nZnJvbV9VUkw6dXJsIiAvPiAgPHM6bGluayBzb3VyY2U9IkdldF9pbWFnZV9mcm9tX1VSTDppbWFn\\nZSIgc2luaz0idml6IiAvPiAgPHM6c2luayBuYW1lPSJ2aXoiIC8+PC9zOnNjdWZsPg==\\n\"}"
}
> Cheers.
>
> Ian
> -----Original Message-----
> From: Ian Dunlop [mailto:[email protected]]
> Sent: 02 July 2015 13:03
> To: [email protected]
> Subject: RE: GSoC taverna mobile - how is the workflow upload
>
> Hello,
>
> Can you push your code up to github, in a branch if you want. It's hard to
> read in the mail.
>
> Cheers,
>
> Ian
>
> -----Original Message-----
> From: Larry Akah [mailto:[email protected]]
> Sent: 02 July 2015 12:29
> To: [email protected]
> Subject: Re: GSoC taverna mobile - how is the workflow upload
>
> Hello,
> I have encoded both the username/password and the workflow, if you loook
> closer you will see that i encode at two points the last one being where i
> am building the request body.
>
> i have used a smaller workflow but get the same error code. At first, i
> would think that the base64 encoding was too long to be consumed over http,
> but that apparently isn't the case. Checkout the logs again using the one
> but last workflow from the app, that is probably the smallest workflow
> there. I have printed the workflow body when it is finished constructing.
>
> Cheers
>
> 2015-07-02 10:36 UTC+01:00, Ian Dunlop <[email protected]>:
> > Hello,
> >
> > From looking at the server logs it looks like you have Base64 encoded
> > your username/password as the workflow instead of the workflow.
> >
> > Cheers,
> >
> > Ian
> >
> > -----Original Message-----
> > From: Larry Akah [mailto:[email protected]]
> > Sent: 02 July 2015 00:58
> > To: [email protected]
> > Subject: Re: GSoC taverna mobile - how is the workflow upload
> >
> > Hello,
> > Am trying to upload a workflow from the app but am getting a 'server
> > internal error' message. Here is my code snippet:
> >
> > String user = "myportalusername" + ":" +
> > "portalpassword";
> >> String basicAuth = "Basic " +
> >> Base64.encodeToString(user.getBytes(), Base64.DEFAULT);
> >>
> > //prepare post json data
> >> JSONObject postJson = new JSONObject();
> >> JSONObject datajson = new JSONObject();
> >> datajson.put("document",
> >> "data:application/octet-stream;base64,"+Base64.encodeToString(sb.toSt
> >> r ing().getBytes(), Base64.DEFAULT)+""); //sb already has the
> >> contents of the workflow file we need to upload
> >>
> > postJson.put("workflow",datajson.toString());
> >>
> >> System.out.println(postJson.toString(2));
> >> connection.setRequestProperty("Authorization",
> >> basicAuth);
> >> // connection.setRequestProperty("Accept",
> >> "application/json");
> >> connection.setRequestProperty("Content-Type",
> >> "application/json");
> >> connection.setRequestMethod("POST");
> >> connection.connect(); //send request
> >>
> >> DataOutputStream dos = new
> >> DataOutputStream(connection.getOutputStream());
> >> dos.writeBytes(postJson.toString());//write post data
> >> which is a formatted json data representing body of workflow
> >> //dos.writeUTF("");
> >> dos.flush();
> >> dos.close();
> >>
> >> System.out.println("Post Response Code:
> >> "+connection.getResponseCode());
> >> System.out.println("Post response message:
> >> "+connection.getResponseMessage());
> >>
> >
> > Anything else that needs to be added or subtracted? or Why do i get
> > this behavior?
> >
> > Cheers
> >
> > 2015-07-01 16:23 GMT+01:00 Ian Dunlop <[email protected]>:
> >
> >> Hello,
> >>
> >> @Larry just wondering how you are getting on with the workflow upload
> >> after our mails yesterday.
> >>
> >> Cheers,
> >>
> >> Ian
> >>
> >
> >
> >
> > --
> > *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.