Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i am sending byte[] (image) through wcf to cosole app, and from console app to wcf, everything works well as long as the byte[] (image) is less than 20KB, but when it's bigger, it doesn't work when i try to save the image uploaded in console or form app and send it to wcf to save it in the DB

i receive: The remote server returned an error: NotFound" and debugger doesn't reach the save method in the wcf service

how to send byte array more tha 20kb to wcf service..what are the changes i have to make in Web config file?

Urgently required..

My config file is as below:

I have kept tags as below in config file


httpRuntime maxRequestLength="2097151" useFullyQualifiedRedirectUrl="true" executionTimeout="14400"

binding name="TransferService" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" transferMode="Buffered"

readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"

requestLimits maxAllowedContentLength="2000000000"
Posted
Updated 12-Apr-12 4:50am
v2
Comments
S@53K^S 12-Apr-12 10:59am    
Did you try changing the both on the service side as well as the client side and increase the time out limits?If your still having problems after all tht then try splitting the data to allowable limits and then stream and reassemble the chunks on the service side
Patha Ashish 12-Apr-12 11:02am    
ya i have tried increasing the time out but did not worked..........i am trying to upload 1mb file at present but still did not work...

hi patha,

try like below this in XML ....
in httpRuntime tag...


{ <httpruntime>
maxRequestLength="2097151" //in bytes
useFullyQualifiedRedirectUrl="true"
executionTimeout="14400" />
}
 
Share this answer
 
Comments
Patha Ashish 12-Apr-12 10:43am    
That did not worked...getting same error..
modify 'MessageSize' value in .config file,
the unit of 'MessageSize' is byte,so if you want to send byte[] bigger than 20KB,
ensure that the value of 'MessageSize' is bigger than 20480.
 
Share this answer
 
Comments
Patha Ashish 12-Apr-12 10:47am    
i have already kept in my config file........still not working...
 
Share this answer
 
Comments
Patha Ashish 12-Apr-12 11:00am    
I have already seen thia earlier..but did not worked
The problem was solved for me upto 250mb ..but to transfer more than it ...what to do?..........
I have removed the trnsfer mode it worked for me...........
 
Share this answer
 
Comments
baskiramadoss 9-Oct-15 6:12am    
Hi Patha,

I have same problem could you please send the soln

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900