you are right. The problem is caused by impossibility to cast Rebex class
HttpRequest into system class
HttpWebRequest class on .NET CF has no public or protected constructor, so we cannot derive from it. We can derive only from
HttpChannelFactory class is written in a way it can use
HttpWebRequest class only.
We are not familiar with WCF, but I used to create some Web References. There you get a partial class XyzService, which inherits from
System.Web.Services.Protocols.SoapHttpClientProtocol. Using partial keyword, you can simply reimplement some functionality which remains unchanged even when you recreate the web reference.
Try to look at some way to reimplement
RequestChannel.Request or inject your implementation of
HttpChannelFactory which doesn't require
HttpWebRequest class only or something similar.
For example in my VB.NET project I do similar this way:
Partial Public Class MyService
Protected Overrides Function GetWriterForMessage(message As SoapClientMessage, bufferSize As Integer) As XmlWriter
' inject code for signing the request here
Return New SigningXmlTextWriter(MyBase.GetWriterForMessage(message, bufferSize))
SigningXmlTextWriter class to sign the SOAP request message with an X509 certificate.
If you send us your project at firstname.lastname@example.org (so we can reproduce the issue) we will look at it and hopefully find a solution to solve this issue.