# 使用 WSDL 把 WebService 轉成 .cs 檔 ( .NetCore 已無法使用,不支援 System.Web.Service 組件 ) ###### tags: `C#` ## 好處是 Url 可以動態改 ## 方法1 直接抓 URL ( 以前可以用 ) ![](https://i.imgur.com/CUxDXWe.png) ## 方法2 將網頁存檔成 WSDL 後在轉換 ![](https://i.imgur.com/w0nY3a0.png) ## 結果 ![](https://i.imgur.com/Wa8yTa6.png) ``` wsdl.exe C:\Users\user\Desktop\存檔檔名.wsdl /out:C:\Users\user\Desktop\xxxxService.cs /namespace:xxxx.Services ```