最近在進行兩個項目開發時,需要使用WebService進行通信,在一個項目中使用axis2實作了,但在别一個項目中調用時,卻發生異常,錯誤資訊:namespace mismatch require http://webservice.transcoding.module.iefree.com found http://ws.apache.org/axis2/xsd
QName qName=new QName("http://ws.apache.org/axis2/xsd","addTransTask");
QName中使用的是http://ws.apache.org/axis2/xsd,而通過http://192.168.1.131:8080/video-library/services/Transcoding?wsdl檢視得到的targetNamespace=http://webservice.transcoding.module.iefree.com;
将QName的參數改為“http://webservice.transcoding.module.iefree.com”即可。
http://blog.sina.com.cn/s/blog_6f1a188a0100y6mo.html