You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by paul nibin <ni...@gmail.com> on 2010/10/05 14:16:59 UTC

Exception while the code generation

Hi all,

I am trying to generate the stub code from a WSDL for a particular port
(HTTPPort to be specific) using WSDL2Java.

        WSDL2Java.main(new String[] { "-uri",
                "http://localhost:8500/justFuction.cfc?wsdl", "-o", ".",
"-uw",
                "-pn", "justFuction.cfcHttpEndpoint" });

But this is throwing an error..

Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException:
org.apache.axis2.wsdl.codegen.CodeGenerationException:
java.lang.RuntimeException: Element QName is null for
CFCInvocationException!
    at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:271)
    at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
    at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
    at ClientGenerator.main(ClientGenerator.java:13)
Caused by: org.apache.axis2.wsdl.codegen.CodeGenerationException:
java.lang.RuntimeException: Element QName is null for
CFCInvocationException!
    at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.emitStub(AxisServiceBasedMultiLanguageEmitter.java:533)
    at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:260)
    ... 3 more
Caused by: java.lang.RuntimeException: Element QName is null for
CFCInvocationException!
    at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.getFaultParamElements(AxisServiceBasedMultiLanguageEmitter.java:2908)
    at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.getFaultElement(AxisServiceBasedMultiLanguageEmitter.java:2827)
    at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.generateMethodElement(AxisServiceBasedMultiLanguageEmitter.java:2348)
    at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.loadOperations(AxisServiceBasedMultiLanguageEmitter.java:2224)
    at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.createDOMDocumentForCallbackHandler(AxisServiceBasedMultiLanguageEmitter.java:1213)
    at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.writeCallBackHandlers(AxisServiceBasedMultiLanguageEmitter.java:1179)
    at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.emitStub(AxisServiceBasedMultiLanguageEmitter.java:496)
    ... 4 more

I checked the WSDL generated.

<wsdl:binding name="justFuction.cfcHttpBinding"
type="ns:justFuction.cfcPortType">
    <http:binding verb="POST" />
    <wsdl:operation name="WelcomeMsg">
        <http:operation location="justFuction.cfc/WelcomeMsg" />
        <wsdl:input>
            <mime:content type="text/xml" part="WelcomeMsg" />
        </wsdl:input>
        <wsdl:output>
            <mime:content type="text/xml" part="WelcomeMsg" />
        </wsdl:output>
    </wsdl:operation>
</wsdl:binding>

In the binding the "fault" definition is missing. But it is defined in the
PortType.

<wsdl:portType name="justFuction.cfcPortType">
    <wsdl:operation name="WelcomeMsg">
        <wsdl:input message="ns:WelcomeMsgRequest"
wsaw:Action="urn:WelcomeMsg" />
        <wsdl:output message="ns:WelcomeMsgResponse"
wsaw:Action="urn:WelcomeMsgResponse" />
        <wsdl:fault message="ns:CFCInvocationException"
name="CFCInvocationException"
wsaw:Action="urn:WelcomeMsgCFCInvocationException" />
    </wsdl:operation>
</wsdl:portType>

The WSDL is autogenerated by axis 2.

Is this is a problem in Axis 2 code generation? Any one came across this
issue?

Also if I try to generate the stubs for all the ports by using "-ap" flag as
shown below

        WSDL2Java.main(new String[] { "-uri",
                "http://localhost:8500/justFuction.cfc?wsdl", "-o", ".",
"-uw",
                "-ap" });

Then the stubs are generated for all the ports including the stub for
HTTPPort(eventhough the fault definition is missing in the binding).

If anyone knows about this issue, please reply.

Thanks in advance,
Paul