JAVA调用WEBAPI查看客户信息失败,怎么办

Python015

JAVA调用WEBAPI查看客户信息失败,怎么办,第1张

设置的内容如下

Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.View.common.kdsvc

BD_Customer

{"CreateOrgId":100040,"Number":"001.001.0001"}

返回的错误信息如下

{"Result":{"ResponseStatus":{"ErrorCode":500,"IsSuccess":false,"Errors":[{"FieldName":"给定关键字不在字典中。","Message":" 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)\r\n 在 Kingdee.BOS.WebApi.FormService.View.Execute()\r\n 在 Kingdee.BOS.WebApi.FormService.BillOperationService.ExecuteOperation(FormOperation op, String data)"}],"SuccessEntitys":[]}}}

修改传入参数,把Id补上(不知道Id值),如下

{"CreateOrgId":100040,"Number":"001.001.0001","Id":"String"}

此时返回的错误信息如下

{"Result":{"ResponseStatus":{"ErrorCode":500,"IsSuccess":false,"Errors":[{"FieldName":"输入字符串的格式不正确。","Message":" 在 System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&number, NumberFormatInfo info, Boolean parseDecimal)\r\n 在 System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt)\r\n 在 Kingdee.BOS.WebApi.FormService.View.Execute()\r\n 在 Kingdee.BOS.WebApi.FormService.BillOperationService.ExecuteOperation(FormOperation op, String data)"}],"SuccessEntitys":[]}}}

package com.dataMonitor.bo.common

import java.io.BufferedReader

import java.io.IOException

import java.io.InputStreamReader

import java.io.PrintWriter

import java.util.HashMap

import java.util.List

import java.util.Map

import net.sf.json.JSONObject

import java.io.*

import java.net.HttpURLConnection

import java.net.URL

import org.apache.http.HttpEntity

第一步:先将编译好的web项目打包成zip格式的压缩包 ,假设命名为(test.zip)

第二步:通过sftp工具(如:WinSCP)将test.zip上传到指定的文件(假设路劲为/project/test.zip)

第三步:配置tomcat虚拟路径 (修改tomcat---conf----service.xml文件,在Host节点下添加<Context path="" docBase="" />)

这个不会配置的百度,比如这里可以这样配置 <Context path="" docBase ="/project/test"/>这样通过域名就可以直接访问项目了

第四步:使用xshell4等工具连接到服务器,这个就不说了

第五步:进入/project目录,命令如下:

cd ../(进入根目录)---->cd /project(进入project目录)

第六步:查看当前文件夹下所有文件(ls)

第七步:停掉tomcat的test服务

ps -ef|grep tomcat (查看已启动的服务)----------->可以看到已启动的所有项目,找到test项目的端口号

关闭服务 kill -9 ****

第八步:备份

将test文件夹备份:rename test testbak_时间戳 test(将test文件或文件夹重命名为 testbak_时间戳)

第九步:解压缩上传的test.zip

由于当前已在/project目录下,所以直接解压unzip test.zip

第十步:启动tomcat

进入tomcat下的bin目录:cd ../------->cd /service/tomcat/bin

ls 查看所有文件-------------->sh startup.sh(启动tomcat)