Dear,

I guess my question is related.

The problem I'm facing is the following: I am creating a webservice, starting from a WSDL file. I need file attachments, and therefore I want to use MTOM.
I also need some kind of "inheritance" and therefore I'm creating complex types that are extensions of other types. Concretely I include something like the following:

    <xsd:complexType name="abc">
        <xsd:complexContent>
            <xsd:extension base="xyz">
                <xsd:sequence>
                    <xsd:element name="loFileZipped" type="xsd:base64Binary"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>


My experiences so far with Axis2 v0.94 are the following:
  • when using wsdl2java using ADB, the abc-type is not taken into account ==> no java class corresponding to this type is generated
  • when using wsdl2java using xmlbeans, an abc-javaclass is generated, including a variable byte[] getLoFileZipped()
    So this option seems to do the trick for me. However, in this case, I can't get MTOM working. The byte array is sent as inline xml within the SOAP message.
    I have (as far as I know) followed the instructions for using MTOM. I also successfully tested the MTOM sample that is included in the Axis2 distribution.

I think basically my question comes down to:
how can I use extension-complextypes in my wsdl, and still be able to use MTOM...

Any hints or suggestions on this are of course welcome...

thanks very much in advance,
best,
Michael...





On 03/15/06 16:28, robert lazarski wrote:
You need to use xmlbeans with this schema. While adb is the default, its not expected to cover all the cases that xmlbeans can. Try adding these options to your ant target:

<arg value="-d"/>
<arg value="xmlbeans"/>

Using those options I was able to run wsdl2java on your wsdl using the latest checkout. Without those I received the same error you did.

HTH,
Robert
http://www.braziloutsource.com/

On 3/14/06, Diego <[EMAIL PROTECTED] > wrote:
Hi Robert,

thanks a lot for your help!

That's the ant task that I've executed:


<target name="wsdl2java-astrodas-peer">
  <java classname="org.apache.axis2.wsdl.WSDL2Code"
     classpathref="axis2.classpath">
   <arg value="-uri" />
   <arg value="${astrodas-peer.wsdl}" />
   <arg value="-o" />
   <arg value="${src.dir}" />
   <arg value="-p" />
   <arg value="org.astrodas.ws.peer " />
  </java>
</target>


and that's the wsdl:


<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace=" http://astrodas.org/ws/peer"
                         xmlns:tns="http://astrodas.org/ws/peer"
                        xmlns:tns1="http://astrodas.org/ws/model"
                        xmlns:tns2=" http://www.ivoa.net/xml/VOTable/v1.1"
                        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                         xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <wsdl:types>
   <xsd:schema elementFormDefault="qualified"
targetNamespace=" http://astrodas.org/ws/model">
    <xsd:import namespace="http://www.w3.org/2001/XMLSchema" />
    <xsd:import namespace=" http://www.ivoa.net/xml/VOTable/v1.1"
schemaLocation="http://www.ivoa.net/xml/VOTable/v1.1" />
    <!-- insertMappingAnnotations -->
    <xsd:complexType name="external-object">
     <xsd:sequence>
      <xsd:element minOccurs="0" maxOccurs="1" name="id"
type="xsd:integer" />
      <xsd:element minOccurs="1" maxOccurs="1" name="external-id"
type="xsd:integer" />
      <xsd:element minOccurs="1" maxOccurs="1" name="external-db"
type="xsd:string" />
      <xsd:element minOccurs="1" maxOccurs="1" name="match"
type="xsd:boolean" />
     </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="annotation">
     <xsd:sequence>
      <xsd:element minOccurs="0" maxOccurs="1" name="id"
type="xsd:integer" />
      <xsd:element minOccurs="0" maxOccurs="1" name="type"
type="xsd:string" />
      <xsd:element minOccurs="1" maxOccurs="1" name="author"
type="xsd:string" />
      <xsd:element minOccurs="0" maxOccurs="1" name="timestamp"
