By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,282 Members | 1,549 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,282 IT Pros & Developers. It's quick & easy.

abstracting a web service

P: n/a
Hi all,

I'm looking at the Amazon web services and get them to work fine. But on any
given call I want to be able to use either the US or the EU schemas which
are in the project as two different web references.
so basically I would like to be able to abstract the objects in each web
service so that I can instantiate either one and pass it to a handler which
can work with either.

Basically the same as you do for two objects inherited fromt he same parent
you can just have a function accept the parent and then cast it as
necessary.

Is there a way to do this with two (almost) exactly the same web services in
different references?

Thanks
Nev.
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Nev,

You should be able to do this, but it will require some work on your
part. Basically, you will have to dig into the auto-generated code for the
references (select "show all files" from the solution explorer") and from
there, you can refactor the code to provide an abstract base to the web
services.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"nevin" <nevin@[diespam]myself.com> wrote in message
news:40***********************@mercury.nildram.net ...
Hi all,

I'm looking at the Amazon web services and get them to work fine. But on any given call I want to be able to use either the US or the EU schemas which
are in the project as two different web references.
so basically I would like to be able to abstract the objects in each web
service so that I can instantiate either one and pass it to a handler which can work with either.

Basically the same as you do for two objects inherited fromt he same parent you can just have a function accept the parent and then cast it as
necessary.

Is there a way to do this with two (almost) exactly the same web services in different references?

Thanks
Nev.

Nov 16 '05 #2

P: n/a
Thanks Nicholas.

i've taken the lazy route and created an interface and put a wrapper around
each one inheriting from this interface. Means I have to double up the
implementation of each wrapper which is half of what I wanted to avoid but
at least i can push a single object cast as the interface through my
handlers.
If i get more time, I'll look into your solution as it may save me in the
long run (read maintenance).

Nev

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:eF**************@TK2MSFTNGP10.phx.gbl...
Nev,

You should be able to do this, but it will require some work on your
part. Basically, you will have to dig into the auto-generated code for the references (select "show all files" from the solution explorer") and from
there, you can refactor the code to provide an abstract base to the web
services.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"nevin" <nevin@[diespam]myself.com> wrote in message
news:40***********************@mercury.nildram.net ...
Hi all,

I'm looking at the Amazon web services and get them to work fine. But on any
given call I want to be able to use either the US or the EU schemas which are in the project as two different web references.
so basically I would like to be able to abstract the objects in each web
service so that I can instantiate either one and pass it to a handler

which
can work with either.

Basically the same as you do for two objects inherited fromt he same

parent
you can just have a function accept the parent and then cast it as
necessary.

Is there a way to do this with two (almost) exactly the same web

services in
different references?

Thanks
Nev.


Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.