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 st...@bt.com on 2007/08/03 15:27:21 UTC

[Axis2 1.2] Unresolved symbol when using attribute

I am using Axis2 1.2 and the AntCodegenTask.

I have been struggling with the following error in some vendor supplied
wsdl. I use the wsdl2java ant task to generate the java code and then
get this compiler error.

compile:
    [mkdir] Created dir: /home/sjh/Misc/xml/soapTest/classes
    [javac] Compiling 8 source files to
/home/sjh/Misc/xml/soapTest/classes
    [javac]
/home/sjh/Misc/xml/soapTest/java/src/localhost/testwsdl/Message.java:28:
cannot resolve symbol
    [javac] symbol  : variable localSequenceTracker
    [javac] location: class localhost.testwsdl.Message
    [javac]                    localSequenceTracker = false;
    [javac]                    ^
    [javac] 1 error

Looking in the java the Message class extends an abstract class
AbstractMessage, which defines a protected variable "sequence". The
message class then tries to the tracker for this variable but does not
declare the tracker.

I have stripped the wsdl down to a simple test case, the key fragment is
shown below.

<!-- ==================== Test Fragment
=================================== -->
<!-- ==================== Types
=========================================== -->

  <wsdl:types>
    <xsd:schema
      targetNamespace="http://localhost/testWsdl"
      >

      <xsd:complexType name="abstractMessage" abstract="true">
	<xsd:attribute name="sequence" type="xsd:unsignedLong"/>
      </xsd:complexType>

      <xsd:complexType name="message">
	<xsd:complexContent>
	  <xsd:extension base="test:abstractMessage">
	    <xsd:choice>
	      <xsd:element name="userId" type="xsd:string"/>
	      <xsd:element name="content" type="xsd:string"/>
	    </xsd:choice>
	  </xsd:extension>
	</xsd:complexContent>
      </xsd:complexType>

      <xsd:element name="messageReq" type="test:message"/>
      <xsd:element name="messageResp" type="test:message"/>
    </xsd:schema>
  </wsdl:types>

<!-- ==================== Messages
======================================== -->

  <wsdl:message name="messageRequest">
    <wsdl:part name="parameters" element="test:messageReq"/>
  </wsdl:message>
  <wsdl:message name="messageResponse">
    <wsdl:part name="parameters" element="test:messageResp"/>
  </wsdl:message>

<!-- ==================== End Of Test Fragment
============================ --> 

The key features of this fragment that cause the bug are that
1) The variable in the abstract type is declared as an attribute, not an
element
2) The elements in the extended type are declared in choice tags.

Is this an AXIS2 bug or is just a bad XSD? If a bug should I create a
JIRA? I cannot see any reports of this in either the mailing list or the
JIRA repository.

Can anybody suggest a work around that would produce exactly the same
SOAP, as I am using this against a 3rd party interface (supplied by a
large San Francisco based router manufacturer that shall remain
nameless) so have no control over the format of the messages.

I did try to replicate this in 1.3 RC2 but I see that the wsdl2java task
was omitted. I notice as I am writing this that RC3 has just been
released so I will test against that later today.
 

Steve Hindmarch



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [Axis2 1.2] Unresolved symbol when using attribute

Posted by Davanum Srinivas <da...@gmail.com>.
Steve,

I've created a JIRA issue:
https://issues.apache.org/jira/browse/AXIS2-3066

thanks,
dims

