Unmarshalling Error: 意外的元素的问题的解决


今天使用axis2进行webservice调用出现上述问题,网络上没有找到解决的方案,后自己解决了,特此登记。

原因:传输参数格式有问题。

解决:将以下删除线的内容替换成字体加粗的内容。

OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://hr.evecom.net/", "");// 参数1(uri)=即为wsdl文档的targetNamespace;参数2(prefix)=可不填
OMElement method = fac.createOMElement("hiMyService", omNs);// 方法名

OMElement in0 = fac.createOMElement("content", omNs);// 方法参数

QName qname = new QName("content");
OMElement in0 = fac.createOMElement(qname);// 方法参数
in0.setText(xmlStr); // 参数值
method.addChild(in0); // 添加参数


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM