How can I consume 2 web services with one class method?

I’m creating a .Net application to consume the Soap APIs.

I downloaded 2 partner wsdl files from 2 instances(production and sandbox). I think the only difference of the two APIs are their endpoints.

I then added the web references to a single application. When I write the method to consume the APIs, I don’t want to duplicate the code to do same thing(insert,update…).

How can I design my code so maybe I can pass a parameter to let the method know which target instance should it talk to?

Thank you!

Source: oop

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.