On 8/3/07, stephen.hindmarch@bt.com <st...@bt.com> wrote:
> OK.
>
> Here is the build.xml
> <!--Start Build XML -->
> <?xml version='1.0' encoding='UTF-8' ?>
> <!--
>     $Author: sjh $
>     $Revision: 108 $
>     $Date: 2007-08-03 15:22:13 +0100 (Fri, 03 Aug 2007) $
>
>     Build file for testing wsdl
>     Copyright (c) British Telecommunications plc 2007
> -->
> <project name="Test WSDL2Java" default="compile" basedir=".">
>
> <!-- ==================== External Dependencies ========== -->
>
>   <!-- Locations -->
>   <property name="classes" value="${basedir}/classes"/>
>   <property name="java" value="${basedir}/java"/>
>   <property name="source" value="${java}/src"/>
>
>   <!-- WSDL -->
>   <property name="wsdl.file" value="test.wsdl"/>
>
>   <!-- Downloads Under Test -->
>   <property name="test.downloads" value="${user.home}/.downloads"/>
>   <property name="axis2.v1_2" value="${test.downloads}/axis2-1.2"/>
>   <property name="axis2.v1_3" value="${test.downloads}/axis2-1.3-RC3"/>
>   <property name="axis2.home" value="${axis2.v1_3}"/>
>
>   <!-- Axis -->
>   <property name="axis2.lib" value="${axis2.home}/lib"/>
>   <path id="axis.classpath">
>     <fileset dir="${axis2.lib}">
>       <include name="**/*.jar"/>
>     </fileset>
>   </path>
>   <taskdef name="wsdl2java"
>     classname="org.apache.axis2.tool.ant.AntCodegenTask"
>     classpathref="axis.classpath" />
>
> <!-- ==================== WSDL Target ==================== -->
>
>   <target name="wsdl-client"
>     description="Generate WSDL implementation classes for the client
> side"
>     >
>
>     <wsdl2java
>       wsdlfilename="${wsdl.file}"
>       output="${java}/"
>       unpackClasses="true"
>       />
>
>   </target>
>   <target name="wsdl" depends="wsdl-client"
>     description="Generate the classes required for a default build"/>
>
> <!-- ==================== Compile Target ================= -->
>
>   <target name="compile"
>     description="Compile generated SOAP classes">
>
>     <mkdir dir="${classes}"/>
>
>     <javac srcdir="${source}" destdir="${classes}"
>       classpathref="axis.classpath"/>
>
>   </target>
>
> <!-- ==================== Clean Target =================== -->
>
>   <target name="clean"
>     description="Remove auto-generated WSDL implementation classes">
>
>     <delete dir="${classes}"/>
>     <delete dir="${source}"/>
>     <delete dir="${java}"/>
>
>   </target>
>
> <!-- ==================== END OF PROJECT ================= -->
>
> </project>
>
> <!-- ==================== End ============================ -->
> <!-- End Build XML -->
>
>
> And here is the WSDL file
>
> <!-- Start Test WSDL -->
> <?xml version='1.0' encoding='UTF-8' ?>
> <!--
>     $Author: sjh $
>     $Revision: 107 $
>     $Date: 2007-08-03 15:21:15 +0100 (Fri, 03 Aug 2007) $
>
>     Service definition for SOAP testing
>     Copyright (c) British Telecommunications plc 2007
> -->
>
> <wsdl:definitions
>   name="testWsdl"
>   targetNamespace="http://localhost/testWsdl"
>   xmlns="http://schemas.xmlsoap.org/wsdl/"
>   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>   xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
>   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>   xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>   xmlns:test="http://localhost/testWsdl"
>   >
>
> <!-- ==================== Types ========================== -->
>
>   <wsdl:types>
>     <xsd:schema
>       targetNamespace="http://localhost/testWsdl"
>       >
>
>       <xsd:complexType name="abstractMessage" abstract="true">
>         <xsd:attribute name="sequence" type="xsd:unsignedLong"/>
>       </xsd:complexType>
>
>       <xsd:complexType name="message">
>         <xsd:complexContent>
>           <xsd:extension base="test:abstractMessage">
>             <xsd:choice>
>               <xsd:element name="userId" type="xsd:string"/>
>               <xsd:element name="content" type="xsd:string"/>
>             </xsd:choice>
>           </xsd:extension>
>         </xsd:complexContent>
>       </xsd:complexType>
>
>       <xsd:element name="messageReq" type="test:message"/>
>       <xsd:element name="messageResp" type="test:message"/>
>     </xsd:schema>
>   </wsdl:types>
>
> <!-- ==================== Messages ======================= -->
>
>   <wsdl:message name="messageRequest">
>     <wsdl:part name="parameters" element="test:messageReq"/>
>   </wsdl:message>
>   <wsdl:message name="messageResponse">
>     <wsdl:part name="parameters" element="test:messageResp"/>
>   </wsdl:message>
>
> <!-- ==================== PortType Operations ============ -->
>
>   <wsdl:portType name="MessagePortType">
>     <wsdl:operation name="sendMessage">
>       <wsdl:input message="test:messageRequest"/>
>       <wsdl:output message="test:messageResponse"/>
>     </wsdl:operation>
>   </wsdl:portType>
>
> <!-- ==================== Protocol Binding =============== -->
>
>   <wsdl:binding name="MessageBinding" type="test:MessagePortType">
>     <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
>       style="document"/>
>     <wsdl:operation name="sendMessage">
>       <soap:operation soapAction=""/>
>       <wsdl:input>
>         <soap:body use="literal"/>
>       </wsdl:input>
>       <wsdl:output>
>         <soap:body use="literal"/>
>       </wsdl:output>
>     </wsdl:operation>
>   </wsdl:binding>
>
> <!-- ==================== Service Name =================== -->
>
>   <wsdl:service name="TestMessageService">
>     <wsdl:port name="TestPort" binding="test:MessageBinding">
>       <soap:address location="https://localhost/wsdlTest/"/>
>     </wsdl:port>
>   </wsdl:service>
>
> <!-- ==================== End ============================ -->
>
> </wsdl:definitions>
>
> <!-- ===================================================== -->
> <!-- End Test WSDL -->
>
> If you need any more then please let me know
>
> Steve Hindmarch
>
> > -----Original Message-----
> > From: Davanum Srinivas [mailto:davanum@gmail.com]
> > Sent: 03 August 2007 15:18
> > To: Hindmarch,SJ,Stephen,XJE11 R
> > Cc: axis-user@ws.apache.org
> > Subject: Re: [Axis2 1.2] Unresolved symbol when using attribute
> >
> > Yes please.
> >
> > -- dims
> >
> > On 8/3/07, stephen.hindmarch@bt.com <st...@bt.com> wrote:
> > > Srinivas,
> > >
> > > I have now tried it with RC3 and the problem is identical.
> > >
> > > Would you like me upload the full wsdl and build files for
> > my test case?
> > >
> > > Steve Hindmarch
> > >
> > >
> > >
>


