How to invoke methods on external server / webservice?

后端 未结 3 1893
無奈伤痛
無奈伤痛 2021-01-16 06:46

I\'m trying to invoke methods from http://www.ibanbic.be/IBANBIC.asmx

I have read a lot of forums and tutorials, but all the information is about setting up a webser

3条回答
  •  梦毁少年i
    2021-01-16 07:14

    A tutorial step by step would be awesome.

    Right click on the References menu in your project in the solution explorer and choose Add Service Reference.... In the address type http://www.ibanbic.be/IBANBIC.asmx and click Go and then OK. This will generate a strongly typed client proxy that will allow you to invoke the service:

    using (var client = new ServiceReference1.BANBICSoapClient("IBANBICSoap"))
    {
        string result = client.calculateIBAN1("iso country", "some account");
    }
    

    Notice that this will also add a to your web.config file where you could manage the WCF client endpoints.

    Alternatively you could use the svcutil.exe to generate a client proxy for the service as shown in this article on MSDN.

提交回复
热议问题