代码如下:
public void test4() throws RemoteException, ServiceException, MalformedURLException{
/** step1: 创建一个Service实例,注意是必须的!*/
Service service = new Service();
/**step2:创建Call实例,也是必须的!*/
Call call = (Call) service.createCall();
/**step3: 为Call设置服务的位置 操作方法名 */
QName name = new QName("tns:HotelInformation", "HotelInformation");
call.registerTypeMapping(HotelInformation.class, name, new BeanSerializerFactory(HotelInformation.class, name),new BeanDeserializerFactory(HotelInformation.class, name));
//System.out.println(obj);
call.setTargetEndpointAddress(new java.net.URL("http://10.68.25.108/hbms/services/HBEServices"));
call.setOperationName("HotelInformation");
User us = new User();
CityVo c = new CityVo();
Object [] o = (Object[]) call.invoke(new Object[] { });
List list = null;
list = Arrays.asList(o);
//String s =c.getCityName();
System.out.println("ok");
System.out.println(list.size());
}
如下异常:org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.请高人指点下吧。需要WSDL的加我QQ:446405157.能帮解决的非常感谢。困惑好几天了
public void test4() throws RemoteException, ServiceException, MalformedURLException{
/** step1: 创建一个Service实例,注意是必须的!*/
Service service = new Service();
/**step2:创建Call实例,也是必须的!*/
Call call = (Call) service.createCall();
/**step3: 为Call设置服务的位置 操作方法名 */
QName name = new QName("tns:HotelInformation", "HotelInformation");
call.registerTypeMapping(HotelInformation.class, name, new BeanSerializerFactory(HotelInformation.class, name),new BeanDeserializerFactory(HotelInformation.class, name));
//System.out.println(obj);
call.setTargetEndpointAddress(new java.net.URL("http://10.68.25.108/hbms/services/HBEServices"));
call.setOperationName("HotelInformation");
User us = new User();
CityVo c = new CityVo();
Object [] o = (Object[]) call.invoke(new Object[] { });
List list = null;
list = Arrays.asList(o);
//String s =c.getCityName();
System.out.println("ok");
System.out.println(list.size());
}
如下异常:org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.请高人指点下吧。需要WSDL的加我QQ:446405157.能帮解决的非常感谢。困惑好几天了
解决方案 »
- 大家帮忙总结一下ie和火狐的样式或js不兼容的问题。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
- 紧急求SCJP 2009年最新题库
- 推荐关于J2EE大型企业项目分析的书籍(银行,电力,保险)
- Struts1.2的validator框架的自定义校验规则
- webservice 异常 求助
- 求助!
- tomcat5.5连接池
- 100分:我从.net转过来,基本熟悉java语言,现在要用jb+weblogic进行ejb开发,哪里有比较好的例子或者什么书比较好?
- 问个问题,ojb是个什么概念?和hibernate有什么区别?
- 这个问题可能会让你们笑话,可不问我就不知道
- ssh整合
- 为什么spring在运行一段时间之后会报错?
建议你还是Google一下吧,参考着别人的解决办法,可能对你有所帮助,因为没有谁能比你自己更了解你的程序了。
我们单纯的看你提供的代码对你的帮助不大。