-- 
Davanum Srinivas :: http://davanum.wordpress.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: [Axis2 1.2] Unresolved symbol when using attribute

Posted by st...@bt.com.
OK.

Here is the build.xml
<!--Start Build XML -->
<?xml version='1.0' encoding='UTF-8' ?>
<!--
    $Author: sjh $
    $Revision: 108 $
    $Date: 2007-08-03 15:22:13 +0100 (Fri, 03 Aug 2007) $

    Build file for testing wsdl
    Copyright (c) British Telecommunications plc 2007
-->
<project name="Test WSDL2Java" default="compile" basedir=".">

<!-- ==================== External Dependencies ========== -->

  <!-- Locations -->
  <property name="classes" value="${basedir}/classes"/>
  <property name="java" value="${basedir}/java"/>
  <property name="source" value="${java}/src"/>

  <!-- WSDL -->
  <property name="wsdl.file" value="test.wsdl"/>

  <!-- Downloads Under Test -->
  <property name="test.downloads" value="${user.home}/.downloads"/>
  <property name="axis2.v1_2" value="${test.downloads}/axis2-1.2"/>
  <property name="axis2.v1_3" value="${test.downloads}/axis2-1.3-RC3"/>
  <property name="axis2.home" value="${axis2.v1_3}"/>

  <!-- Axis -->
  <property name="axis2.lib" value="${axis2.home}/lib"/>
  <path id="axis.classpath">
    <fileset dir="${axis2.lib}">
      <include name="**/*.jar"/>
    </fileset>
  </path>
  <taskdef name="wsdl2java" 
    classname="org.apache.axis2.tool.ant.AntCodegenTask" 
    classpathref="axis.classpath" />

<!-- ==================== WSDL Target ==================== -->

  <target name="wsdl-client"
    description="Generate WSDL implementation classes for the client
side"
    >

    <wsdl2java
      wsdlfilename="${wsdl.file}"
      output="${java}/"
      unpackClasses="true"
      />

  </target>
  <target name="wsdl" depends="wsdl-client"
    description="Generate the classes required for a default build"/>

<!-- ==================== Compile Target ================= -->

  <target name="compile"
    description="Compile generated SOAP classes">

    <mkdir dir="${classes}"/>

    <javac srcdir="${source}" destdir="${classes}"
      classpathref="axis.classpath"/>

  </target>

