prevent web reference from generating object

Hi All,

I need to consume a 3rd party web service. However when adding a web reference to said web service the proxy service that is generated interprests the responses send by the web service in an inconsistant way.

What I would like to do is simply work with the xml responses directly rather than having auto generated code create objects for me that are in essence in an invalid state. And even if I was able to get objects in a valid state then I still would rather work directly with the xml response.

Can someone please help me acheive doing just this?

Kind regards
LVL 2
DaFouAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
You cannot use a web service without a proxy. there is no way around it.
0
alexey_gusevCommented:
well, the previous post (#35308853) is a bit wrong I must say :)

in the worst case you could work at HTTP level with HttpWebRequest thus dealing with all SOAP attributes manually (ie creating all required nodes and attributes for SOAP payload, like envelopes etc etc). Such approach worked for me even with C++ in the early days of Windows Mobile without any support for soap at all. this is not the easiest way, but it works 100% with full control on your side. Here's some example: http://mikehadlow.blogspot.com/2006/05/making-raw-web-service-calls-with.html

you might try to edit generated proxy class (moving it to the other place to avoid overriding).
0
DaFouAuthor Commented:
Dear alexey_gusev,

Can you please teach me where the proxy classes are (hidden)located that are responsible for the sending ( after serialisation ) and the receiving ( deserialisation ) of the transports for the different methods exposed by the web service.

Also what is your opinion about this out of the box demand for deserialised responses? Whats wrong with plain old string that can be ( if needed ) parsed into an xml document for quering.

Kind Regards
0
alexey_gusevCommented:
usually all web refs proxies are generated in "Web References" subfolder of your project. the each reference is stored under separate folder (by it's name) - so you finally want Reference.cs file.

if you look inside, you'll see your ws proxy inherits from System.Web.Services.Protocols.SoapHttpClientProtocol and also many serialisation attributes.

re. string vs objects - it all depends on the ws, so if it returns xml string then be it, but if not, then that's where serialisation/deserialisation takes place. I'd avoid messing up with serialisation for complex objects, but simple types are fine.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.