Create web service proxy in Visual Studio from a WSDL file

前端 未结 7 1944
别跟我提以往
别跟我提以往 2020-11-29 17:24

My application needs to talk to a web service that hasn\'t got an online WSDL definition. The developers however supplied me with a WSDL file.

With a public WSDL Vis

7条回答
  •  攒了一身酷
    2020-11-29 17:45

    Try using WSDL.exe and then including the generated file (.cs) into your project.

    Fire up the Visual Studio Command prompt (under visual studio/tools in the start menu) then type

    >wsdl.exe [path To Your WSDL File]
    

    That'll spit out a file, which you copy/move and include in your project. That file contains a class which is a proxy to your sevice, Fire up an instance of that class, and it'll have a URL property you can set on the fly, and a bunch of methods that you can call. It'll also generate classes for all/any complex objects passed across the service interface.

提交回复
热议问题