pb用http改送soap请求,断点调式不报错,连续运行就报错

jsd1303 2018-11-19 05:54:22


//
OLEObject ole_gylpt_webservice
long ll_state, ll_len
string rs_return
//string ls_param
string as_url ,as_content
string ls_soapxml_start, ls_soapxml_end
string ls_input

ls_soapxml_start = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ' +&
'xmlns:web="http://webservice.mis.elite.com/"><soapenv:Header/><soapenv:Body>' +&
'<web:doServiceByJson><jsonStr>'
ls_soapxml_end = '</jsonStr></web:doServiceByJson></soapenv:Body></soapenv:Envelope>'

as_content = "{'data':{'appName':'com.elite.mis','appProject':'wms','appVersion':'hmis_gg_01', " +&
"'userIdentity':'9999','serviceName':'mybitisUserService','methodName':'getLoginUser'," +&
"'parameters': {'userCode' : '3294','password':'123456'}}}"
as_content = "{'data':{'appName':'com.elite.mis','appProject':'wms','appVersion':'hmis_gg_01', 'userIdentity':'9999','serviceName':'hisService','methodName':'addManufacturer','parameters': {'oper' : '','produrceid':'','name':'','zjm':'','status':''}}}"
as_url = 'http://197.4.20.217:4980/com.elite.mis/dxws/soapService?wsdl'

ls_input = ls_soapxml_start + as_content+ ls_soapxml_end
ole_gylpt_webservice = create OLEObject

ll_state = ole_gylpt_webservice.connecttonewobject("Msxml2.XMLHTTP.6.0")

if ll_state<>0 then
ll_state = ole_gylpt_webservice.connectToNewObject("Msxml2.XMLHTTP.3.0")
if ll_state <> 0 then
rs_return = "连接MSSOAP.SoapClient失败!返回参数:"+string(ll_state)
goto _error
end if
end if

ll_len = Len(ls_input)

ole_gylpt_webservice.Open("POST",as_url,True)
ole_gylpt_webservice.setRequestHeader("Content-Type","text/xml;charset=UTF-8")
ole_gylpt_webservice.setRequestHeader("Content-Length",String(ll_len))
ole_gylpt_webservice.setRequestHeader("Authorization","auth=")

ole_gylpt_webservice.Send(ls_input)

Do While ole_gylpt_webservice.readyState <> 4 //查询状态,延时
Yield()
Loop

rs_return = ole_gylpt_webservice.responseText

ole_gylpt_webservice.disconnectobject( )
destroy ole_gylpt_webservice
return 0

-----------------------
rs_return = ole_gylpt_webservice.responseText 这一句获取返回值时,设置断点步进调式就可以正常获取返回值,但是连续运行系统 就报错。倒底是什么问题呢?
...全文
846 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
aolixiaox 2019-06-13
  • 打赏
  • 举报
回复
引用 7 楼 小明大阴逼 的回复:
[quote=引用 6 楼 aolixiaox 的回复:] [quote=引用 楼主 jsd1303 的回复:] 楼主这个PB是啥版本,有分页窗口,还有脚本行号,
在叔的PB IDE[/quote] 谢谢,有个分页,小屏幕还是方便些
囡程序猿 2019-06-13
  • 打赏
  • 举报
回复
引用 6 楼 aolixiaox 的回复:
[quote=引用 楼主 jsd1303 的回复:]



楼主这个PB是啥版本,有分页窗口,还有脚本行号,

在叔的PB IDE
aolixiaox 2019-03-12
  • 打赏
  • 举报
回复
[quote=引用 楼主 jsd1303 的回复:] 楼主这个PB是啥版本,有分页窗口,还有脚本行号,
acen_chen 2019-03-11
  • 打赏
  • 举报
回复
rs_return = space(2000)
rs_return = ole_gylpt_webservice.responseText
这样试试
PackChen 2019-03-06
  • 打赏
  • 举报
回复
引用 3 楼 小明大阴逼 的回复:
很多WS类型接口,PB的ws对象是调用不了的,传输的xml格式都有可能不一样,建议使用http请求 把请求参数写成xml字符串去请求

不,而是因为pb使用的是easysoap,然而有些ws不是easysoap标准,不过可以用api处理
囡程序猿 2019-02-20
  • 打赏
  • 举报
回复
很多WS类型接口,PB的ws对象是调用不了的,传输的xml格式都有可能不一样,建议使用http请求 把请求参数写成xml字符串去请求
TheLittlePrince 2019-01-31
  • 打赏
  • 举报
回复
你得把你报什么错贴一下吧。
qq_20411105 2019-01-07
  • 打赏
  • 举报
回复
ole_gylpt_webservice.Open("POST",as_url,false)
改成同步的试试?

662

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder Web 应用
社区管理员
  • Web 应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