1.客服端发送数据格式:
{user:’anji’,companys:[{ company_name:’ 企业名称’, address:'注册地址', fd_delegate:'法人代表',…},{},{}…]}
2.服务器端返回数据格式:
{"info":{"ok":"
false" ,"message":"异常编号:异常信息" }}
接口描述
|
新增、修改、删除企业基本情况(县区系统交换至市区系统)
|
访问地址
|
http://www.huzsafety.gov.cn:port/huzchange/
|
接口类
|
hzcompanyexservice
|
接口方法
|
datareceive (string jsonstring)
|
输入参数
|
jsonstring:固定格式的json对象所转化的string
格式如:{ datasource:'anji',
username:'',
password:'',
entitys:[{
company_name:
"",
out_id:
"",…},{},…]}
|
输出参数
|
成功:
{"info":{"ok":"true","message":""}}
失败:
{"info":{"ok":"false","message":"错误原因"}}
|
备注
|
在传参时各数据项值均为字符串格式,如有可为空的数据项,则统一传值为空字符串("")
|
类似的这些数据交换接口,该怎么写代码?望指教
Dim url As String = "http://www.huzsafety.gov.cn:port/huzchange/hzcompanyexservice"
Dim hc As New HttpClient(url)
Dim jo As New JObject
jo("entityssource") = "deqin"
jo("username") = "deqin"
jo("password") = "123456"
jo("entitys") = New JObject()
jo("entitys")("company_name") = "测试企业"
jo("entitys")("out_id") = "00075A69FA444007AC1E747A3F1DFAAE"
jo("entitys")("address") = "地方撒伐大"
jo("entitys")("fd_delegate") = "放大"
jo("entitys")("phone") = "15967102763"
jo("entitys")("business_reg_number") = "2232223"
jo("entitys")("organ_code") = "33434343-3"
jo("entitys")("trade_type") = "放大放大"
jo("entitys")("corporate_types") = "放大"
jo("entitys")("economy_kind") = "放大"
jo("entitys")("safety_supervisor") = " 啊 大大"
jo("entitys")("safety_supervisor_phone") = "444444444"
jo("entitys")("safety_supervisor_fax_phone") = "8876667"
jo("entitys")("data_sources") = "deqing"
jo("entitys")("is_deleted") = "0"
jo("entitys")("is_production") = "0"
jo("entitys")("logoff") = "0"
jo("entitys")("type") = "0"
hc.content = jo.Tostring()
jo = JObject.Parse(hc.getdata)