You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Stephane Roy (JIRA)" <ji...@apache.org> on 2007/06/05 10:45:26 UTC

[jira] Issue Comment Edited: (AXIS2-2755) Incomplete code generation with wsdl2java, in adb mode

    [ https://issues.apache.org/jira/browse/AXIS2-2755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12501486 ] 

Stephane Roy edited comment on AXIS2-2755 at 6/5/07 1:44 AM:
-------------------------------------------------------------

Amila,

I followed your advice and I modified my initial XSD schema to add the definition 'elementFormDefault="qualified"'. I have now something like this:

<xsd:schema 
  elementFormDefault="qualified" ...>
...
  <xsd:complexType name="typeA">
    <xsd:sequence>

      <xsd:element name="typeB">
        <xsd:simpleType>
          <xsd:restriction base="xsd:positiveInteger">
            <xsd:minExclusive value="01"/>
            <xsd:maxInclusive value="99"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>

    </xsd:sequence>
  </xsd:complexType>
... 


I generated the server code and the new source is indeed compiling. However there is now another problem with the XSD schema (xsd0.xsd), generated by the wsdl2java command in the 'resources' sub-directory. It reads:

...
<xsd:complexType name="typeA">
<xsd:sequence>
<xsd:element name="typeB" type="tns:typeB_type1">
</xsd:sequence>
</xsd:complexType>
...

But the definition for the referenced type 'typeB_type1' is nowhere to be found in the schema.

Therefore one cannot generate the code for a web service client based on the deployed WSDL, because of this problem.

SR


 was:
Amila,

I followed your advice and I modified my initial XSD schema to add the definition 'elementFormDefault="qualified"'. I have now something like this:

<xsd:schema 
  elementFormDefault="qualified" ...>
...
  <xsd:complexType name="typeA">
    <xsd:sequence>

      <xsd:element name="typeB">
        <xsd:simpleType>
          <xsd:restriction base="xsd:positiveInteger">
            <xsd:minExclusive value="01"/>
            <xsd:maxInclusive value="99"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>

    </xsd:sequence>
  </xsd:complexType>
... 


I generated the server code and the new source is indeed compiling. However there is now another problem with the XSD schema (xsd0.xsd) generated by the wsdl2java command in the 'resources' sub-directory. It reads:

...
<xsd:complexType name="typeA">
<xsd:sequence>
<xsd:element name="typeB" type="tns:typeB_type1">
</xsd:sequence>
</xsd:complexType>
...

But the definition for the referenced type 'typeB_type1' is nowhere to be found in the schema.

Therefore one cannot generate the code for a web service client based on the deployed WSDL, because of this problem.

SR

> Incomplete code generation with wsdl2java, in adb mode
> ------------------------------------------------------
>
>                 Key: AXIS2-2755
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2755
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: wsdl
>    Affects Versions: 1.2
>            Reporter: Stephane Roy
>
> The XSD schema used by my WSDL defines the following types:
> ...
>   <xsd:complexType name="typeA">
>     <xsd:sequence>
>       <xsd:element name="typeB">
>         <xsd:simpleType>
>           <xsd:restriction base="xsd:positiveInteger">
>             <xsd:minExclusive value="01"/>
>             <xsd:maxInclusive value="99"/>
>           </xsd:restriction>
>         </xsd:simpleType>
>       </xsd:element>
>     </xsd:sequence>
>   </xsd:complexType>
> ...
> In short, typeA uses typeB, typeB being defined within typeA.
> I generate the code for the server in adb mode with the command
> $AXIS2_HOME/bin/wsdl2java.sh -uri myService.wsdl -p my.package -o /tmp/my/dir/server -d adb -s -wv 1.1 -ss -sd
> Then in /tmp/my/dir/server/src, I have a java file for typeB, for which the package name is not set ('package ;'). As a result, the java code cannot be compiled.
> I have this problem with Axis2.1.1.1 and with the latest release (Axis2.1.2).
> However, if I change my XSD schema, to have something like this:
> ...
>   <xsd:simpleType name="typeB">
>     <xsd:restriction base="xsd:positiveInteger">
>       <xsd:minExclusive value="01"/>
>       <xsd:maxInclusive value="99"/>
>     </xsd:restriction>
>   </xsd:simpleType>
>   <xsd:complexType name="typeA">
>     <xsd:sequence>
>       <xsd:element name="elementB" type="typeB">
>       </xsd:element>
>     </xsd:sequence>
>   </xsd:complexType>
> ...
> In short, typeB is now defined at the top-level in the XSD schema and typeA defines elementB which uses a reference to typeB.
> Now, the code generation in adb mode works fine and the java files compile.
> It would be nice to be able to generate the java code directly without having to apply a workaround on the XSD schema.
> Thanks in advance.
> PS: This problem has been submitted to the User mailing list:
> http://marc.info/?l=axis-user&m=117880285406963&w=2

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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