<!-- ==================== Clean Target =================== -->

  <target name="clean"
    description="Remove auto-generated WSDL implementation classes">

    <delete dir="${classes}"/>
    <delete dir="${source}"/>
    <delete dir="${java}"/>
    
  </target>

<!-- ==================== END OF PROJECT ================= -->

</project>

<!-- ==================== End ============================ -->
<!-- End Build XML -->


And here is the WSDL file

<!-- Start Test WSDL -->
<?xml version='1.0' encoding='UTF-8' ?>
<!--
    $Author: sjh $
    $Revision: 107 $
    $Date: 2007-08-03 15:21:15 +0100 (Fri, 03 Aug 2007) $

    Service definition for SOAP testing
    Copyright (c) British Telecommunications plc 2007
-->

<wsdl:definitions
  name="testWsdl"
  targetNamespace="http://localhost/testWsdl"
  xmlns="http://schemas.xmlsoap.org/wsdl/"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:test="http://localhost/testWsdl"
  >

<!-- ==================== Types ========================== -->

  <wsdl:types>
    <xsd:schema
      targetNamespace="http://localhost/testWsdl"
      >

      <xsd:complexType name="abstractMessage" abstract="true">
	<xsd:attribute name="sequence" type="xsd:unsignedLong"/>
      </xsd:complexType>

      <xsd:complexType name="message">
	<xsd:complexContent>
	  <xsd:extension base="test:abstractMessage">
	    <xsd:choice>
	      <xsd:element name="userId" type="xsd:string"/>
	      <xsd:element name="content" type="xsd:string"/>
	    </xsd:choice>
	  </xsd:extension>
	</xsd:complexContent>
      </xsd:complexType>

      <xsd:element name="messageReq" type="test:message"/>
      <xsd:element name="messageResp" type="test:message"/>
    </xsd:schema>
  </wsdl:types>

<!-- ==================== Messages ======================= -->

  <wsdl:message name="messageRequest">
    <wsdl:part name="parameters" element="test:messageReq"/>
  </wsdl:message>
  <wsdl:message name="messageResponse">
    <wsdl:part name="parameters" element="test:messageResp"/>
  </wsdl:message>

<!-- ==================== PortType Operations ============ -->

  <wsdl:portType name="MessagePortType">
    <wsdl:operation name="sendMessage">
      <wsdl:input message="test:messageRequest"/>
      <wsdl:output message="test:messageResponse"/>
    </wsdl:operation>
  </wsdl:portType>

<!-- ==================== Protocol Binding =============== -->

  <wsdl:binding name="MessageBinding" type="test:MessagePortType">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" 
      style="document"/>
    <wsdl:operation name="sendMessage">
      <soap:operation soapAction=""/>
      <wsdl:input>
	<soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
	<soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>    
  </wsdl:binding>

<!-- ==================== Service Name =================== -->

  <wsdl:service name="TestMessageService">
    <wsdl:port name="TestPort" binding="test:MessageBinding">
      <soap:address location="https://localhost/wsdlTest/"/>
    </wsdl:port>
  </wsdl:service>

<!-- ==================== End ============================ -->

</wsdl:definitions>

<!-- ===================================================== -->
<!-- End Test WSDL -->

If you need any more then please let me know

Steve Hindmarch

> -----Original Message-----
> From: Davanum Srinivas [mailto:davanum@gmail.com] 
> Sent: 03 August 2007 15:18
> To: Hindmarch,SJ,Stephen,XJE11 R
> Cc: axis-user@ws.apache.org
> Subject: Re: [Axis2 1.2] Unresolved symbol when using attribute
> 
> Yes please.
> 
> -- dims
> 
> On 8/3/07, stephen.hindmarch@bt.com <st...@bt.com> wrote:
> > Srinivas,
> >
> > I have now tried it with RC3 and the problem is identical.
> >
> > Would you like me upload the full wsdl and build files for 
> my test case?
> >
> > Steve Hindmarch
> >
> >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [Axis2 1.2] Unresolved symbol when using attribute

Posted by Davanum Srinivas <da...@gmail.com>.
Yes please.

-- dims

