Jump to content

Web Service URL length limits, LV2013 vs LV2012


mjaspan

Recommended Posts

(* CROSS POST: http://forums.ni.com/t5/LabVIEW/Web-Service-URL-length-limits-LV2013-vs-LV2012/td-p/2957047   *)

(* I've moved the discussion to the NI forums to increase visibility. *)

(* Please do not reply here.*)

 

 

Has anyone noticed a reduction to the limit on URL length for Web Services between LV versions 2012 and 2013?

 

Under LV2012, a RESTful web service appears to accept URL with lengths at least as long as 4096 characters.  With LV2013, the max URL length appears to be 511 characters for both RESTful and Project Item web services. Unfortunately for me the project I just converted trips over this issue. My goal with posting this query to here is to improve my understanding of this limitation before I decide how best to modify my code.  Certainly using POST rather than GET with a long URL is an option, but again, I'm looking to understand the limitation change before I choose a solution.

 

To illustrate I have attached three mostly identical projects which demonstrate the issue.  In each case the project contains a webservice consisting of a single VI, "ComputeLength", which takes a String as an input parameter and which outputs the length of the string.  The three projects are as follows.

1. LV2012 RESTful web service.

2. LV2013 RESTful web service.

3. LV2013 Project item web service.

 

The web service contains a single VI.  For the RESTful examples, the web service is started by selecting Deploy from the Build specification right click menu.  For the Project Item example, the web service is started by selecting Start from the MyComputer/WebService right click menu. The use of this example is demonstrated with the following URL: 

(note that the port is 8080 for the two RESTful examples and is 8001 for the Project item web service if used in Debug mode, which is the default for the above instruction.)

 

http://localhost:8080/webservice/computelength?string=1234567890

 

And the output looks like this.

 
<Response>
<Terminal>
<Name>StringLength</Name>
<Value>10</Value>
</Terminal>
</Response>
 

To see the issue, extend the string parameter such that the URL contains more than 511 characters beyond the port number.  For example something like this, http://localhost:8080/webservice/computelength?string=1234567890123456789012345678901234567890.... 

 

For the LV2012 example the string parameter may be at least as long as 4000 characters, which I've demonstrated using Chrome as my browser.  For both of the LV2013 examples the URL is limited to 511 characters after the localhost and the port number.

 

Anyone know whether this is a bug or this is an intentional design change?  How about whether the URL length limit is configurable? 

 

I am also consulting NI tech support and will report back their response.

 

Any advice appreciated.

 

Thanks,

  Martin

 

(* Please direct replies to the NI forum link at the top of this post *)

 

EDIT: Cross post to NI

mywebservice.LV2012.RESTful.zip

mywebservice.LV2013.RESTful.zip

mywebservice.LV2013.ProjectItem.zip

Edited by mjaspan
Link to comment

Solution found.  Apparently starting in LV 2013, there is a default limit of 512 to the URL length.  The default limit may be overridden as described below.

 

Martin

 

 

This is Brian in Applications Engineering from National Instruments. I am following up regarding the 511 character limit in your Web Service HTTP request following the port number. After some research I've figured out that the issue is related to a default web server setting called "LimitUri," which limits the maximum length of a URL. The default setting is 512 characters which is why we are seeing this issue.

There are multiple ways of changing the URL length limit depending on how you are using your web service. If you are publishing the web service using the Application Web Server then modify "C:\Program Files (x86)\National Instruments\Shared\NI WebServer\NIWebAppServer.conf" and add "LimitUri 4096" to the end of the file without the quotes.

If you are running the Debug Web Server by just clicking start on the web service then modify "C:\Program Files (x86)\National Instruments\LabVIEW 2013\resource\webserver\niwsdebugserver.conf" and add "LimitUri 4096" to the end of the file without the quotes.

  • Like 2
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.