这个问题找了好多地方都没有结果,自己暂且总结一下吧,也不算是解决问题的根本途径,但是也不失为一种办法。当时用了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了,(代理模式而已)。