On 8/3/07, stephen.hindmarch@bt.com <st...@bt.com> wrote:
> Srinivas,
>
> I have now tried it with RC3 and the problem is identical.
>
> Would you like me upload the full wsdl and build files for my test case?
>
> Steve Hindmarch
>
>
>
> > -----Original Message-----
> > From: Davanum Srinivas [mailto:davanum@gmail.com]
> > Sent: 03 August 2007 14:39
> > To: axis-user@ws.apache.org
> > Subject: Re: [Axis2 1.2] Unresolved symbol when using attribute
> >
> > RC3 has the wsdl2java task :) Yes, please try that.
> >
> > -- dims
> >
> > On 8/3/07, stephen.hindmarch@bt.com <st...@bt.com> wrote:
> > > I am using Axis2 1.2 and the AntCodegenTask.
> > >
> > > I have been struggling with the following error in some
> > vendor supplied
> > > wsdl. I use the wsdl2java ant task to generate the java
> > code and then
> > > get this compiler error.
> > >
> > > compile:
> > >     [mkdir] Created dir: /home/sjh/Misc/xml/soapTest/classes
> > >     [javac] Compiling 8 source files to
> > > /home/sjh/Misc/xml/soapTest/classes
> > >     [javac]
> > >
> > /home/sjh/Misc/xml/soapTest/java/src/localhost/testwsdl/Messag
> > e.java:28:
> > > cannot resolve symbol
> > >     [javac] symbol  : variable localSequenceTracker
> > >     [javac] location: class localhost.testwsdl.Message
> > >     [javac]                    localSequenceTracker = false;
> > >     [javac]                    ^
> > >     [javac] 1 error
> > >
> > > Looking in the java the Message class extends an abstract class
> > > AbstractMessage, which defines a protected variable "sequence". The
> > > message class then tries to the tracker for this variable
> > but does not
> > > declare the tracker.
> > >
> > > I have stripped the wsdl down to a simple test case, the
> > key fragment is
> > > shown below.
> > >
> > > <!-- ==================== Test Fragment
> > > =================================== -->
> > > <!-- ==================== Types
> > > =========================================== -->
> > >
> > >   <wsdl:types>
> > >     <xsd:schema
> > >       targetNamespace="http://localhost/testWsdl"
> > >       >
> > >
> > >       <xsd:complexType name="abstractMessage" abstract="true">
> > >         <xsd:attribute name="sequence" type="xsd:unsignedLong"/>
> > >       </xsd:complexType>
> > >
> > >       <xsd:complexType name="message">
> > >         <xsd:complexContent>
> > >           <xsd:extension base="test:abstractMessage">
> > >             <xsd:choice>
> > >               <xsd:element name="userId" type="xsd:string"/>
> > >               <xsd:element name="content" type="xsd:string"/>
> > >             </xsd:choice>
> > >           </xsd:extension>
> > >         </xsd:complexContent>
> > >       </xsd:complexType>
> > >
> > >       <xsd:element name="messageReq" type="test:message"/>
> > >       <xsd:element name="messageResp" type="test:message"/>
> > >     </xsd:schema>
> > >   </wsdl:types>
> > >
> > > <!-- ==================== Messages
> > > ======================================== -->
> > >
> > >   <wsdl:message name="messageRequest">
> > >     <wsdl:part name="parameters" element="test:messageReq"/>
> > >   </wsdl:message>
> > >   <wsdl:message name="messageResponse">
> > >     <wsdl:part name="parameters" element="test:messageResp"/>
> > >   </wsdl:message>
> > >
> > > <!-- ==================== End Of Test Fragment
> > > ============================ -->
> > >
> > > The key features of this fragment that cause the bug are that
> > > 1) The variable in the abstract type is declared as an
> > attribute, not an
> > > element
> > > 2) The elements in the extended type are declared in choice tags.
> > >
> > > Is this an AXIS2 bug or is just a bad XSD? If a bug should
> > I create a
> > > JIRA? I cannot see any reports of this in either the
> > mailing list or the
> > > JIRA repository.
> > >
> > > Can anybody suggest a work around that would produce
> > exactly the same
> > > SOAP, as I am using this against a 3rd party interface
> > (supplied by a
> > > large San Francisco based router manufacturer that shall remain
> > > nameless) so have no control over the format of the messages.
> > >
> > > I did try to replicate this in 1.3 RC2 but I see that the
> > wsdl2java task
> > > was omitted. I notice as I am writing this that RC3 has just been
> > > released so I will test against that later today.
> > >
> > >
> > > Steve Hindmarch
> > >
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> >
> > --
> > Davanum Srinivas :: http://davanum.wordpress.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>


