使用inet控件post xml参数遇到问题

ashinhao 2013-09-13 09:55:04
需要向 指定地址post数据参数 之前用inet的geturl方法正常调用,现在需要使用post方法传参 部分代码如下
gir_msgbox = CREATE n_ir_msgbox
ls_args='xml=<?xml version="1.0" encoding="GBK"?>'+&
'<Root>'+&
'<Auth UserLoginID="'+ls_yjuser+'" FirstPassword="'+ls_yjpassword+'" UserSecondID="'+ls_ejuser+'" SecondPassword="'+ls_ejpassword+'"/>'+&
'<Operation action="Send">'+&
'<serialID>'+string(ll_id)+'</serialID>'+&
'<SumTime></SumTime>'+&
'<SumToNumber></SumToNumber>'+&
'</Operation>'+&
'</Root>'

ls_url='http://www.hb-mas.cn/web/service/ExternalService?'
lblb_args = Blob(ls_args)
ll_length = Len( lblb_args )
ls_header = " Content-Type: application/x-www-form-urlencoded~n Content-Length: " + String( ll_length ) + "~n~n"

li_rc = GetContextService( "Internet", ginet_base )
if li_rc=1 then
li_rc = ginet_base.PostURL( ls_url, lblb_args, ls_header, gir_msgbox )
end if

因为现在要post xml参数的值 也就是这个xml格式 然后就是始终识别不出来 参数
有明白的高手帮忙看一下
...全文
354 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
rofe_liyg 2013-09-17
  • 打赏
  • 举报
回复
为何不用soap
WorldMobile 2013-09-14
  • 打赏
  • 举报
回复
看一下PB自带的例子,就是这么写的,我用的时候也是这样用的,传多个参数没有问题
WorldMobile 2013-09-13
  • 打赏
  • 举报
回复
用以下代码试试 ls_args='UserLoginID='+ls_yjuser+'&FirstPassword='+ls_yjpassword ls_url='http://www.hb-mas.cn/web/service/ExternalService?' lblb_args = Blob(ls_args) ll_length = Len( lblb_args ) ls_header = " Content-Type: application/x-www-form-urlencoded~n Content-Length: " + String( ll_length ) + "~n~n" li_rc = GetContextService( "Internet", ginet_base ) if li_rc=1 then li_rc = ginet_base.PostURL( ls_url, lblb_args, ls_header, gir_msgbox )
ashinhao 2013-09-13
  • 打赏
  • 举报
回复
引用 1 楼 lzp_lrp 的回复:
用以下代码试试 ls_args='UserLoginID='+ls_yjuser+'&FirstPassword='+ls_yjpassword ls_url='http://www.hb-mas.cn/web/service/ExternalService?' lblb_args = Blob(ls_args) ll_length = Len( lblb_args ) ls_header = " Content-Type: application/x-www-form-urlencoded~n Content-Length: " + String( ll_length ) + "~n~n" li_rc = GetContextService( "Internet", ginet_base ) if li_rc=1 then li_rc = ginet_base.PostURL( ls_url, lblb_args, ls_header, gir_msgbox )
是把参数都拿出来?不放在xml里面传输了?

1,079

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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