如何在pb9中调用WebService
1个回答
展开全部
1.c:\program
files\sybase\shared\powerbuilder面pbsoapclient90.pbd加入target.
2.创建web service代理
点:File->News->Project->Web service Proxy
Wizrd
步提示输入WSDL文件点击浏览选择webservice服务器端提供wsdl接口文档比(附档wsdl.rar):
点击步自现WSDL文件Service.点击步系统默认选择ServiceSoap紧接着输入proxy name(代理象名)前缀输入My.面几项按默认即
完编译代理象界面现:
Web Service Generator Project Status
Deployment PBL:
E:\whz\PBWebService\pb9\smsweb.pbl
Clear PBL on build: No
Confirm
overwrites: No
WSDL Location:
Services selected :
Service
Service:
PersonPort
点击编译绿色图标代理象(mypersonport)
3.增加窗口放按钮,调用代码例:
SoapConnection lsc_conn
mypersonport
lproxy_obj
String ls_proxy_name = "mypersonport"//代理象名称
String
ls_url =
""//urlwsdl接口文档节点找
int
li_ret, i
try
lsc_conn = Create SoapConnection
//lsc_conn.SetOptions("SoapLog=~"soaplog.txt~"")
li_ret =
lsc_conn.Createinstance(lproxy_obj,ls_proxy_name,ls_url)
If li_ret
> 0 Then
MessageBox("错误", "调用失败错误代码:" + String(li_ret))
Return
End If
i = lproxy_obj.add("1")
MessageBox("Web Service", "调用功:" + String(i))
catch (SoapException
e1)
MessageBox("错误", "能调用函数错误信息:" + e1.GetMessage())
catch
(PBXRuntimeError e2)
MessageBox("错误", "调用函数运行错误." )
catch
(RuntimeError e3)
MessageBox("错误", "调用函数知错误." )
end try
转载仅供参考版权属于原作者祝愉快满意请采纳哦
files\sybase\shared\powerbuilder面pbsoapclient90.pbd加入target.
2.创建web service代理
点:File->News->Project->Web service Proxy
Wizrd
步提示输入WSDL文件点击浏览选择webservice服务器端提供wsdl接口文档比(附档wsdl.rar):
点击步自现WSDL文件Service.点击步系统默认选择ServiceSoap紧接着输入proxy name(代理象名)前缀输入My.面几项按默认即
完编译代理象界面现:
Web Service Generator Project Status
Deployment PBL:
E:\whz\PBWebService\pb9\smsweb.pbl
Clear PBL on build: No
Confirm
overwrites: No
WSDL Location:
Services selected :
Service
Service:
PersonPort
点击编译绿色图标代理象(mypersonport)
3.增加窗口放按钮,调用代码例:
SoapConnection lsc_conn
mypersonport
lproxy_obj
String ls_proxy_name = "mypersonport"//代理象名称
String
ls_url =
""//urlwsdl接口文档节点找
int
li_ret, i
try
lsc_conn = Create SoapConnection
//lsc_conn.SetOptions("SoapLog=~"soaplog.txt~"")
li_ret =
lsc_conn.Createinstance(lproxy_obj,ls_proxy_name,ls_url)
If li_ret
> 0 Then
MessageBox("错误", "调用失败错误代码:" + String(li_ret))
Return
End If
i = lproxy_obj.add("1")
MessageBox("Web Service", "调用功:" + String(i))
catch (SoapException
e1)
MessageBox("错误", "能调用函数错误信息:" + e1.GetMessage())
catch
(PBXRuntimeError e2)
MessageBox("错误", "调用函数运行错误." )
catch
(RuntimeError e3)
MessageBox("错误", "调用函数知错误." )
end try
转载仅供参考版权属于原作者祝愉快满意请采纳哦
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询