当前位置: 代码迷 >> PB >> pb调用webserver的方法异常 ERROR calling method of a PBNI Object
  详细解决方案

pb调用webserver的方法异常 ERROR calling method of a PBNI Object

热度:132   发布时间:2016-04-29 08:26:35.0
pb调用webserver的方法错误 ERROR calling method of a PBNI Object
PB98836调用别人的webservice接口,在测试他们的方法,有些通过,有些PB直接报错,“ERROR calling method of a PBNI Object”这句话,想问下怎么回事了?不懂PBNI是什么,我就是按照对方给的方法给参数啊,有些在报错,有些又对的,搞了很久了,希望大大们帮忙看看.
long rVal, lLog
long amount
conn = create SoapConnection; //Instantiated connection
lLog = conn.SetOptions("xinnonhe.log");
// Set trace file to record soap interchange data,  
// if string is "", disables the feature
rVal = Conn.CreateInstance(proxy_obj,"fservicesoutpaysoap");

if rVal <> 0 then
messagebox("连接失败","错误代码"+string(rVal))
return
end if;
// Create proxy object

try
  amount = proxy_obj.getversion() //调用获取返回值
  messagebox("返回信息",string(amount))
catch(soapexception e1) //soapexception定义的异常
  messagebox("sop异常",e1.text)
catch (runtimeerror re1) //
Messagebox("web连接错误",re1.text)
end try
destroy conn

这个可以正确的获取到  





//////////////
////出院通知
//////////////
boolean is_ok;
long rVal, lLog

conn = create SoapConnection; //Instantiated connection
lLog = conn.SetOptions("");
rVal = Conn.CreateInstance(proxy_obj,"fservicesoutpaysoap");

if rVal <> 0 then
messagebox("连接失败","错误代码"+string(rVal))
return
end if;

try
is_ok = proxy_obj.outhospital( 1, "a7ffd874-d2e3-4700-9d65-e4ebf3abb0da", "80482e6dbebf40298e15c312ca1c265d","111", datetime(date("2010-8-1"),time("09:09:34")), "牙出血", "康复")
if is_ok = true then
messagebox("","出院成功")
else
messagebox("","出院失败")
end if
catch(soapexception e1) //soapexception定义的异常
  messagebox("sop异常",e1.text)
catch (runtimeerror re1) //
Messagebox("web连接错误",re1.text)
end try
destroy conn


这个就不行了 直接报错ERROR calling method of a PBNI Object”

------解决方案--------------------
那就别用SoapConnection,直接通过Inet object获得xml文档自己解析
------解决方案--------------------
11好像也没有这个数据类型。转换一下试试看。
------解决方案--------------------
探讨
听说只能升级到pb11以后的版本才能解决问题了,不知道是否真的是这样了
请教高手了
  相关解决方案