2017-04-10 10 views
0

私は.asmxウェブサービスとその方法を持っています。しかし、私はjsonを返すのか分からない。Webサービスがjsonまたはxmlを返しますか?

Jsonとして返されますか?

<string xmlns="http://tempuri.org/"> 
{ "Table": [ { "Key1": "x", "Key2": "x", "Key3": "Ads" } ], "Key4": [ { "Key41": "30", "Key42": "12", "Key43": "1" } ], "Key5": [ { "Key51": "10.4.2017 00:00:00" } ] } 
</string> 

だから、方法結果ページには、上部にあるテキストと書いている:

This XML file does not appear to have any style information associated with it. The document tree is shown below. 

私は、JSONとしてこのデータを取得することはできますか?

答えて

0

は、この1

$cont_data = array("Table"=>array("Key1"=> "x", 
 
      "Key2"=> "x", 
 
      "Key3"=> "Ads" 
 
     ), 
 
     "Key4"=>array( 
 
        "Key41"=> "30", 
 
        "Key42"=> "12", 
 
        "Key43"=> "1" 
 
      ), 
 
     "Key5"=>array( 
 
       "Key51"=>"10.4.2017 00:00:00" 
 
      ) 
 
); 
 
    
 
    return json_encode($cont_data);

あなたはJSONとして結果を得ることができますjson_decodeを助けるかもしれない()がこれを行います。

+0

いいえタイプを返送します。 xmlかjsonか – ymymym

+0

答えが更新されました。 –

関連する問題