Return-Path: X-Original-To: apmail-airavata-dev-archive@www.apache.org Delivered-To: apmail-airavata-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2B5AB111CB for ; Thu, 12 Jun 2014 17:52:27 +0000 (UTC) Received: (qmail 4720 invoked by uid 500); 12 Jun 2014 17:52:27 -0000 Delivered-To: apmail-airavata-dev-archive@airavata.apache.org Received: (qmail 4674 invoked by uid 500); 12 Jun 2014 17:52:27 -0000 Mailing-List: contact dev-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list dev@airavata.apache.org Received: (qmail 4666 invoked by uid 99); 12 Jun 2014 17:52:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jun 2014 17:52:27 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_QUOTING X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [129.79.1.194] (HELO hartman.uits.indiana.edu) (129.79.1.194) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jun 2014 17:52:21 +0000 X-IronPort-AV: E=Sophos;i="5.01,466,1400040000"; d="scan'208,217";a="147203208" Received: from mssg-relay.indiana.edu ([129.79.1.73]) by irpt-internal-relay.indiana.edu with ESMTP; 12 Jun 2014 13:51:57 -0400 Received: from iu-mssg-hub101.ads.iu.edu (iu-mssg-hub101.ads.iu.edu [10.79.1.150]) by mssg-relay.indiana.edu (8.14.7/8.14.4/IU Messaging Team) with ESMTP id s5CHpuwj029853 for ; Thu, 12 Jun 2014 13:51:56 -0400 Received: from IU-MSSG-MBX101.ads.iu.edu ([169.254.1.3]) by iu-mssg-hub101.ads.iu.edu ([10.79.1.150]) with mapi id 14.03.0174.001; Thu, 12 Jun 2014 13:51:55 -0400 From: "Reagan, David Michael" To: "dev@airavata.apache.org" Subject: RE: [GSoC] Passing a json string as input to an applciation in PHP-SDK Thread-Topic: [GSoC] Passing a json string as input to an applciation in PHP-SDK Thread-Index: AQHPhlcYIQlSicCjKEe3aFnmzWIPLJtt5NOA///bWeA= Date: Thu, 12 Jun 2014 17:51:55 +0000 Message-ID: <5EB668D9BBF71F46B657363C67832BB31A8ADAC9@IU-MSSG-MBX101.ads.iu.edu> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [156.56.179.229] Content-Type: multipart/alternative; boundary="_000_5EB668D9BBF71F46B657363C67832BB31A8ADAC9IUMSSGMBX101ads_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_5EB668D9BBF71F46B657363C67832BB31A8ADAC9IUMSSGMBX101ads_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Do you think the quotes are the problem? If so, you can try formatting it l= ike this: $json =3D '{"input1":"0", "input2":"1", ...' In PHP you can nest "" inside '' without having to escape the characters. Dave From: Nadeem Anjum [mailto:nadeem.cs.iit@gmail.com] Sent: Thursday, June 12, 2014 11:59 AM To: dev@airavata.apache.org Subject: Re: [GSoC] Passing a json string as input to an applciation in PHP= -SDK Correction: $json has value: "{\"input1\":\"0\",\"input2\":\"1\",\"input3\":\"on\",\"_logon\":\"\",\"_pr= oject\":\"\",\"_uuid\":\"c9894860-f236-11e3-8708-19a98ecc24ae\",\"_base_dir= ectory\":\"/var/www/html/nadeemtest/results/5399ad3f791f5\",\"_udphost\":nu= ll,\"_udpport\":37779,\"resourcedefault\":\"local\"}" On Thu, Jun 12, 2014 at 5:57 PM, Nadeem Anjum > wrote: Hello Everyone, I have registered an application (A Genapp Module) which takes a json strin= g as input. I am using PHP client samples', createExperiment Method I use the follopwing code: $input->value =3D $json; where $json has value "{\"input1\\":\\"0\\",\\"input2\\":\\"1\\",\\"input3\\":\\"on\\",\\"_logon\= \":\\"\\",\\"_project\\":\\"\\",\\"_uuid\\":\\"c9894860-f236-11e3-8708-19a9= 8ecc24ae\\",\\"_base_directory\\":\\"/var/www/html/nadeemtest/results/5399a= d3f791f5\\",\\"_udphost\\":null,\\"_udpport\\":37779,\\"resourcedefault\\":= \\"local\\"}"; However, the in response received, $input->value gets changed to "{"input1":"0","input2":"1","input3":"on","_logon":"","_project":"","_uuid= ":"c9894860-f236-11e3-8708-19a98ecc24ae","_base_directory":"/var/www/html/n= adeemtest/results/5399ad3f791f5","_udphost":null,"_udpport":37779,"resource= default":"local"}" which being malformed, does not give me the expected output. The response is given below: object(Airavata\Model\Workspace\Experiment\Experiment)#12 (18) { ["experimentID"]=3D> string(21) "DO_NOT_SET_AT_CLIENTS" ["projectID"]=3D> string(42) "align_16b50043-1f92-491a-a276-d658e8b2018b" ["creationTime"]=3D> NULL ["userName"]=3D> string(6) "nadeem" ["name"]=3D> string(4) "exp1" ["description"]=3D> NULL ["applicationId"]=3D> string(5) "align" ["applicationVersion"]=3D> NULL ["workflowTemplateId"]=3D> NULL ["workflowTemplateVersion"]=3D> NULL ["userConfigurationData"]=3D> NULL ["workflowExecutionInstanceId"]=3D> NULL ["experimentInputs"]=3D> array(1) { [0]=3D> object(Airavata\Model\Workspace\Experiment\DataObjectType)#9 (4) { ["key"]=3D> string(3) "inp" ["value"]=3D> string(240) "{"input1":"0","input2":"1","input3":"on","_logon":"","_p= roject":"","_uuid":"c9894860-f236-11e3-8708-19a98ecc24ae","_base_directory"= :"/var/www/html/nadeemtest/results/5399ad3f791f5","_udphost":null,"_udpport= ":37779,"resourcedefault":"local"}" ["type"]=3D> int(0) ["metaData"]=3D> NULL } } ["experimentOutputs"]=3D> array(1) { [0]=3D> object(Airavata\Model\Workspace\Experiment\DataObjectType)#11 (4) { ["key"]=3D> string(3) "out" ["value"]=3D> string(0) "" ["type"]=3D> int(0) ["metaData"]=3D> NULL } } ["experimentStatus"]=3D> NULL ["stateChangeList"]=3D> NULL ["workflowNodeDetailsList"]=3D> NULL ["errors"]=3D> NULL } Any ideas on how to deal with this situation will be appreciated. Thanks, Nadeem --_000_5EB668D9BBF71F46B657363C67832BB31A8ADAC9IUMSSGMBX101ads_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Do you think the quotes a= re the problem? If so, you can try formatting it like this:

 <= /p>

