先搞到远程接口的描述文件,后缀为.wsdl,借助IDE声成本地类文件,一就是帮助你调用远程接口的文件。程序必须放到“有权访问远程接口的机器”上来运行。使用的时候大概如下:
这是一个wap程序,和jsp无异。
try {
BSServiceSoapStub binding = (BSServiceSoapStub)new BSServiceLocator().getBSServiceSoap();//这一句全都是辅助类
i = binding.webMobiledxx(phone, sType);//binding是你真正需要的,他捆绑了所有远程方法
}
catch (javax.xml.rpc.ServiceException ex) {
response.sendRedirect(response.encodeRedirectURL(Configure.get("URL_WAPERROR") + "?error=" + Configure.get("ERROR_BOSS_BUSY")));
return;
}
catch (java.rmi.RemoteException ex) {
response.sendRedirect(response.encodeRedirectURL(Configure.get("URL_WAPERROR") + "?error=" + Configure.get("ERROR_BOSS_BUSY")));
return;
}
这是一个wap程序,和jsp无异。
try {
BSServiceSoapStub binding = (BSServiceSoapStub)new BSServiceLocator().getBSServiceSoap();//这一句全都是辅助类
i = binding.webMobiledxx(phone, sType);//binding是你真正需要的,他捆绑了所有远程方法
}
catch (javax.xml.rpc.ServiceException ex) {
response.sendRedirect(response.encodeRedirectURL(Configure.get("URL_WAPERROR") + "?error=" + Configure.get("ERROR_BOSS_BUSY")));
return;
}
catch (java.rmi.RemoteException ex) {
response.sendRedirect(response.encodeRedirectURL(Configure.get("URL_WAPERROR") + "?error=" + Configure.get("ERROR_BOSS_BUSY")));
return;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货