Foxtable(狐表)用户栏目专家坐堂 → [求助]post提交数据问题


  共有2620人关注过本帖树形打印复制链接

主题:[求助]post提交数据问题

帅哥哟,离线,有人找我吗?
浙江仔
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1326 积分:9603 威望:0 精华:1 注册:2010/7/21 14:20:00
[求助]post提交数据问题  发帖心情 Post By:2017/5/16 20:30:00 [显示全部帖子]

用谷歌浏览器的postman测试的,提交的代码如下:

POST /huzchange/dataEx/company HTTP/1.1
Host: 192.168.20.1:8160
Content-Type: application/json
Cache-Control: no-cache

{
  "dataSource": "DEQING",
  "username": "deqing",
  "password": "123456",
  "entity_name": "COMPANY",
  "entitys":  {
    "COMPANY_NAME": "县区综合四四数据交换接口测试企业",
    "ADDRESS": "综合1003号",
    "FD_DELEGATE": "张四四",
    "PHONE": "13522222222",
    "FIRST_AREA": "330500",
    "SECOND_AREA": "330521",
    "THIRD_AREA": "330521100000",
    "FOUTH_AREA": "4",
    "FIFTH_AREA": "5",
    "BUSINESS_REG_NUMBER": "BUS1001",
    "ORGAN_CODE": "22323232-2",
    "SALE_MONEY": "100",
    "EMPLOYEE_NUMBER": "10",
    "DEAL_IN_RANGE": "经营范围经营范围经营范围经营范围",
    "TRADE_DEPT": "tradeDept01",
    "TRADE_TYPE": "tradeType08",
    "TRADE_BIG": "tradeType08_2",
    "TRADE_MID": "tradeType08_2_2",
    "TRADE_SMA": "tradeType08_2_2_6",
    "CREATE_DEPT": "PRODUCE) =PRODUCE) =文件柜查看) =下载权限",
    "SUPERVISION_TYPE": "supervisionType_80",
    "COUNTY_DEPT": "county_dept3",
    "PARTITION_SCORE": "97.5",
    "CORPORATE_TYPES": "法人类型法人类型法人类型",
    "ECONOMY_KIND": "economyType04",
    "SECTORAL": "部门部门部门部门",
    "BUSINESS_PRACTICE": "经营方式经营方式",
    "SAFETY_SUPERVISOR": "安全主管人安全主管人",
    "SAFETY_SUPERVISOR_PHONE": "13222222222",
    "SAFETY_SUPERVISOR_FAX_PHONE": "0574-22222222",
    "TECHNOLOGY_NUMBER": "20",
    "SAFETY_NUMBER": "30",
    "REGISTERED_CAPITAL": "40",
    "FIXED_ASSETS": "50",
    "LAST_YEAR_SALES": "60",
    "TYPE": "0",
    "INDUSTRYID_BIG": "90261",
    "INDUSTRYID_MID": "5995",
    "INDUSTRYID_SMA": "5996"
    }
}


提示错误,不知道怎么解决了,有知道的么?

type Exception report

message Hessian skeleton invocation failed; nested exception is java.io.IOException: Expected 'H'/'C' (Hessian 2.0) or 'c' (Hessian 1.0) in hessian input at 123

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.springframework.web.util.NestedServletException: Hessian skeleton invocation failed; nested exception is java.io.IOException: Expected 'H'/'C' (Hessian 2.0) or 'c' (Hessian 1.0) in hessian input at 123
	cn.safetys.hessian.service.impl.HessianServiceExporter.handleRequest(HessianServiceExporter.java:42)
	org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:915)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:822)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:796)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:233)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)




 回到顶部
帅哥哟,离线,有人找我吗?
浙江仔
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1326 积分:9603 威望:0 精华:1 注册:2010/7/21 14:20:00
  发帖心情 Post By:2017/5/17 8:54:00 [显示全部帖子]

