set Response to client from SOAP Envelope
I have a WCF client with a custom behavior that intercepts the SOAP request. In BeforeSendRequest in the client I get the SOAP request and pass it to another WS as parameter. The other WS posts the SOAP envelope to the real service that client wants to invoke and returns the SOAP Response back to client. So in BeforeSendRequest the intermediary service returns the real SOAP response as a string back开发者_如何学C to client.
public object BeforeSendRequest(ref System.ServiceModel.Channels.Message request, IClientChannel channel)
{
string soapResponse = myotherProxy.CallService(request.ToString());
return null;
}
How can i set the returned SOAP response (soapResponse) as the real response in the client?
Hope someone can help :)
Thank you, Adrya
You could save 'soapResponse' to a member variable of the inspector and set it back in afterReceiveReply.
But why are you faking the call to the service at all? Couldn't you just call the other service And not have to do the inspector trickery?
精彩评论