PC Review


Reply
Thread Tools Rate Thread

abstracting a web service

 
 
nevin
Guest
Posts: n/a
 
      4th May 2004
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.


 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      4th May 2004
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]
- (E-Mail Removed)

"nevin" <nevin@[diespam]myself.com> wrote in message
news:4097fc43$0$12735$(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
nevin
Guest
Posts: n/a
 
      4th May 2004
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]" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> 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]
> - (E-Mail Removed)
>
> "nevin" <nevin@[diespam]myself.com> wrote in message
> news:4097fc43$0$12735$(E-Mail Removed)...
> > 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.
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Abstracting Error Bar Data From Charts Spiggy Topes Microsoft Excel Charting 3 1st Apr 2011 02:37 AM
Help, abstracting classes Snedker Microsoft C# .NET 2 7th May 2009 02:39 AM
Abstracting text Bill Ridgeway Microsoft Excel Misc 3 25th May 2006 04:34 PM
Abstracting Connection objects Frank Rizzo Microsoft C# .NET 1 17th Jul 2003 01:38 AM
Abstracting and recreating forms Paul Microsoft Dot NET Framework Forms 0 25th Jun 2003 09:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:26 PM.