Dim jo As New JObject

jo("dataSource") = "DEQING"
jo("username") = "deqing" '模板ID
jo("password") = "123456" '模板ID
jo("entity_name") = "COMPANY" '表名
jo("entitys") = New JObject()
jo("entitys")("COMPANY_NAME") = "综合四四数据交换接口测试企业" '企业名称
jo("entitys")("ADDRESS") = "综合1003号" '注册地址
jo("entitys")("FD_DELEGATE") = "张四四" '法人代表
jo("entitys")("PHONE") = "13522222222" '联系电话
jo("entitys")("FIRST_AREA") = "330500" '一级区域
jo("entitys")("SECOND_AREA") = "330521" '二级区域
jo("entitys")("THIRD_AREA") = "330521100000" '三级区域
jo("entitys")("FOUTH_AREA") = "4" '四级区域
jo("entitys")("FIFTH_AREA") = "5" '五级区域
jo("entitys")("BUSINESS_REG_NUMBER") = "BUS-REG-HZ-1001" '工商注册号
jo("entitys")("ORGAN_CODE") = "ORG-HZ-0002" '组织机构代码
jo("entitys")("SALE_MONEY") = "100" '销售额
jo("entitys")("EMPLOYEE_NUMBER") = "10" '职工人数
jo("entitys")("DEAL_IN_RANGE") = "经营范围经营范围经营范围经营范围" '经营范围
jo("entitys")("TRADE_DEPT") = "tradeDept01" '行业主管部门
jo("entitys")("TRADE_TYPE") = "tradeType08" '所属行业
jo("entitys")("TRADE_BIG") = "tradeType08_2" '行业分类-行业大类
jo("entitys")("TRADE_MID") = "tradeType08_2_2" '行业分类-行业中类
jo("entitys")("TRADE_SMA") = "tradeType08_2_2_6" '行业分类-行业小类
jo("entitys")("CREATE_DEPT") = "PRODUCE) =PRODUCE) =文件柜查看) =下载权限" '创建企业的部门) =这个字段如果没有查看数据库不知道怎么填写
jo("entitys")("SUPERVISION_TYPE") = "supervisionType_80" '分类监管级别
jo("entitys")("COUNTY_DEPT") = "county_dept3" '县级科室
jo("entitys")("PARTITION_SCORE") = "97.5" '分级分类得分
jo("entitys")("CORPORATE_TYPES") = "法人类型法人类型法人类型" '法人类型
jo("entitys")("ECONOMY_KIND") = "economyType04" '经济性质
jo("entitys")("SECTORAL") = "部门部门部门部门" '部门
jo("entitys")("BUSINESS_PRACTICE") = "经营方式经营方式" '经营方式
jo("entitys")("SAFETY_SUPERVISOR") = "安全主管人安全主管人" '安全主管人
jo("entitys")("SAFETY_SUPERVISOR_PHONE") = "13222222222" '安全主管人联系电话
jo("entitys")("SAFETY_SUPERVISOR_FAX_PHONE") = "0574-22222222" '安全主管人传真电话
jo("entitys")("TECHNOLOGY_NUMBER") = "20" '技术管理人数
jo("entitys")("SAFETY_NUMBER") = "30" '安全管理人数
jo("entitys")("REGISTERED_CAPITAL") = "40" '注册资本
jo("entitys")("FIXED_ASSETS") = "50" '固定资产
jo("entitys")("LAST_YEAR_SALES") = "60" '上年销售额


jo("entitys")("TYPE") = "0" '企业行业分类(危化品生产企业为1) =危化品经营企业为2) =非煤矿山企业为3) =综合企业为0) =烟花爆竹企业为4)
jo("entitys")("INDUSTRYID_BIG") = "90261" '企业行业分类) =分5大类 --综合企业
jo("entitys")("INDUSTRYID_MID") = "5995" '企业行业分类--水上运输企业
jo("entitys")("INDUSTRYID_SMA") = "5996" '企业行业分类--水上运输
'arr.put(o)