type="xsd:string" />
     </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="mapping-annotation">
     <xsd:complexContent mixed="false">
      <xsd:extension base="tns1:annotation">
       <xsd:sequence>
        <xsd:element minOccurs="1" maxOccurs="unbounded"
name="external-object" type="tns1:external-object" />
        <xsd:element minOccurs="0" maxOccurs="1"         name="text"
         type="xsd:string" />
        <xsd:element minOccurs="0" maxOccurs="1"
name="reliability"     type="xsd:float" />
        <xsd:element minOccurs="0" maxOccurs="1"         name="ra-mean"
         type="xsd:double" />
        <xsd:element minOccurs="0" maxOccurs="1"         name="dec-mean"
        type="xsd:double" />
       </xsd:sequence>
      </xsd:extension>
     </xsd:complexContent>
    </xsd:complexType>
    <xsd:element name="insertMappingAnnotations">
     <xsd:complexType>
      <xsd:sequence>
       <xsd:element minOccurs="1" maxOccurs="unbounded"
name="mapping-annotation" type="tns1:mapping-annotation" />
      </xsd:sequence>
     </xsd:complexType>
    </xsd:element>
    <xsd:element name="insertMappingAnnotationsResponse">
     <xsd:complexType>
      <xsd:sequence>
       <xsd:element minOccurs="1" maxOccurs="1" name="result"
type="xsd:int" />
      </xsd:sequence>
     </xsd:complexType>
    </xsd:element>
    <!-- executeGlobalMappingTableQuery -->
    <xsd:element name="executeGlobalMappingTableQuery">
     <xsd:complexType>
      <xsd:sequence>
       <xsd:element minOccurs="1" maxOccurs="1" name="query"
type="xsd:string" />
      </xsd:sequence>
     </xsd:complexType>
    </xsd:element>
    <xsd:element name="executeGlobalMappingTableQueryResponse">
     <xsd:complexType>
      <xsd:sequence>
       <xsd:element minOccurs="1" maxOccurs="1" ref="tns2:VOTABLE" />
      </xsd:sequence>
     </xsd:complexType>
    </xsd:element>
   </xsd:schema>
  </wsdl:types>

  <!-- insertMappingAnnotations -->
  <wsdl:message name="insertMappingAnnotationsMessage">
   <wsdl:part name="body" element="tns1:insertMappingAnnotations" />
  </wsdl:message>
  <wsdl:message name="insertMappingAnnotationsResponseMessage">
   <wsdl:part name="body" element="tns1:insertMappingAnnotationsResponse" />
  </wsdl:message>
  <!-- executeGlobalMappingTableQuery -->
  <wsdl:message name="executeGlobalMappingTableQueryMessage">
   <wsdl:part name="body" element="tns1:executeGlobalMappingTableQuery" />
  </wsdl:message>
  <wsdl:message name="executeGlobalMappingTableQueryResponseMessage">
   <wsdl:part name="body"
element="tns1:executeGlobalMappingTableQueryResponse" />
  </wsdl:message>

  <wsdl:portType name="AstrodasPeer">
   <wsdl:operation name="insertMappingAnnotations">
    <wsdl:documentation>Stores an array of annotations in the annotation
backend database</wsdl:documentation>
    <wsdl:input message="tns:insertMappingAnnotationsMessage" />
    <wsdl:output message="tns:insertMappingAnnotationsResponseMessage" />
   </wsdl:operation>
   <wsdl:operation name="executeGlobalMappingTableQuery">
    <wsdl:documentation>Executes a query on the global mapping table of
the p2p network of annotation</wsdl:documentation>
    <wsdl:input message="tns:executeGlobalMappingTableQueryMessage" />
    <wsdl:output
message="tns:executeGlobalMappingTableQueryResponseMessage" />
   </wsdl:operation>
  </wsdl:portType>

  <wsdl:binding name="AstrodasPeerBinding" type="tns:AstrodasPeer">
   <soap:binding transport="http://schemas.xmlsoap.org/soap/http "
