Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
145 views
in Technique[技术] by (71.8m points)

.net - Get request length to fix "Maximum request length excedded"

I'm dealing with an issue on my .NET application. I'm calling a web service to interact with my DB. But I have a problem.

I'm sending XML content through a list on my web service. But as soon as I call it, it is immediatly stop due to the error. I tried to decrease list length. It worked for my 2 first lists but not the last one.

At the beginning, I had a list of 43k objects of a class. I realized it was too much for my web service.

' ListOfElements is a List(Of List(Of T))
Dim addedObject as New List(Of T)
For Each element As List(Of T) In ListOfElements
    ' ListOfElements contains 5 List(Of T)
    ' element contains 7.5k T object
    WS.InsertInDb(element, addedObject)
Next

So instead of it, I cut that list into sublist of 10k objects of a class. It was working but not anymore after the third call. I tried to decrease it to 7.5k, work until the forth call.

Do you know how I can get my request length to have a better understanding of what it is sent to my webservice.

Because one day, it was working, the day after, not anymore.

question from:https://stackoverflow.com/questions/65936078/get-request-length-to-fix-maximum-request-length-excedded

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

i found where the size exceeded.

On the second object sent to the WS (addedObject), I was creating a list of T inserted for my mail report. As much as this list was growing, I was increasing the request despite me.

Thanks for the clue


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...