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

  • 相关阅读:
    省市三级联动
    Python 函数中,参数是传值,还是传引用?
    CSRF(Cross Site Request Forgery, 跨站域请求伪造)
    Django 中间件
    python的内存管理机制
    adb的一些常用的命令
    ant使用备忘
    关于如何以编程的方式执行TestNG
    关于使用testng的retry问题
    SSH中将hibernate托管给spring获取session的方法
  • 原文地址:https://www.cnblogs.com/codejimmygao/p/14604794.html
Copyright © 2011-2022 走看看