"Rui" <Ru*@discussions.microsoft.comwrote in message
news:61**********************************@microsof t.com...
Can I override the send and receive methods on a web service proxy?
I want to use the default proxy classes generated when I add a reference
to
a web service to create and read the SOAP messages when I call a method…
but,
I would like to replace the send and receive with my own code so I could
send
the Soap message to an EMS queue and get the response SOAP from another
queue
instead of calling the web service.
This is very complicated to do. Your proxy classes derive (ultimately) from
System.Web.Services.Protocols.WebClientProtocol. This class has a
GetWebRequest method. You could derive from this class (or one of its
descendants) and override this method to return a custom WebRequest object
of your own. You may also have to override GetWebResponse.
Of course, you'll also have to create your own custom WebRequest and
WebResponse classes. You'll also lose the ability to have WSDL.EXE and "Add
Web Reference" automatically generate your proxy classes, unless you go
through several more hoops.
--
John Saunders [MVP]