Click here to Skip to main content
15,867,780 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to set HttpStatusCode to 301 for a wcf soap response. It is working when trying to set other status like HttpStatusCode.MethodNotAllowed. But not working with HttpStatusCode.MovedPermanently and im seeing 200 StatusCode. How can I modify StatusCode to 301.
C#
HttpResponseMessageProperty responseProperty; 

if (reply.Properties.ContainsKey(HttpResponseMessageProperty.Name) == false)
 { responseProperty = new HttpResponseMessageProperty(); 
reply.Properties.Add(HttpResponseMessageProperty.Name, responseProperty);
 } 
else
 {
 responseProperty = (HttpResponseMessageProperty)reply.Properties[HttpResponseMessageProperty.Name];
  }

 responseProperty .StatusCode = HttpStatusCode.MethodNotAllowed;
Posted
Updated 17-Sep-14 7:57am
v2

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