Dim msg As String = jo.Tostring()
Dim hc As New HttpClient("http://192.168.20.1:8160/huzchange/dataEx/company")
hc.Timeout = 5 '设置超时为5秒
hc
.Content = msg
hc.Content - Type="app-lication/j-son"   ‘-是为了显示这段,不然论坛网页看不到这句
Dim ret As String = hc.GetData()

还是显示“远程服务器返回错误: (500) 内部服务器错误。”


[此贴子已经被作者于2017/5/17 8:56:19编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
浙江仔
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1326 积分:9603 威望:0 精华:1 注册:2010/7/21 14:20:00
  发帖心情 Post By:2017/5/17 9:19:00 [显示全部帖子]

是数据交换接口,post提交数据
问题是一楼的代码在对方服务器调试时可以通过的,但是我这边用postman或者狐表提交就出现500错误

提交的参数就是这个json数据

{
  "dataSource": "DEQING",
  "username": "deqing",
  "password": "123456",
  "entity_name": "COMPANY",
  "entitys":  {
    "COMPANY_NAME": "县区综合四四数据交换接口测试企业",
    "ADDRESS": "综合1003号",
    "FD_DELEGATE": "张四四",
    "PHONE": "13522222222",
    "FIRST_AREA": "330500",
    "SECOND_AREA": "330521",
    "THIRD_AREA": "330521100000",
    "FOUTH_AREA": "4",
    "FIFTH_AREA": "5",
    "BUSINESS_REG_NUMBER": "BUS1001",
    "ORGAN_CODE": "22323232-2",
    "SALE_MONEY": "100",
    "EMPLOYEE_NUMBER": "10",
    "DEAL_IN_RANGE": "经营范围经营范围经营范围经营范围",
    "TRADE_DEPT": "tradeDept01",
    "TRADE_TYPE": "tradeType08",
    "TRADE_BIG": "tradeType08_2",
    "TRADE_MID": "tradeType08_2_2",
    "TRADE_SMA": "tradeType08_2_2_6",
    "CREATE_DEPT": "PRODUCE) =PRODUCE) =文件柜查看) =下载权限",
    "SUPERVISION_TYPE": "supervisionType_80",
    "COUNTY_DEPT": "county_dept3",
    "PARTITION_SCORE": "97.5",
    "CORPORATE_TYPES": "法人类型法人类型法人类型",
    "ECONOMY_KIND": "economyType04",
    "SECTORAL": "部门部门部门部门",
    "BUSINESS_PRACTICE": "经营方式经营方式",
    "SAFETY_SUPERVISOR": "安全主管人安全主管人",
    "SAFETY_SUPERVISOR_PHONE": "13222222222",
    "SAFETY_SUPERVISOR_FAX_PHONE": "0574-22222222",
    "TECHNOLOGY_NUMBER": "20",
    "SAFETY_NUMBER": "30",
    "REGISTERED_CAPITAL": "40",
    "FIXED_ASSETS": "50",
    "LAST_YEAR_SALES": "60",
    "TYPE": "0",
    "INDUSTRYID_BIG": "90261",
    "INDUSTRYID_MID": "5995",
    "INDUSTRYID_SMA": "5996"
    }
}

提示这个错误:

HTTP Status 500 - Hessian skeleton invocation failed; nested exception is java.io.IOException: Expected 'H'/'C' (Hessian 2.0) or 'c' (Hessian 1.0) in hessian input at 123


 回到顶部
帅哥哟,离线,有人找我吗?
浙江仔
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1326 积分:9603 威望:0 精华:1 注册:2010/7/21 14:20:00
  发帖心情 Post By:2017/5/17 12:09:00 [显示全部帖子]

是不是对方java接口配置和我们.net 狐表不兼容的意思?

 回到顶部