Skip to main content
Solved

httpcaller json payload too large, how to send one at a time from json file?


Forum|alt.badge.img

I have a workspace that creates an ESRIJSON file of features. The problem is I have 90 to upload but any more than 2 features causes a http 414 uri too long return from the destination server with a POST request.

Any ideas on how to send 1 feature at a time? I tried WorkspaceRunner which processes one at a time but I need to write the json file from the incoming feature each time and I can't figure that out as yet.

 

 

Best answer by david_r

You were very close, you just need to remove the features from the query string (=URI) and put the contents of the featureSet attribute in the "Upload body":

 

You'll probably also want to set the content type to "application/json".

View original
Did this help you find an answer to your question?

8 replies

nielsgerrits
VIP
Forum|alt.badge.img+54

If you use a FeatureWriter and a FeatureReader you can easily write a json for each feature and read them back in for further processing. If you add a TempPathnameCreator you don't have to clean up files.

WriteRead(2019_1_2).fmwt


david_r
Celebrity
  • January 30, 2020

Based on the error message it sounds like the JSON is sent as part of the URL rather than in the message body.

Can you please post a screenshot of how the HTTPCaller has been configured?


nielsgerrits
VIP
Forum|alt.badge.img+54
david_r wrote:

Based on the error message it sounds like the JSON is sent as part of the URL rather than in the message body.

Can you please post a screenshot of how the HTTPCaller has been configured?

I second this. You should put the json in the body, not in the URI.


Forum|alt.badge.img
  • Author
  • January 30, 2020
david_r wrote:

Based on the error message it sounds like the JSON is sent as part of the URL rather than in the message body.

Can you please post a screenshot of how the HTTPCaller has been configured?

Configuration


Forum|alt.badge.img
  • Author
  • January 31, 2020
david_r wrote:

Based on the error message it sounds like the JSON is sent as part of the URL rather than in the message body.

Can you please post a screenshot of how the HTTPCaller has been configured?

Ok, so this works as captured in Fiddler but I don't know how to get that in the upload body for httpcaller


david_r
Celebrity
  • Best Answer
  • January 31, 2020

You were very close, you just need to remove the features from the query string (=URI) and put the contents of the featureSet attribute in the "Upload body":

 

You'll probably also want to set the content type to "application/json".


Forum|alt.badge.img
  • Author
  • February 2, 2020
david_r wrote:

You were very close, you just need to remove the features from the query string (=URI) and put the contents of the featureSet attribute in the "Upload body":

 

You'll probably also want to set the content type to "application/json".

I tried that but leaving the features in the params but moving the featureSet into Upload Body with application/json results in {"error":{"code":500,"message":"Unable to complete operation.","details":["Parser error: Some parameters could not be recognized."]}}

I suspect that the features param name as well as payload needs to be included in the upload body but can't seem to find the correct json example structure for this.


nielsgerrits
VIP
Forum|alt.badge.img+54
tfsrichard wrote:

I tried that but leaving the features in the params but moving the featureSet into Upload Body with application/json results in {"error":{"code":500,"message":"Unable to complete operation.","details":["Parser error: Some parameters could not be recognized."]}}

I suspect that the features param name as well as payload needs to be included in the upload body but can't seem to find the correct json example structure for this.

For me it works with content-type set to application/x-www-form-urlencoded.

0684Q00000ArNBJQA3.png

I create "body" with an AttributeCreator using:

f=pjson&features=@Value(Features)&token=@Value(Token)

I create "Features" by Writing to Esri-JSON, reading back in as JSON (JavaScript Object Notation), Expose RecordSet, Extract json["features"].

0684Q00000ArNBEQA3.png

But I admit, compared to a lot the default writers, it can be tough to get writing to arcgis server via the api working.

addFeatures2019_1_2.fmwt


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings