zoukankan      html  css  js  c++  java
  • C#根据wsdl文件生成客户端调用代码

    C#根据wsdl文件生成客户端调用代码,

    要用到visaul studio的命令行工具。进入开始菜单visual studio的菜单,选择 "visual studio tool",打开菜单里面命令提示符选项,输入一下命令:

    wsdl .soapService.xml.wsdl /si  /namespace:nsname /out:.ISoapService.cs
    

      这个命令生成服务端的接口文件,其中soapService.xml.wsdl是当前目录的wsdl文件

    如果要生成客户端类文件,输入一下命令:

    wsdl .soapService.xml.wsdl  /namespace:nsname /out:.SoapService.cs
    

      

    一个完整的例子如下:

    D:>wsdl .soapService.xml.wsdl /si  /namespace:nsname /out:.ISoapService.cs
    Microsoft(R) Web Services 描述语言实用工具
    [Microsoft (R) .NET Framework, Version 2.0.50727.3038]
    Copyright (C) Microsoft Corporation. All rights reserved.
    正在写入文件“.ISoapService.cs”。
    
    D:>wsdl .soapService.xml.wsdl  /namespace:nsname /out:.SoapService.cs
    Microsoft(R) Web Services 描述语言实用工具
    [Microsoft (R) .NET Framework, Version 2.0.50727.3038]
    Copyright (C) Microsoft Corporation. All rights reserved.
    正在写入文件“.SoapService.cs”。
    
    D:>

    关于参数:

    /namespace:nsname 是指定命名空间为nsname, 如果需要修改,可以直接改为所需要的命名空间
  • 相关阅读:
    [声明]博主退役了
    galgame(s?)
    atcoder grand contest 040 F Two Pieces
    AtCoder Grand Contest 040 E
    【AtCoder】CODE FESTIVAL 2016 qual C E-順列辞書 / Encyclopedia of Permutations
    GMOJ6282 向量
    [GMOJ6281] 串
    GMOJ 5909 跑商
    2019.10.28 GMOJ 6394 燃烧的火焰
    题解 CF1092B 【Teams Forming】
  • 原文地址:https://www.cnblogs.com/equation/p/15132117.html
Copyright © 2011-2022 走看看