zoukankan      html  css  js  c++  java
  • C# .net 调用外部接口 asmx格式的 需要先在Service References 添加服务引用

     

     

     这些步骤完成后就可以像调用方法一样调用接口了。

    public string QueryOrderInformation(DataRow rows, string VoucherNo)
    {
    string QCNum = rows["QC工号"].ToString();
    string type = rows["送检类型"].ToString();
    string type1 = "";
    if (type== "电仪")
    {
    type1 = "1";
    }
    if (type == "机械")
    {
    type1 = "2";
    }
    QueryOrderInformation.NewServiceHG getlist = new QueryOrderInformation.NewServiceHG();


    string strContent = "";
    strContent += "{\"document_number\":\"" + VoucherNo + "\",";//物料凭证号
    strContent += "\"inspection_sheet_type\":\"" + type1 + "\",";////送检类型:1机械、2电仪
    strContent += "\"inspection_sheet_way\":\"" + 1 + "\",";//送检方式:1=正常、2=返修
    strContent += "\"qc_user_num\":\"" + QCNum + "\",";//检验员工号
    strContent += "\"create_user_id\":\"" + 7777+ "\",";//送检人工号
    strContent += "\"create_user_name\":\"" + "" + "\",";//送检人姓名
    strContent += "\"purchasing_order\":\"" + rows["订单号"].ToString() + "\"}";//订单号

    string JsonStr = getlist.QueryOrderInformation(strContent);//获取送检单号 inspection_sheet 并存入数据库

    JObject jo = (JObject)JsonConvert.DeserializeObject(JsonStr);
    string inspection_sheet = jo["result"]["inspection_sheet"].ToString();//送检单号
    return inspection_sheet;
    }

  • 相关阅读:
    Linux守护进程的编程实现
    QUIC简单介绍
    oracle10G/11G官方下载地址集合 直接迅雷下载
    Linux 解决文件删除,但并没有改变磁盘可用性
    开始使用正则表达式
    Codeforces 442C Artem and Array(stack+贪婪)
    Drop dual
    ios结构体httpPost头结构
    一个人ACM(我们赶上了ACM)
    Linux svnserver存储路径和文件的详细解释
  • 原文地址:https://www.cnblogs.com/codejimmygao/p/14604794.html
Copyright © 2011-2022 走看看