$json =3D ‘{“= input1”:”0”, “input2”:”1”, …= ;’

 <= /p>

In PHP you can nest ̶= 0;” inside ‘’ without having to escape the characters.

 <= /p>

 <= /p>

Dave

 <= /p>

From: Nadeem= Anjum [mailto:nadeem.cs.iit@gmail.com]
Sent: Thursday, June 12, 2014 11:59 AM
To: dev@airavata.apache.org
Subject: Re: [GSoC] Passing a json string as input to an applciation= in PHP-SDK

 

Correction:

 

$json has value:

"{\"input1\":\"0\",\"i= nput2\":\"1\",\"input3\":\"on\",\"_= logon\":\"\",\"_project\":\"\",\"_u= uid\":\"c9894860-f236-11e3-8708-19a98ecc24ae\",\"_base_= directory\":\"/var/www/html/nadeemtest/results/5399ad3f791f5\&quo= t;,\"_udphost\":null,\"_udpport\":37779,\"resource= default\":\"local\"}"

 

On Thu, Jun 12, 2014 at 5:57 PM, Nadeem Anjum <nadeem.cs.iit@gm= ail.com> wrote:

Hello Everyone,

 

I have registered an application (A Genapp Module) w= hich takes a json string as input. I am using PHP client samples', createEx= periment Method

 

I use the follopwing code:

 

$input->value =3D $json;

 

where $json has value 

 

"{\"input1\\":\\"0\\",\\&qu= ot;input2\\":\\"1\\",\\"input3\\":\\"on\\&quo= t;,\\"_logon\\":\\"\\",\\"_project\\":\\"= ;\\",\\"_uuid\\":\\"c9894860-f236-11e3-8708-19a98ecc24a= e\\",\\"_base_directory\\":\\"/var/www/html/nadeemtest/= results/5399ad3f791f5\\",\\"_udphost\\":null,\\"_udppor= t\\":37779,\\"resourcedefault\\":\\"local\\"}"= ;;

 

