I am using XMLBeans databinding to generate Java source from WSDL with
Axis1.5.1. org.apache.axis2.wsdl.codegen.CodeGenerationEngine is able to
successfully generate the code but when i try to call the web service with
generated stub i get following exception ....

org.apache.axis2.AxisFault: error: The document is not a
std_types_int2_inoutrespo...@http://gauntlet:8080/axis/EvipSvr.jws: document
element namespace mismatch expected "http://gauntlet:8080/axis/EvipSvr.jws";
got "http://DefaultNamespace";
    at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
    at
evipsvr20100111175651.EvipSvrServiceStub.fromOM(EvipSvrServiceStub.java:2286)
    at
evipsvr20100111175651.EvipSvrServiceStub.sTD_Types_INT2_inout(EvipSvrServiceStub.java:380)
    at clinet.Consumer.main(Consumer.java:20)
Caused by: org.apache.xmlbeans.XmlException: error: The document is not a
std_types_int2_inoutrespo...@http://gauntlet:8080/axis/EvipSvr.jws: document
element namespace mismatch expected "http://gauntlet:8080/axis/EvipSvr.jws";
got "http://DefaultNamespace";
    at
org.apache.xmlbeans.impl.store.Locale.verifyDocumentType(Locale.java:452)
    at
org.apache.xmlbeans.impl.store.Locale.autoTypeDocument(Locale.java:357)
    at
org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:850)
    at
org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:826)
    at
org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:231)
    at
evipsvr20100111175651.STDTypesINT2InoutResponseDocument$Factory.parse(STDTypesINT2InoutResponseDocument.java:159)
    at
evipsvr20100111175651.EvipSvrServiceStub.fromOM(EvipSvrServiceStub.java:2145)
    ... 2 more

Using same wsdl for source generattion with ADB generates code and able to
call web service with no problem.

I am using following method to set option parameters to be passed to
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.

public static Map fillOptionMap(boolean isAyncOnly, boolean isSyncOnly,
            boolean isServerSide, boolean isServerXML, boolean isTestCase,
            boolean isGenerateAll, String serviceName, String portName,
            String databindingName, String WSDLURI, String packageName,
            String selectedLanguage, String outputLocation,
            String namespace2packageList, boolean isServerSideInterface) {

        Map optionMap = new HashMap();
        optionMap.put("uri", new CommandLineOption("uri",
                getStringArray(WSDLURI)));


        if (true) {
            optionMap.put("s", new CommandLineOption("s",
                    new String[] { "true" }));
        }


        optionMap.put("p", new CommandLineOption("p",
                getStringArray(packageName)));
        optionMap.put("l", new CommandLineOption("l",
                getStringArray(selectedLanguage)));
        optionMap.put("o", new CommandLineOption("o",
                getStringArray(outputLocation)));
        if (databindingName != null) {
            optionMap.put("d", new CommandLineOption("d",
                    getStringArray(databindingName)));
        }



        if (namespace2packageList != null) {
            optionMap.put("ns2p", new CommandLineOption("ns2p",
                    getStringArray(namespace2packageList)));
        }

        optionMap.put("u", new CommandLineOption("u", new String[] { "true"
}));
        return optionMap;
    }

Can somebody please suggest me what is going wrong here. WSDL is certainly
not wrong as it is imported by ADB binding. Please find the wsdl attached
herewith.


Thanks & Regards,
Rahul Yadav

Attachment: EvipSvr.jws
Description: Binary data

Reply via email to