在AfterReceiveRequest方法中是否有任何方法可以找到requst类型(httprequest或Soap reqest)?
public object AfterReceiveRequest(ref System.ServiceModel.Channels.Message request, System.ServiceModel.IClientChannel channel, System.ServiceModel.InstanceContext instanceContext)
{
//get request type
}
答案 0 :(得分:0)
我自己没有这样做,但由于没有人给出答案,我建议尝试这样做:
而不是(或除了)实现IDispatchMessageInspector
,实现IServiceBehavior
并检查Validate
方法中的URI方案:
public void Validate(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
{
foreach (ServiceEndpoint item in serviceDescription.Endpoints)
{
string theScheme = item.Binding.Scheme;
}
}