my wcfbinding is wshttpbind
A:
You can try to use this code in your operation:
MessageProperties properties = OperationContext.Current.IncommingMessageProperties;
var httpProperty = properties[HttpRequestMessageProperty.Name] as HttpRequestMessageProperty;
int length = Int32.Parse(httpProperty.Headers["Content-Length"]);
Edit:
Response length is not known till the response data are serialized and message is formatted. By the architecture this happens out of the service class itself. You can try to create custom MessageEncoder and get content length in overriden WriteMessage method.
Ladislav Mrnka
2010-09-15 11:20:01
thank you,but I want to get the response content-length
Raymond
2010-09-16 01:04:34