-- 
Davanum Srinivas :: http://davanum.wordpress.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: [Axis2 1.2] Unresolved symbol when using attribute

Posted by st...@bt.com.
Srinivas,

I have now tried it with RC3 and the problem is identical.

Would you like me upload the full wsdl and build files for my test case?

Steve Hindmarch
 
 

> -----Original Message-----
> From: Davanum Srinivas [mailto:davanum@gmail.com] 
> Sent: 03 August 2007 14:39
> To: axis-user@ws.apache.org
> Subject: Re: [Axis2 1.2] Unresolved symbol when using attribute
> 
> RC3 has the wsdl2java task :) Yes, please try that.
> 
> -- dims
> 
> On 8/3/07, stephen.hindmarch@bt.com <st...@bt.com> wrote:
> > I am using Axis2 1.2 and the AntCodegenTask.
> >
> > I have been struggling with the following error in some 
> vendor supplied
> > wsdl. I use the wsdl2java ant task to generate the java 
> code and then
> > get this compiler error.
> >
> > compile:
> >     [mkdir] Created dir: /home/sjh/Misc/xml/soapTest/classes
> >     [javac] Compiling 8 source files to
> > /home/sjh/Misc/xml/soapTest/classes
> >     [javac]
> > 
> /home/sjh/Misc/xml/soapTest/java/src/localhost/testwsdl/Messag
> e.java:28:
> > cannot resolve symbol
> >     [javac] symbol  : variable localSequenceTracker
> >     [javac] location: class localhost.testwsdl.Message
> >     [javac]                    localSequenceTracker = false;
> >     [javac]                    ^
> >     [javac] 1 error
> >
> > Looking in the java the Message class extends an abstract class
> > AbstractMessage, which defines a protected variable "sequence". The
> > message class then tries to the tracker for this variable 
> but does not
> > declare the tracker.
> >
> > I have stripped the wsdl down to a simple test case, the 
> key fragment is
> > shown below.
> >
> > <!-- ==================== Test Fragment
> > =================================== -->
> > <!-- ==================== Types
> > =========================================== -->
> >
> >   <wsdl:types>
> >     <xsd:schema
> >       targetNamespace="http://localhost/testWsdl"
> >       >
> >
> >       <xsd:complexType name="abstractMessage" abstract="true">
> >         <xsd:attribute name="sequence" type="xsd:unsignedLong"/>
> >       </xsd:complexType>
> >
> >       <xsd:complexType name="message">
> >         <xsd:complexContent>
> >           <xsd:extension base="test:abstractMessage">
> >             <xsd:choice>
> >               <xsd:element name="userId" type="xsd:string"/>
> >               <xsd:element name="content" type="xsd:string"/>
> >             </xsd:choice>
> >           </xsd:extension>
> >         </xsd:complexContent>
> >       </xsd:complexType>
> >
> >       <xsd:element name="messageReq" type="test:message"/>
> >       <xsd:element name="messageResp" type="test:message"/>
> >     </xsd:schema>
> >   </wsdl:types>
> >
> > <!-- ==================== Messages
> > ======================================== -->
> >
> >   <wsdl:message name="messageRequest">
> >     <wsdl:part name="parameters" element="test:messageReq"/>
> >   </wsdl:message>
> >   <wsdl:message name="messageResponse">
> >     <wsdl:part name="parameters" element="test:messageResp"/>
> >   </wsdl:message>
> >
> > <!-- ==================== End Of Test Fragment
> > ============================ -->
> >
> > The key features of this fragment that cause the bug are that
> > 1) The variable in the abstract type is declared as an 
> attribute, not an
> > element
> > 2) The elements in the extended type are declared in choice tags.
> >
> > Is this an AXIS2 bug or is just a bad XSD? If a bug should 
> I create a
> > JIRA? I cannot see any reports of this in either the 
> mailing list or the
> > JIRA repository.
> >
> > Can anybody suggest a work around that would produce 
> exactly the same
> > SOAP, as I am using this against a 3rd party interface 
> (supplied by a
> > large San Francisco based router manufacturer that shall remain
> > nameless) so have no control over the format of the messages.
> >
> > I did try to replicate this in 1.3 RC2 but I see that the 
> wsdl2java task
> > was omitted. I notice as I am writing this that RC3 has just been
> > released so I will test against that later today.
> >
> >
> > Steve Hindmarch
> >
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> 
> 
> -- 
> Davanum Srinivas :: http://davanum.wordpress.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [Axis2 1.2] Unresolved symbol when using attribute

