LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Web service in LV2013: Change answer for "Bad Request", "Access Error"...

Hi there,

 

I am building a large application in LabVIEW 2013. I use a Web Service Server in LabVIEW to communicate to other systems. All in all the new Web Service functions in LV2013 work pretty fine and Web Services are easy to implement. In case any Web Service is unknown or parameters (in the URL) are wrong, it returnsto the client a default error message (like: "Access Error: 404 -- Not Found" or "Access Error: 400 -- Bad Request"). Is there a possibility to change this default messages and its format (all answers in my application are in JSON, but errors appear in HTML)? I really need this feature.

 

I spent a lot of time in the internet for finding an answer - but it seems that I am the first who need this feature. Thank you very much for any ideas.

Download All
0 Kudos
Message 1 of 3
(2,689 Views)

Hey there,

 

Did you ever figure this out? I'm trying to send a buffer JSON string over HTTP Post and continually get a 400 Bad Request error. I'm using the i3 JSON library which has no documentation at all. I was hoping you had some luck with this.

 

Andy

 

0 Kudos
Message 2 of 3
(2,486 Views)

Hi Andy,

 

I found a workaround: I added some additional resources using a link "http://localhost:8079/"NAME"/:x/:x/:x/:x/:x/:x/:x/:x/:x/:x/:x/:x/:x/:x/:x/:x" for each type (PUT, GET, POST, DELETE) where I handle the error message with the "Set HTTP Response Code VI"

0 Kudos
Message 3 of 3
(2,466 Views)