Web Service without adding a reference?

前端 未结 6 789
眼角桃花
眼角桃花 2020-12-04 16:16

I have 3 web services added to service references in a class library.(This is a sample project for an API use) I need to move these into my project but i ca

6条回答
  •  不思量自难忘°
    2020-12-04 16:40

    You can dynamically change the url of a service reference:

    var service = new MyService.MyWSSoapClient();
    service.Endpoint.Address = new System.ServiceModel.EndpointAddress("http://localhost:8080/");
    

提交回复
热议问题