Hi guys,
Now i have a public Wcf REST service A, and several internal wcf services, each of internal services is identified by name. Is it possible to create a router/proxy in service A, and then, when the users request the interface of service A, it can redirect the request to the internal services based on name?
I tried using:
WebOperationContext.Current.OutgoingResponse.Location = targetInternalPath;
WebOperationContext.Current.OutgoingResponse.StatusCode = HttpStatusCode.Redirect; // or MovedPermanently
All works fine except the headers that we get on the client side, Here is the details from Fiddler:
Transport *Location*: http://locahost:9856/internalAddress/getimage
Content-type: null (It should be "image/png")
Content-Length: 0
In other words, the client knows the exact internal address, the content-type and content-length is incorrect. All are not what i want. I have been struggling with this issue for days, anybody has any idea?
Best Regards.
Johnny
i don't get your idea,
if you want to check content-type or context-length , you can validate input parameters in your coustom ServiceBehavior,
if you use url router , it is impossible client know your internal address by public address
wcf 4.0 RESTful service already support this feature.
BTW you can set httpStatusCode after validation.