WebService小記

來源:互聯網
上載者:User

標籤:分享   代理類   沒有   xsd   代理模式   sch   namespace   gen   main   

這個問題找了好多地方都沒有結果,自己暫且總結一下吧,也不算是解決問題的根本途徑,但是也不失為一種辦法。當時用了wsimport  wsdl2java xfire 都沒有解決,大牛能解決的話,歡迎留言。

項目調用第三方介面,通過weibservice調用,但是這個東西,是人家用php搞出來的,裡面有一個<xsd:element name="FACTURA" type="xsd:array"/>這個標籤,在命名空間不支援,ecipse提示如下(

src-resolve.4.2: Error resolving component ‘xsd:array‘. It was detected that ‘xsd:array‘ is in namespace ‘http://www.w3.org/2001/XMLSchema‘, but components from
this namespace are not referenceable from schema document ‘file:///D:/workspace2/mpeso/src/main/resources/mpeso_ap.wsdl‘. If this is the incorrect namespace,
perhaps the prefix of ‘xsd:array‘ needs to be changed. If this is the correct namespace, then an appropriate ‘import‘ tag should be added to ‘file:///D:/workspace2/
mpeso/src/main/resources/mpeso_ap.wsdl‘.

導致產生用戶端代碼的時候總是報錯,

IWAB0399E Error in generating Java from WSDL: java.io.IOException: Type {http://www.w3.org/2001/XMLSchema}array is referenced but not defined.
java.io.IOException: Type {http://www.w3.org/2001/XMLSchema}array is referenced but not defined.
at org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined

 

 

我的解決辦法就是,把這個type注釋掉,然後順藤摸瓜,注釋掉相應的參數和介面,說白了就是我不用這個介面,(因為我的項目用不到這個介面)

這樣沒問題了,但是產生java代碼的時候,代理類實現的介面包名是錯誤的,試了試,自己手動改了就好了,在代理類內實現介面的相應方法就Ok了,(代理模式而已)。

 

WebService小記

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.