Hi everyone,

First of all, a big thanks for the project team for a great product! I'm new to WS and decided to start with Axis2 and generate code from WSDL. I'm developing a service which utilizes MTOM for transferring images. After finally (hopefully) figuring out how to do this in WSDL, I'm trying to generate code for it. Since my schema isn't all that complicated I gave ADB a shot. Release 1.0 generated code without errors, but it didn't generate any data holding classes, leaving me with OMElements in the skeleton. From examples I saw that this wasn't the way it should be. So I tried the latest nightly build (July 13), but WSDL2Java died with the following stack trace. XMLBeans binding worked perfectly. Now, I know ADB is limited, but it should be able to handle MTOM, right? Please find my (simplified) WSDL below.

Juho


Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate (CodeGenerationEngine.java:235)
        at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
        at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
        at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:52)
        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:188)
        ... 2 more
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage (SimpleDBExtension.java:49)
        ... 3 more
Caused by: org.apache.axis2.schema.SchemaCompilationException: Unsupported content Simple Content Extension !
        at org.apache.axis2.schema.SchemaCompiler.processSimpleContent (SchemaCompiler.java:917)
        at org.apache.axis2.schema.SchemaCompiler.processContentModel(SchemaCompiler.java:786)
        at org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:768)
        at org.apache.axis2.schema.SchemaCompiler.processNamedComplexSchemaType(SchemaCompiler.java:718)
        at org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:674)
        at org.apache.axis2.schema.SchemaCompiler.processElement (SchemaCompiler.java:414)
        at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:375)
        at org.apache.axis2.schema.SchemaCompiler.process(SchemaCompiler.java:1017)
        at org.apache.axis2.schema.SchemaCompiler.processParticle (SchemaCompiler.java:980)
        at org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:745)
        at org.apache.axis2.schema.SchemaCompiler.processNamedComplexSchemaType(SchemaCompiler.java :718)
        at org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:674)
        at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:526)
        at org.apache.axis2.schema.SchemaCompiler.processElement (SchemaCompiler.java:375)
        at org.apache.axis2.schema.SchemaCompiler.process(SchemaCompiler.java:1017)
        at org.apache.axis2.schema.SchemaCompiler.processParticle(SchemaCompiler.java:980)
        at org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:745)
        at org.apache.axis2.schema.SchemaCompiler.processAnonymousComplexSchemaType(SchemaCompiler.java:692)
        at org.apache.axis2.schema.SchemaCompiler.processSchema (SchemaCompiler.java:676)
        at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:414)
        at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:385)
        at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:265)
        at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:209)
        at org.apache.axis2.schema.ExtensionUtility.invoke(ExtensionUtility.java :77)

<?xml version="1.0" encoding="UTF-8" ?>

<definitions name="mrelay"
    targetNamespace="http://example/mrelay"
    xmlns:tns="http://example/mrelay"
    xmlns:types="http://example/mrelay/types"
    xmlns:xs=" http://www.w3.org/2001/XMLSchema"
    xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
    xmlns:soap=" http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns="http://schemas.xmlsoap.org/wsdl/">

    <types>
        <schema targetNamespace=" http://example/mrelay/types"
            xmlns="http://www.w3.org/2001/XMLSchema"
            xmlns:xmime=" http://www.w3.org/2005/05/xmlmime"
            elementFormDefault="qualified">

            <import namespace=" http://www.w3.org/2005/05/xmlmime" schemaLocation="xsd0.xsd"/>

             <complexType name="AnnouncementHeaderType">
                <sequence>
                    <element name="msgId" type="xs:long"/>
                    <element name="timestamp" type="xs:dateTime"/>
                    <element name="mserverId" type="xs:string" maxOccurs="unbounded"/>
                </sequence>
            </complexType>
           
            <complexType name="AnnouncementType">
                <sequence>
                    <element name="startDate" type="xs:date"/>
                    <element name="endDate" type="xs:date"/>
                    <element name="position" type="xs:int"/>
                    <element name="author" type="xs:string"/>
                    <element name="title" type="xs:string"/>
                    <element name="body" type="xs:string"/>
                    <element name="xhtmlTag" type="xs:string"/>
                </sequence>
            </complexType>
           
            <complexType name="ImageType">
                <sequence>
                    <element name="fileName" type="xs:string"/>
                    <element name="alignment" type="xs:int"/>
                    <element name="data" type="types:BinaryDataType" xmime:expectedContentTypes="image/jpeg, image/png, image/gif"/>
                    <!-- I also tried with type="xmime:Base64Binary" with the same result -->
                </sequence>
            </complexType>

            <complexType name="BinaryDataType">
                <simpleContent>
                    <extension base="base64Binary">
                        <attribute ref="xmime:contentType" use="required"/>
                    </extension>
                </simpleContent>
            </complexType>
                       
        </schema>
    </types>

    <message name="CreateAnnouncementWithImageRequest">
        <part name="header" type="types:AnnouncementHeaderType"/>
        <part name="announcement" type="types:AnnouncementType"/>
        <part name="image" type="types:ImageType"/>
    </message>

    <message name="DeleteAnnouncementRequest">
        <part name="header" type="types:AnnouncementHeaderType"/>
    </message>

    <portType name="mrelayPortType">
        <operation name="createAnnouncementWithImage">
            <input message="tns:CreateAnnouncementWithImageRequest"/>
        </operation>
       
        <operation name="deleteAnnouncement">
            <input message="tns:DeleteAnnouncementRequest"/>
        </operation>
    </portType>

    <binding name="mrelayBinding" type="tns:mrelayPortType">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
           
        <operation name="createAnnouncementWithImage">
            <soap:operation soapAction="createAnnouncementWithImage"/>
            <input>
                <soap:body parts="header announcement image" namespace=" http://example/mrelay" use="literal"/>
            </input>
        </operation>

        <operation name="deleteAnnouncement">
            <soap:operation soapAction="deleteAnnouncement"/>
            <input>
                <soap:body parts="header" namespace="http://example/mrelay" use="literal"/>
            </input>
        </operation>
                       
    </binding>
   
    <service name="mrelay">
        <documentation>Documentation</documentation>
        <port binding="tns:mrelayBinding" name="mrelayPort">
            <soap:address location="http://localhost:8080/axis2/services/mrelay"/>
        </port>
    </service>
   
</definitions>

Reply via email to