0

I have a NetBeans Project and tried to creat an Web Service client with the following WSDL from WSO2 ESB 4.6.0 like in this example:

https://localhost:9443/services/AuthenticationAdmin?wsdl

But when NetBeans tries to create the client I get an error: NetBeans Error adding Web Service Client

Why is this happening? I created other Web Service Clients, they are working, but this isn't working and I don't know why...

If I try it with eclipse I also get an error:

IWAB0399E Error in generating Java from WSDL:  java.io.IOException: ERROR: Missing <soap:fault> element inFault "AuthenticationAdminAuthenticationException" in operation "AuthenticationAdminAuthenticationException", in binding logout
    java.io.IOException: ERROR: Missing <soap:fault> element inFault "AuthenticationAdminAuthenticationException" in operation "AuthenticationAdminAuthenticationException", in binding logout
    at org.apache.axis.wsdl.symbolTable.SymbolTable.faultsFromSOAPFault(SymbolTable.java:2858)
    at org.apache.axis.wsdl.symbolTable.SymbolTable.populateBindings(SymbolTable.java:2549)
    at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:744)
    at org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:543)
    at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:518)
    at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
    at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
    at java.lang.Thread.run(Thread.java:722)

Maybe the WSDL has an error?

4

1 回答 1

1

AuthenticationAdmin WSDL文件是正确的。

注销操作被定义为“单向”操作。如果您查看AuthenticationAdmin.java实现,您可以看到注销方法具有以下签名。

public void logout() throws AuthenticationException

请注意,返回类型为“ void ”,表示没有输出。

WSO2 使用 Apache Axis2,使用 Axis2 生成客户端没有问题。

我刚刚尝试使用 Eclipse 和 Apache Axis2 创建一个客户端。我可以成功创建存根。

WSO2 还使用使用AuthenticationAdmin WSDL创建的服务存根。pom.xml有关生成客户端的更多信息,请参阅。

<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
    <arg line="-uri src/main/resources/AuthenticationAdmin.wsdl
    -u -uw -o target/generated-code
    -ns2p http://common.core.carbon.wso2.org/xsd=org.wso2.carbon.authenticator.stub.authentication,http://authentication.services.core.carbon.wso2.org=org.wso2.carbon.authenticator.stub,http://authentication.services.core.carbon.wso2.org/xsd=org.wso2.carbon.authenticator.stub"/>
    <classpath refid="wsdl2java.classpath"/>
</java>

当我尝试使用 Apache Axis 生成客户端时,我遇到了与您显示的相同的错误。因此,请确保使用Apache Axis2作为 Web 服务运行时。还要确保在 Eclipse 中指向 Axis2 目录Preferences -> Web Services -> Axis2 Preferences

我还看到 NetBeans 尝试使用 wsimport 实用程序。可能是它不能正确支持单向操作。

我建议您使用 Apache Axis2 来生成客户端。

于 2013-07-27T06:08:24.963 回答