However, the in response received, $input->value = gets changed to 

 

 "{"input1":"0","= input2":"1","input3":"on","_logon&q= uot;:"","_project":"","_uuid":"= ;c9894860-f236-11e3-8708-19a98ecc24ae","_base_directory":&qu= ot;/var/www/html/nadeemtest/results/5399ad3f791f5","_udphost"= ;:null,"_udpport":37779,"resourcedefault":"local&q= uot;}"

 

which being malformed, does not give me the expected= output.

 

The response is given below:

 

object(Airavata\Model\Workspace\Experiment\Experimen= t)#12 (18) {

  ["experimentID"]=3D><= /p>

  string(21) "DO_NOT_SET_AT_CLIENTS"<= o:p>

  ["projectID"]=3D>

  string(42) "align_16b50043-1f92-491a-a27= 6-d658e8b2018b"

  ["creationTime"]=3D><= /p>

  NULL

  ["userName"]=3D>

  string(6) "nadeem"

  ["name"]=3D>

  string(4) "exp1"

  ["description"]=3D>

  NULL

  ["applicationId"]=3D>=

  string(5) "align"

  ["applicationVersion"]=3D><= /o:p>

  NULL

  ["workflowTemplateId"]=3D><= /o:p>

  NULL

  ["workflowTemplateVersion"]=3D><= o:p>

  NULL

  ["userConfigurationData"]=3D>

  NULL

  ["workflowExecutionInstanceId"]=3D&= gt;

  NULL

  ["experimentInputs"]=3D>

  array(1) {

    [0]=3D>

    object(Airavata\Model\Workspace\Experi= ment\DataObjectType)#9 (4) {

      ["key"]=3D>

      string(3) "inp"<= /o:p>

      ["value"]=3D>=

      string(240) "{"input1= ":"0","input2":"1","input3":&q= uot;on","_logon":"","_project":"&qu= ot;,"_uuid":"c9894860-f236-11e3-8708-19a98ecc24ae",&quo= t;_base_directory":"/var/www/html/nadeemtest/results/5399ad3f791f= 5","_udphost":null,"_udpport":37779,"resource= default":"local"}"

      ["type"]=3D><= /o:p>

      int(0)

      ["metaData"]=3D>

      NULL

    }

  }

  ["experimentOutputs"]=3D>

  array(1) {

    [0]=3D>

    object(Airavata\Model\Workspace\Experi= ment\DataObjectType)#11 (4) {

      ["key"]=3D>

      string(3) "out"<= /o:p>

      ["value"]=3D>=

      string(0) ""

      ["type"]=3D><= /o:p>

      int(0)

      ["metaData"]=3D>

      NULL

    }

  }

  ["experimentStatus"]=3D>

  NULL

  ["stateChangeList"]=3D>

  NULL

  ["workflowNodeDetailsList"]=3D><= o:p>

  NULL

  ["errors"]=3D>

  NULL

}

 

 

Any ideas on how to deal with this situation will be= appreciated.

 

Thanks,

Nadeem

 

--_000_5EB668D9BBF71F46B657363C67832BB31A8ADAC9IUMSSGMBX101ads_--