首页 > 其他分享 >Postman测试金蝶云星空Webapi【协同开发云下的本地环境】

Postman测试金蝶云星空Webapi【协同开发云下的本地环境】

时间:2023-09-17 21:35:27浏览次数:49  
标签:Webapi FNumber Postman Pcs FNUMBER SYS 云下 true 请求

业务背景:

基于金蝶云星空提供的接口测试,交付之前或者联调之前开发者先自测,即使纠错,提高效率。

 

 大致流程:

先请求登录接口,获得token后再请求标准webapi或者自定义接口,这样上下文才不会空。

 

说明:

 金蝶的接口格式一般为:http://ServerIp/K3Cloud/接口命名空间.接口实现类名.方法,组件名.common.kdsvc

 

具体操作:

1、协同环境

 

 

 

2、登录postman请求

POST请求:http://localhost:1200/Kingdee.bos.webapi.ServicesStub.authservice.validateuser.common.kdsvc

请求json:

{
    "acctid":"账套id",
    "userName":"账号",
    "password":"密码",
    "lcid":2052
}

 

lcid是多语言,2052代表是中文。

 

3、请求标准接口地址

标准保存接口:

post请求url:

http://localhost:1200/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save.common.kdsvc

 

请求json:

{
    "formid":"BD_MATERIAL",
    "data":{
    "NeedUpDateFields": [],
    "NeedReturnFields": [],
    "IsDeleteEntry": "true",
    "SubSystemId": "",
    "IsVerifyBaseDataField": "false",
    "IsEntryBatchFill": "true",
    "ValidateFlag": "true",
    "NumberSearch": "true",
    "IsAutoAdjustField": "false",
    "InterationFlags": "",
    "IgnoreInterationFlag": "",
    "IsControlPrecision": "false",
    "ValidateRepeatJson": "false",
    "Model": {
        "FName": " 202308mmm",
        "FNumber": "202308mmm",
        "FImgStorageType": "A",
        "FCreateOrgId": {
            "FNumber": "10"
        },
        "FUseOrgId": {
            "FNumber": "10"
        },
        "FSubHeadEntity": {
            "FTimeUnit": "H"
        },
        "SubHeadEntity": {
            "FErpClsID": "1",
            "FFeatureItem": "1",
            "FCategoryID": {
                "FNumber": "CHLB01_SYS"
            },
            "FTaxType": {
                "FNumber": "WLDSFL01_SYS"
            },
            "FTaxRateId": {
                "FNUMBER": "SL02_SYS"
            },
            "FBaseUnitId": {
                "FNumber": "Pcs"
            },
            "FIsPurchase": true,
            "FIsInventory": true,
            "FIsSale": true,
            "FWEIGHTUNITID": {
                "FNUMBER": "kg"
            },
            "FVOLUMEUNITID": {
                "FNUMBER": "m"
            }
        },
        "SubHeadEntity1": {
            "FStoreUnitID": {
                "FNumber": "Pcs"
            },
            "FUnitConvertDir": "1",
            "FIsLockStock": true,
            "FCountCycle": "1",
            "FCountDay": 1,
            "FCurrencyId": {
                "FNumber": "PRE001"
            },
            "FSNManageType": "1",
            "FSNGenerateTime": "1"
        },
        "SubHeadEntity2": {
            "FSaleUnitId": {
                "FNumber": "Pcs"
            },
            "FSalePriceUnitId": {
                "FNumber": "Pcs"
            },
            "FMaxQty": 100000,
            "FIsReturn": true,
            "FISAFTERSALE": true,
            "FISPRODUCTFILES": true,
            "FWARRANTYUNITID": "D",
            "FOutLmtUnit": "SAL"
        },
        "SubHeadEntity3": {
            "FPurchaseUnitId": {
                "FNumber": "Pcs"
            },
            "FPurchasePriceUnitId": {
                "FNumber": "Pcs"
            },
            "FPurchaseOrgId": {
                "FNumber": "10"
            },
            "FQuotaType": "1",
            "FIsReturnMaterial": true,
            "FPOBillTypeId": {
                "FNUMBER": "CGSQD01_SYS"
            },
            "FPrintCount": 1,
            "FMinPackCount": 1
        },
        "SubHeadEntity4": {
            "FPlanningStrategy": "1",
            "FMfgPolicyId": {
                "FNumber": "ZZCL001_SYS"
            },
            "FFixLeadTimeType": "1",
            "FVarLeadTimeType": "1",
            "FCheckLeadTimeType": "1",
            "FOrderIntervalTimeType": "3",
            "FMaxPOQty": 100000,
            "FEOQ": 1,
            "FVarLeadTimeLotSize": 1,
            "FIsMrpComBill": true,
            "FReserveType": "1",
            "FCanDelayDays": 999,
            "FAllowPartDelay": true,
            "FPlanOffsetTimeType": "1",
            "FWriteOffQty": 1
        },
        "SubHeadEntity5": {
            "FProduceUnitId": {
                "FNumber": "Pcs"
            },
            "FProduceBillType": {
                "FNUMBER": "SCDD03_SYS"
            },
            "FOrgTrustBillType": {
                "FNUMBER": "SCDD06_SYS"
            },
            "FBOMUnitId": {
                "FNumber": "Pcs"
            },
            "FIssueType": "1",
            "FOverControlMode": "1",
            "FMinIssueQty": 1,
            "FMinIssueUnitId": {
                "FNUMBER": "Pcs"
            },
            "FStandHourUnitId": "3600",
            "FBackFlushType": "1"
        },
        "SubHeadEntity7": {
            "FSubconUnitId": {
                "FNumber": "Pcs"
            },
            "FSubconPriceUnitId": {
                "FNumber": "Pcs"
            },
            "FSubBillType": {
                "FNUMBER": "WWDD01_SYS"
            }
        },
        "FEntityInvPty": [{
            "FInvPtyId": {
                "FNumber": "01"
            },
            "FIsEnable": true
        }, {
            "FInvPtyId": {
                "FNumber": "02"
            },
            "FIsEnable": true
        }, {
            "FInvPtyId": {
                "FNumber": "03"
            }
        }, {
            "FInvPtyId": {
                "FNumber": "04"
            }
        }, {
            "FInvPtyId": {
                "FNumber": "06"
            }
        }]
    }
}
}
View Code

