Unmarshalling Error: unexpected element 错误的解决

使用ksoap2连接cxf 的webservice时,

如果不带参数可以正常返回,带参数则报如下异常: 

org.apache.cxf.interceptor.Fault: Unmarshalling Error: unexpected element (uri:"http://webservice.abc.com/", local:"arg0"). Expected elements are <{}arg1>,<{}arg0>

解决方法

 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
         envelope.bodyOut = rpc; 
         envelope.dotNet = true;//改成false 
         envelope.setOutputSoapObject(rpc);

问题解决

你可能感兴趣的:(Webservice)