Posted by Davanum Srinivas <da...@gmail.com>.
RC3 has the wsdl2java task :) Yes, please try that.

-- dims

On 8/3/07, stephen.hindmarch@bt.com <st...@bt.com> wrote:
> I am using Axis2 1.2 and the AntCodegenTask.
>
> I have been struggling with the following error in some vendor supplied
> wsdl. I use the wsdl2java ant task to generate the java code and then
> get this compiler error.
>
> compile:
>     [mkdir] Created dir: /home/sjh/Misc/xml/soapTest/classes
>     [javac] Compiling 8 source files to
> /home/sjh/Misc/xml/soapTest/classes
>     [javac]
> /home/sjh/Misc/xml/soapTest/java/src/localhost/testwsdl/Message.java:28:
> cannot resolve symbol
>     [javac] symbol  : variable localSequenceTracker
>     [javac] location: class localhost.testwsdl.Message
>     [javac]                    localSequenceTracker = false;
>     [javac]                    ^
>     [javac] 1 error
>
> Looking in the java the Message class extends an abstract class
> AbstractMessage, which defines a protected variable "sequence". The
> message class then tries to the tracker for this variable but does not
> declare the tracker.
>
> I have stripped the wsdl down to a simple test case, the key fragment is
> shown below.
>
> <!-- ==================== Test Fragment
> =================================== -->
> <!-- ==================== Types
> =========================================== -->
>
>   <wsdl:types>
>     <xsd:schema
>       targetNamespace="http://localhost/testWsdl"
>       >
>
>       <xsd:complexType name="abstractMessage" abstract="true">
>         <xsd:attribute name="sequence" type="xsd:unsignedLong"/>
>       </xsd:complexType>
>
>       <xsd:complexType name="message">
>         <xsd:complexContent>
>           <xsd:extension base="test:abstractMessage">
>             <xsd:choice>
>               <xsd:element name="userId" type="xsd:string"/>
>               <xsd:element name="content" type="xsd:string"/>
>             </xsd:choice>
>           </xsd:extension>
>         </xsd:complexContent>
>       </xsd:complexType>
>
>       <xsd:element name="messageReq" type="test:message"/>
>       <xsd:element name="messageResp" type="test:message"/>
>     </xsd:schema>
>   </wsdl:types>
>
> <!-- ==================== Messages
> ======================================== -->
>
>   <wsdl:message name="messageRequest">
>     <wsdl:part name="parameters" element="test:messageReq"/>
>   </wsdl:message>
>   <wsdl:message name="messageResponse">
>     <wsdl:part name="parameters" element="test:messageResp"/>
>   </wsdl:message>
>
> <!-- ==================== End Of Test Fragment
> ============================ -->
>
> The key features of this fragment that cause the bug are that
> 1) The variable in the abstract type is declared as an attribute, not an
> element
> 2) The elements in the extended type are declared in choice tags.
>
> Is this an AXIS2 bug or is just a bad XSD? If a bug should I create a
> JIRA? I cannot see any reports of this in either the mailing list or the
> JIRA repository.
>
> Can anybody suggest a work around that would produce exactly the same
> SOAP, as I am using this against a 3rd party interface (supplied by a
> large San Francisco based router manufacturer that shall remain
> nameless) so have no control over the format of the messages.
>
> I did try to replicate this in 1.3 RC2 but I see that the wsdl2java task
> was omitted. I notice as I am writing this that RC3 has just been
> released so I will test against that later today.
>
>
> Steve Hindmarch
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Davanum Srinivas :: http://davanum.wordpress.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org