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;
    }

  • 相关阅读:
    Y+的一些讨论
    MATLAB中FFT的使用方法
    插入排序、冒泡排序、选择排序——转载
    输出控制中时间延迟的几种方法
    模拟通信调制方式与通信设备
    模拟通信主要特点
    模拟通信数字信号
    模拟通信
    传真存储变换设备与入网方式
    静止图像通信
  • 原文地址:https://www.cnblogs.com/codejimmygao/p/14604794.html
Copyright © 2011-2022 走看看