以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]post提交数据问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=100702) |
-- 作者:浙江仔 -- 发布时间:2017/5/16 20:30:00 -- [求助]post提交数据问题 用谷歌浏览器的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) |
-- 作者:有点蓝 -- 发布时间:2017/5/16 22:34:00 -- 使用这种方式提交信息:http://www.foxtable.com/mobilehelp/scr/0165.htm |
-- 作者:浙江仔 -- 发布时间: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编辑过]
|
-- 作者:有点色 -- 发布时间:2017/5/17 9:08:00 -- 1、人家提供的是网站网页,还是webservice?
2、人家给你提供的实例是直接调用方法还是post请求提交参数?
3、要提交的参数是什么?你调用成功过吗?咨询一下别人。 |
-- 作者:浙江仔 -- 发布时间: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 |
-- 作者:有点色 -- 发布时间:2017/5/17 10:43:00 -- 对java不熟对框架不熟。对方的配置有问题,不是你能解决的。 |
-- 作者:有点色 -- 发布时间:2017/5/17 10:47:00 -- 你换一种方式试试?
http://blog.csdn.net/jiyiqinlovexx/article/details/17284559
http://www.cnblogs.com/luxiaoxun/p/3969982.html
[此贴子已经被作者于2017/5/17 10:49:13编辑过]
|
-- 作者:浙江仔 -- 发布时间:2017/5/17 12:09:00 -- 是不是对方java接口配置和我们.net 狐表不兼容的意思? |
-- 作者:有点色 -- 发布时间:2017/5/17 12:13:00 -- 以下是引用浙江仔在2017/5/17 12:09:00的发言:
是不是对方java接口配置和我们.net 狐表不兼容的意思?
不是。提供的接口可能本身就有问题。叫对方用工具测试一下post提交行不行。人家应该是有权限的控制。
|