c# - How can I consume 2 web services with one class method? -
i'm creating .net application consume soap apis.
i downloaded 2 partner wsdl files 2 instances(production , sandbox). think difference of 2 apis endpoints.
i added web references single application. when write method consume apis, don't want duplicate code same thing(insert,update...).
how can design code maybe can pass parameter let method know target instance should talk to?
thank you!
if services same , endpoint differs, should able use generated client's endpoint property change endpoint.
var client = new servicereference1.webservice1soapclient(); client.endpoint.address = new system.servicemodel.endpointaddress("http://localhost:2850/webservice1.asmx");
Comments
Post a Comment