Quantcast
Channel: Last Activity on Talend Community Forum
Viewing all articles
Browse latest Browse all 2654

tREST with POST method in JSON format throwing error. - by nikhila.kommireddy

$
0
0

Hello Everyone, I am new to Talend and web services. I need your help on this. the version of Talend that I have is Talend Open Studio for Big Data(Version: 6.1.0). I am trying to connect to an external web service to fetch data. I have used tREST component for the workflow. Method is : [color=#ff3333]POST[/color] HTTP Headers: [color=red][size=2][font='MS Shell Dlg 2', sans-serif]'Content-Type'[/font][/size][/color][color=blue][size=2][font='MS Shell Dlg 2', sans-serif],[/font][/size][/color] [color=red][size=2][font='MS Shell Dlg 2', sans-serif]'application/json'[/font][/size][/color] [color=red][size=2][font='MS Shell Dlg 2', sans-serif]                          'Accept'[/font][/size][/color][color=blue][size=2][font='MS Shell Dlg 2', sans-serif],[/font][/size][/color] [color=red][size=2][font='MS Shell Dlg 2', sans-serif]'application/json'[/font][/size][/color] [color=#1f497d]                    [/color][color=red][size=2][font='MS Shell Dlg 2', sans-serif]'Transfer-Encoding'[/font][/size][/color][color=blue][size=2][font='MS Shell Dlg 2', sans-serif],[/font][/size][/color] [color=red][size=2][font='MS Shell Dlg 2', sans-serif]'chunked'[/font][/size][/color] HTTP Body :[color=#ff0000][font=MS Shell Dlg 2, sans-serif][size=2] [/size][/font][/color][color=#ff0000][font=MS Shell Dlg 2, sans-serif][size=2]{[/size][/font][/color] [color=#ff0000][font=MS Shell Dlg 2, sans-serif][size=2]  "authDetails": {[/size][/font][/color] [color=#ff0000][font=MS Shell Dlg 2, sans-serif][size=2]    "memberId": "mid",[/size][/font][/color] [color=#ff0000][font=MS Shell Dlg 2, sans-serif][size=2]    "userId": "uid",[/size][/font][/color] [color=#ff0000][font=MS Shell Dlg 2, sans-serif][size=2]    "sessionKey": "sKey",[/size][/font][/color] [color=#ff0000][font=MS Shell Dlg 2, sans-serif][size=2]    "role": "Pittch"[/size][/font][/color] [color=#ff0000][font=MS Shell Dlg 2, sans-serif][size=2]                  },[/size][/font][/color] [color=#ff0000][font=MS Shell Dlg 2, sans-serif][size=2]  "resId": "201503271601FLYWALL_USEQUITY_424",[/size][/font][/color] [color=#ff0000][font=MS Shell Dlg 2, sans-serif][size=2]  "showChain": true,[/size][/font][/color] [color=#ff0000][font=MS Shell Dlg 2, sans-serif][size=2]  "getWirename": false,[/size][/font][/color] [color=#ff0000][font=MS Shell Dlg 2, sans-serif][size=2]  "getPhotoInfo": false[/size][/font][/color] [color=#ff0000][font=MS Shell Dlg 2, sans-serif][size=2]}[/size][/font][/color] When I check the code it is giving me the following error message. [color=#ff3366]Error code: [/color] [color=#ff3366]Exception in thread "main" java.lang.Error: Unresolved compilation problem: [/color] [color=#ff3366]                Invalid character constant[/color] [color=#ff3366] [/color][color=#ff3366]                at big_data.trest_0_1.tREST.tREST_1Process(tREST.java:562)[/color] [color=#ff3366]                at big_data.trest_0_1.tREST.runJobInTOS(tREST.java:991)[/color] [color=#ff3366]                at big_data.trest_0_1.tREST.main(tREST.java:848)[/color] [color=black][size=2][font=Calibri, sans-serif]The code block that is throwing the error is[/font][/size][/color] [color=black][size=2][font=Consolas]com.sun.jersey.api.client.ClientResponse errorResponse_tREST_1 = [/font][/size][/color][color=#7f0055][size=2][font=Consolas]null[/font][/size][/color][color=black][size=2][font=Consolas];[/font][/size][/color] [color=black][size=2][font=Consolas]       String restResponse_tREST_1 = [/font][/size][/color][color=#2a00ff][size=2][font=Consolas]""[/font][/size][/color][color=black][size=2][font=Consolas];[/font][/size][/color] [color=black][size=2][font=Consolas]       [/font][/size][/color][color=#7f0055][size=2][font=Consolas]try[/font][/size][/color][color=black][size=2][font=Consolas]{[/font][/size][/color] [color=black][size=2][font=Consolas]             [/font][/size][/color][color=black][size=2][font=Consolas]restResponse_tREST_1 = [/font][/size][/color][u][color=black][size=2][font=Consolas]restResource_tREST_1[/font][/size][/color][/u] [u][color=black][size=2][font=Consolas]              [/font][/size][/color][/u] [u][color=black][size=2][font=Consolas]              .header([/font][/size][/color][/u][u][color=#2a00ff][size=2][font=Consolas]"content-type"[/font][/size][/color][/u][u][color=black][size=2][font=Consolas],[/font][/size][/color][/u][u][color=#2a00ff][size=2][font=Consolas]"application/json"[/font][/size][/color][/u][u][color=black][size=2][font=Consolas])[/font][/size][/color][/u] [u][color=black][size=2][font=Consolas]              [/font][/size][/color][/u] [u][color=black][size=2][font=Consolas]              .header([/font][/size][/color][/u][u][color=#2a00ff][size=2][font=Consolas]"accept"[/font][/size][/color][/u][u][color=black][size=2][font=Consolas],[/font][/size][/color][/u][u][color=#2a00ff][size=2][font=Consolas]"application/json"[/font][/size][/color][/u][u][color=black][size=2][font=Consolas])[/font][/size][/color][/u] [u][color=black][size=2][font=Consolas]                [/font][/size][/color][/u] [u][color=black][size=2][font=Consolas]              [/font][/size][/color][/u] [u][color=black][size=2][font=Consolas]                     .post(String.[/font][/size][/color][/u][u][color=#7f0055][size=2][font=Consolas]class[/font][/size][/color][/u][u][color=black][size=2][font=Consolas],{    [/font][/size][/color][/u][u][color=#2a00ff][size=2][font=Consolas]"authDetails"[/font][/size][/color][/u][u][color=black][size=2][font=Consolas]:     {      [/font][/size][/color][/u][u][color=#2a00ff][size=2][font=Consolas]"memberId"[/font][/size][/color][/u][u][color=black][size=2][font=Consolas]: [/font][/size][/color][/u][u][color=#2a00ff][size=2][font=Consolas]"mid"[/font][/size][/color][/u][u][color=black][size=2][font=Consolas],      [/font][/size][/color][/u][u][color=#2a00ff][size=2][font=Consolas]"userId"[/font][/size][/color][/u][u][color=black][size=2][font=Consolas]: [/font][/size][/color][/u][u][color=#2a00ff][size=2][font=Consolas]"uid"[/font][/size][/color][/u][u][color=black][size=2][font=Consolas],      [/font][/size][/color][/u][u][color=#2a00ff][size=2][font=Consolas]"sessionKey"[/font][/size][/color][/u][u][color=black][size=2][font=Consolas]: [/font][/size][/color][/u][u][color=#2a00ff][size=2][font=Consolas]"sKey"[/font][/size][/color][/u][u][color=black][size=2][font=Consolas],      [/font][/size][/color][/u][u][color=#2a00ff][size=2][font=Consolas]"role"[/font][/size][/color][/u][u][color=black][size=2][font=Consolas]: [/font][/size][/color][/u][u][color=#2a00ff][size=2][font=Consolas]"Pittch"[/font][/size][/color][/u][u][color=black][size=2][font=Consolas]    },    [/font][/size][/color][/u][u][color=#2a00ff][size=2][font=Consolas]"resId"[/font][/size][/color][/u][u][color=black][size=2][font=Consolas]: [/font][/size][/color][/u][u][color=#2a00ff][size=2][font=Consolas]"201503271601FLYWALL_USEQUITY_424"[/font][/size][/color][/u][u][color=black][size=2][font=Consolas],    [/font][/size][/color][/u][u][color=#2a00ff][size=2][font=Consolas]"showChain"[/font][/size][/color][/u][u][color=black][size=2][font=Consolas]: [/font][/size][/color][/u][u][color=#7f0055][size=2][font=Consolas]true[/font][/size][/color][/u][u][color=black][size=2][font=Consolas],    [/font][/size][/color][/u][u][color=#2a00ff][size=2][font=Consolas]"getWirename"[/font][/size][/color][/u][u][color=black][size=2][font=Consolas]: [/font][/size][/color][/u][u][color=#7f0055][size=2][font=Consolas]false[/font][/size][/color][/u][u][color=black][size=2][font=Consolas],    [/font][/size][/color][/u][u][color=#2a00ff][size=2][font=Consolas]"getPhotoInfo"[/font][/size][/color][/u][u][color=black][size=2][font=Consolas]: [/font][/size][/color][/u][u][color=#7f0055][size=2][font=Consolas]false[/font][/size][/color][/u][u][color=black][size=2][font=Consolas]  })[/font][/size][/color][/u][color=black][size=2][font=Consolas];[/font][/size][/color] [color=black][size=2][font=Consolas]              [/font][/size][/color] [color=black][size=2][font=Consolas]       }[/font][/size][/color][color=#7f0055][size=2][font=Consolas]catch[/font][/size][/color][color=black][size=2][font=Consolas] (com.sun.jersey.api.client.UniformInterfaceException ue) {[/font][/size][/color] [color=black][size=2][font=Consolas]        errorResponse_tREST_1 = ue.getResponse();[/font][/size][/color] Can someone please help me in getting this resolved. Thanks for your help in advance. Nikki.


Viewing all articles
Browse latest Browse all 2654

Trending Articles