471,122 Members | 884 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,122 software developers and data experts.

Override the Send/Receive on a web Service Proxy

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.
Jul 4 '07 #1
1 1770
"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]

Jul 4 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by arti | last post: by
5 posts views Thread by Bill Hauver | last post: by
2 posts views Thread by Jeff_Lav | last post: by
reply views Thread by John O'Neill | last post: by
1 post views Thread by Julio Delgado | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.