Sunday, August 2, 2009

WebSphere ESB Invalid Content Length

Well, turns out I was mistaken in my previous post. Invalid Content Length can occur when using MTOM in .net C# clients with WebSphere ESB, but that was not the case in our customer.
Invalid Content Length appeared when the client closes the socket before sending the entire request. This can happen when the process is halted during send time. WESB will sysout Invalid Content Length, but you can usually ignore it.

However, we still faced a problem with very large service calls (over 1MB in size - only XML, no attachments). Turns out that our synchronization code was messed up, and for some reason - our cache was not correctly initialized, and so we received allot of NPE (NullPointerExceptions).
So - we synched our cache, and voilla - all works.

That teaches me to blog before I see everything working in my own eyes.

One last important issue. Sending large service calls can take time. Allot of time. And so, each C# client has a Timeout property, that sets that Timeout for the service call, in milliseconds. Use it well, since you are very likely to get a Timeout exception before you get the web service response.

No comments:

Post a Comment