style="document" />
   <wsdl:operation name="insertMappingAnnotations">
    <soap:operation soapAction="insertMappingAnnotations" />
    <wsdl:input>
     <soap:body use="literal" />
    </wsdl:input>
    <wsdl:output>
     <soap:body use="literal" />
    </wsdl:output>
   </wsdl:operation>
   <wsdl:operation name="executeGlobalMappingTableQuery">
    <soap:operation soapAction="executeGlobalMappingTableQuery" />
    <wsdl:input>
     <soap:body use="literal" />
    </wsdl:input>
    <wsdl:output>
     <soap:body use="literal" />
    </wsdl:output>
   </wsdl:operation>
  </wsdl:binding>

  <wsdl:service name="astrodas-peer">
   <wsdl:port name="astrodas-peer" binding="tns:AstrodasPeerBinding">
    <soap:address
location="http://localhost:8080/axis2/services/astrodas-peer" />
   </wsdl:port>
  </wsdl:service>

</wsdl:definitions>


Thanks!

Diego


robert lazarski wrote:
> Hi Diego,
>
> Post your wsdl and command line options and perhaps we can help.
>
> Robert
> http://www.braziloutsource.com/
>
> On 3/14/06, *Diego* <[EMAIL PROTECTED] <mailto: [EMAIL PROTECTED]>>
> wrote:
>
>     Hi!
>
>     I have to generate code using org.apache.axis2.wsdl.WSDL2Code having in
>     input a wsdl where some web service return a votable.  The votable
>     schema is specified at the following address:
>
>     http://www.ivoa.net/xml/VOTable/v1.1
>
>     I've successfully executed wsdl2code with axis2 up to version 0.93.  Now
>     I'm using axis2 v0.94 and I have also checked out and build v0.95.  With
>     both these versions I get the following exception:
>
>     org.apache.axis2.wsdl.codegen.CodeGenerationException :
>     java.lang.RuntimeException: java.lang.RuntimeException: Schema for
>     namespace 'http://www.ivoa.net/xml/VOTable/v1.1' already contains type
>     'token
>          at
>     org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:180)
>          at org.apache.tools.ant.taskdefs.Java.run(Java.java:710)
>          at org.apache.tools.ant.taskdefs.Java.executeJava (Java.java:178)
>          at org.apache.tools.ant.taskdefs.Java.execute(Java.java:84)
>          at
>     org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>          at org.apache.tools.ant.Task.perform (Task.java:364)
>          at org.apache.tools.ant.Target.execute (Target.java:341)
>          at org.apache.tools.ant.Target.performTasks(Target.java:369)
>          at
>     org.apache.tools.ant.Project.executeSortedTargets (Project.java:1216)
>          at
>     org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets
>     (SingleCheckExecutor.java:37)
>          at org.apache.tools.ant.Project.executeTargets( Project.java:1068)
>          at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
>          at
>     org.apache.tools.ant.taskdefs.CallTarget.execute (CallTarget.java:107)
>          at
>     org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>          at org.apache.tools.ant.Task.perform(Task.java:364)
>          at org.apache.tools.ant.Target.execute(Target.java:341)
>          at org.apache.tools.ant.Target.performTasks(Target.java:369)
>          at
>     org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>          at org.apache.tools.ant.Project.executeTarget (Project.java:1185)
>          at
>     org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
>          at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>          at org.apache.tools.ant.Main.runBuild(Main.java :668)
>          at org.apache.tools.ant.Main.startAnt(Main.java:187)
>          at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
>          at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
>
>     Thanks for any help!
>
>     Diego
>
>
>
>


-- 
Michael Meire
Katholieke Universiteit Leuven
Dept. Computer Science
Celestijnenlaan 200A, A03.33
B-3001 Leuven, Belgium
Tel: +32 16 327660
Fax: +32 16 327996


Reply via email to