如果你需要直接拷贝这个请求数据,首先修改你的fnumber,其次是组织id,默认是100,我的是10. 

返回:

{"Result":{"ResponseStatus":{"IsSuccess":true,"Errors":[],"SuccessEntitys":[{"Id":103933,"Number":"202308mmm","DIndex":0}],"SuccessMessages":[],"MsgCode":0},"Id":103933,"Number":"202308mmm","NeedReturnData":[{}]}}

 

 

 

 

 

标准查询接口:

post请求url:

http://localhost:1200/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.View.common.kdsvc

 

请求json:

{
    "formid":"BD_MATERIAL",
    "data":{
        "CreateOrgId": 0,
        "Number": "202308mmm",
        "Id": "",
        "IsSortBySeq": "false"
    }
}

 

返回:

 特别说明:

 

 

其他接口:

 

 

4、请求自定义接口地址

4.1、post请求:http://localhost:1200/xxxx.K3.SCM.WebApi.ServicesStub.AfterOrder.GetAfterOrder.common.kdsvc

备注:拼接规则【http://localhost:1200/命名空间.类名.方法名..common.kdsvc】

4.2、请求头:Header: Content-Type:application/json

 

4.3、请求json:

{
    "customer":"北京XXX电气有限公司"
}

 

 

4.4、请求返回:

 返回成功。

完美。

标签:Webapi,FNumber,Postman,Pcs,FNUMBER,SYS,云下,true,请求
From: https://www.cnblogs.com/lanrenka/p/17672797.html

相关文章

  • Postman 接口测试:优化你的接口测试工作流程
    在现代软件开发生命周期中,接口测试是一个至关重要的部分。使用Postman这一工具,可以轻松地进行接口测试。以下是一份简单的使用教程,帮助你快速上手。安装Postman首先,你需要在电脑上安装Postman。你可以从官网上下载并安装它。安装完成后,你可以打开应用并创建一个新的请求。创建......
  • .net6webapi捕获全局异常
    .net6webapi捕获全局异常usingMicrosoft.AspNetCore.Http;usingMicrosoft.Extensions.Logging;usingNewtonsoft.Json;usingSino.Intelligence.DataAccess.IServiceAccess.ILogs;usingSino.Intelligence.DataAccess.Models;usingSystem;usingSystem.Collections.Gen......
  • WebAPI接口文档快速编写
    近期项目使用了WebAPI,需要先给出接口文档,本着能省事就省事的原则,自然最好是能找到自动生成文档的方式。一、使用Apifox,官网写着这是个API一体化协作平台,说白了,对于我来说,这就是个测试工具+文档生成器。单纯用于测试的话是可以直接在线操作,但如果想导出文档的话,还是需要下......
  • 一键搞定WebAPI调试:推荐这款高效工具
    前后端分离前后端分离的起因为什么要有前后端分离呢?我们回想一下以前的开发是怎么开发的,在以前的时候,前端业务还没那么复杂,所以基本都是一个人包揽前后端,也就是全栈,而为了方便开发,就把前后端放在一个项目中去开发这对于一个人开发来说是确实挺方便,但是随着互联网飞速发展,前端业务......
  • postman断言
    断言工作原理:通过js代码写的。   1、断言响应状态码:Statuscode:Codeis200pm.test("Status code is 200", function () {    pm.response.to.have.status(200);});参数1:Status code is 200,这个参数可以任意修改。不影响断言。作用是:在断言结束后,显......
  • maven-resources-production:webapi: java.lang.NegativeArraySizeException
    maven-resources-production:webapi:java.lang.NegativeArraySizeException打开项目启动时,发现报这个错误,基于此,我分析了一下,首先原本好好的项目突然这样子,首先查看代码更新的情况,发现代码并没有作任何变化。分析代码jar包的问题,首先mvnclean和mvninstall直接一起上。代码可......
  • PostMan上传附件操作步骤
    PostMan上传附件操作步骤1.Head配置接口token环境配置过于简单不做详述-------(不会可百度)2.Head配置Content-Type设置Content-Type,我这里设置为form-data一般后面会跟**boundary=----WebKitFormBoundary7TMYhSONfkAM2z3a**可省略,满足post方式发送浏览器会自动创......
  • .NetCore WebAPI 导入、导出Excel文件 导入
    先下载一个NuGet包 在接口写方法//导入[HttpPost][Route("Import")]publicIActionResultImportExcel()//IFormFileformFile{try{varformFile=HttpContext.Request.Form.Files[0];//......
  • 接口测试工具-Postman使用详解
    ✅作者简介:热爱科研的算法开发者,Python、Matlab项目可交流、沟通、学习。......
  • C#.Net6 WebAPI制作简单自定义Token验证
    一、创建自定义类MyMiddleware继承中间件IMiddleware并实现接口二、在实现接口中的方法编写Token验证逻辑三、在WebAPI的Program类中的builder里注入自定义的类和app里配置自定义中间件builder.Services.AddScoped(typeof(MyMiddleware));app.UseMiddleware(typeof(MyMidd......