0
votes

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?

1

1 Answers

1
votes

The AuthenticationAdmin WSDL file is correct.

The logout operation is defined as a "One-way" operation. If you look at AuthenticationAdmin.java implementation, you can see logout method has following signature.

public void logout() throws AuthenticationException

Note that the return type is "void", which means there is no output.

WSO2 uses Apache Axis2 and there are no problems generating the client with Axis2.

I just tried creating a client with Eclipse & Apache Axis2. I could successfully create the stub.

WSO2 also uses the Service Stub created using AuthenticationAdmin WSDL. See pom.xml for more information about generating the client.

<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>

I'm getting the same error as you have shown, when I try to generate the client using Apache Axis. Therefore please make sure to use Apache Axis2 as the web service runtime. Also make sure you point Axis2 directory in Eclipse Preferences -> Web Services -> Axis2 Preferences.

I also see NetBeans try to use wsimport utility. May be it doesn't support one-way operations properly.

I recommend you to use Apache Axis2 to generate the client.