I am getting error while trying to POSt data to servicenow instance using REST API (Table API)

Artemis15
Kilo Guru

I am using the same code to develop a program to post data to snow demo instance.

 

URL : http://wiki.servicenow.com/index.php?title=Table_API_Java_Examples#POST

 

I'm getting status 404 and stream closed error.

 

find_real_file.png

 

Please help me in this issue.

1 ACCEPTED SOLUTION

Artemis15
Kilo Guru

Thanks Kalaiarasan and Chandan for your valuable reply.



I found out the mistake in the code. It's because of a jar file which is accidentally closing the buffer before connecting to SNOW instance.


View solution in original post

15 REPLIES 15

Hi Akash,



what is Proxy Host & Port? Where will i get this Info ?



Regards,


Hima Pallela


that you need to get for your network admin.


Hi Akash,



i'm getting below error.



=========================================================


Apr 28, 2015 4:04:11 PM org.apache.commons.httpclient.HttpMethodDirector authenticateProxy


WARNING: Required proxy credentials not available for BASIC <any realm>@10.174.109.196:80


Apr 28, 2015 4:04:11 PM org.apache.commons.httpclient.HttpMethodDirector authenticateProxy


WARNING: Preemptive authentication requested but no default proxy credentials available


Apr 28, 2015 4:04:11 PM org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme


INFO: ntlm authentication scheme selected


Apr 28, 2015 4:04:11 PM org.apache.commons.httpclient.HttpMethodDirector processProxyAuthChallenge


INFO: No credentials available for NTLM <any realm>@10.174.109.196:80


Status:407


org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]


  at org.json.JSONTokener.syntaxError(JSONTokener.java:433)


  at org.json.JSONObject.<init>(JSONObject.java:188)


  at PostAction.postRequest(PostAction.java:68)


  at PostAction.main(PostAction.java:23)




=========================================================




any idea?




Regards,


Hima Pallela


Are you putting in your proxy credentials?


Hi Sumukh,



im passing Servicenow credentials



Regards,


Hima Pallela