2017-01-20 12 views
0

Appcelerator TitaniumのHTTPClientに問題があります。私はこの応答で取得HTTPClientのチタンの代わりにチタンのHTTPClientが完全な応答を返さない

{ 
    "nlmDisclaimer":"It is not the intention of NLM to provide specific medical advice, but rather to provide users with information to better understand their health and their medications. NLM urges you to consult with a qualified physician for advice about medications.", 
    "userInput":{ 
     "sources":[ 
     "" 
     ], 
     "rxcuis":[ 
     "5640", 
     "53694" 
     ] 
    }, 
    "fullInteractionTypeGroup":[ 
     { 
     "sourceDisclaimer":"DrugBank is intended for educational and scientific research purposes only and you expressly acknowledge and agree that use of DrugBank is at your sole risk. The accuracy of DrugBank information is not guaranteed and reliance on DrugBank shall be at your sole risk. DrugBank is not intended as a substitute for professional medical advice, diagnosis or treatment..[www.drugbank.ca]", 
     "sourceName":"DrugBank", 
     "fullInteractionType":[ 
      { 
       "comment":"Drug1 (rxcui = 53694, name = nimesulide, tty = IN). Drug2 (rxcui = 5640, name = Ibuprofen, tty = IN). Drug1 is resolved to nimesulide, Drug2 is resolved to Ibuprofen and interaction asserted in DrugBank between Nimesulide and Ibuprofen.", 
       "minConcept":[ 
        { 
        "rxcui":"53694", 
        "name":"nimesulide", 
        "tty":"IN" 
        }, 
        { 
        "rxcui":"5640", 
        "name":"Ibuprofen", 
        "tty":"IN" 
        } 
       ], 
       "interactionPair":[ 
        { 
        "interactionConcept":[ 
         { 
          "minConceptItem":{ 
           "rxcui":"53694", 
           "name":"nimesulide", 
           "tty":"IN" 
          }, 
          "sourceConceptItem":{ 
           "id":"DB04743", 
           "name":"Nimesulide", 
           "url":"http://www.drugbank.ca/drugs/DB04743#interactions" 
          } 
         }, 
         { 
          "minConceptItem":{ 
           "rxcui":"5640", 
           "name":"Ibuprofen", 
           "tty":"IN" 
          }, 
          "sourceConceptItem":{ 
           "id":"DB01050", 
           "name":"Ibuprofen", 
           "url":"http://www.drugbank.ca/drugs/DB01050#interactions" 
          } 
         } 
        ], 
        "severity":"N/A", 
        "description":"The risk or severity of adverse effects can be increased when Ibuprofen is combined with Nimesulide." 
        } 
       ] 
      } 
     ] 
     } 
    ] 
} 

https://rxnav.nlm.nih.gov/REST/interaction/list.json?rxcuis=5640+53694 

それは、このような応答を返す必要があります: 私は次のエンドポイントへのGETリクエストのためにそれを使用しています

{ 
    "nlmDisclaimer":"It is not the intention of NLM to provide specific medical advice, but rather to provide users with information to better understand their health and their medications. NLM urges you to consult with a qualified physician for advice about medications.", 
    "userInput":{ 
     "sources":[ 
     "" 
     ], 
     "rxcuis":[ 
     "5640+53694" 
     ] 
    } 
} 

要求を行うためのコードは次のとおりです

私はjsonの代わりにxmlを返そうとしましたが、それは同じことです。応答の最初の部分だけが返されます。どのようにこれを修正するための手掛かり?

答えて

0

私はちょうどあなたのコードを実行し、私のために正常に動作しているようだ:

[INFO] {"nlmDisclaimer":"It is not the intention of NLM to provide specific medical advice, but rather to provide users with information to better understand their health and their medications. NLM urges you to consult with a qualified physician for advice about medications.","userInput":{"sources":[""],"rxcuis":["5640","53694"]},"fullInteractionTypeGroup":[{"sourceDisclaimer":"DrugBank is intended for educational and scientific research purposes only and you expressly acknowledge and agree that use of DrugBank is at your sole risk. The accuracy of DrugBank information is not guaranteed and reliance on DrugBank shall be at your sole risk. DrugBank is not intended as a substitute for professional medical advice, diagnosis or treatment..[www.drugbank.ca]","sourceName":"DrugBank","fullInteractionType":[{"comment":"Drug1 (rxcui = 53694, name = nimesulide, tty = IN). Drug2 (rxcui = 5640, name = Ibuprofen, tty = IN). Drug1 is resolved to nimesulide, Drug2 is resolved to Ibuprofen and interaction asserted in DrugBank between Nimesulide and Ibuprofen.","minConcept":[{"rxcui":"53694","name":"nimesulide","tty":"IN"},{"rxcui":"5640","name":"Ibuprofen","tty":"IN"}],"interactionPair":[{"interactionConcept":[{"minConceptItem":{"rxcui":"53694","name":"nimesulide","tty":"IN"},"sourceConceptItem":{"id":"DB04743","name":"Nimesulide","url":"http://www.drugbank.ca/drugs/DB04743#interactions"}},{"minConceptItem":{"rxcui":"5640","name":"Ibuprofen","tty":"IN"},"sourceConceptItem":{"id":"DB01050","name":"Ibuprofen","url":"http://www.drugbank.ca/drugs/DB01050#interactions"}}],"severity":"N/A","description":"The risk or severity of adverse effects can be increased when Ibuprofen is combined with Nimesulide."}]}]}]} 

iOSアプリのTI SDK 6.0.1.GAを使用します。

Androidでこれを実行している場合、文字数の制限があるため、logcatがログを切断する可能性があります。そのキーを元に戻すことを確認するには、console.log(json.fullInteractionTypeGroup)を印刷してみてください。私は5.2.0を使用しています

問題が解決しない場合は、あなたの質問は、あなたのSDKのバージョン、合金のバージョン、プロジェクトのターゲットで更新など

+0

は、問題になるだろうか?そして、はい、私はjsonからすべてを記録しようとしました。今のところ私はチタンクライアントに完全な応答を返す別のカスタムWebサービスを使用して解決しました。 – revy

+0

それからウェブサービスで何かが起こっているかもしれません。 SDK 6.0.1を試すか、iOSでアプリを実行できますか? –

関連する問題