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 Andrea Nasato <an...@gmail.com> on 2011/10/06 15:29:17 UTC

problems in generating wsdl from axis1 to axis2

Hi to all,

I'm a newbie of axis2 and I've started using it a couple of days ago in order
to migrate some services from axis1.

I'm having some problems in generating a correct wsdl from a stateless ejb
class. I've started by following this guide:

    http://axis.apache.org/axis2/java/core/docs/ejb-provider.html

I'm using axis2 version 1.6.1 as a webapp inside jboss 4.0.2 on a linux
box with a jdk 1.6.0.

I use maven as a build engine and this is the relevant part of my
pom.xml:
    <plugin>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-java2wsdl-maven-plugin</artifactId>
        <configuration>
          <className>codfe.cp2a8CBean</className>
          <outputFileName>codfe-service-axis2.wsdl</outputFileName>
          <serviceName>cp2a8CBeanService</serviceName>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>java2wsdl</goal>
            </goals>
          </execution>
         </executions>
    </plugin>

In this xml:
    - codfe.cp2a8CBean is the EJB (you'll find a copy in attachment)

The EJB has several methods and every method accepts in input a class,
which is a sort of pojo, and returns another pojo.

The problem is that the wsdl generated doesn't have the definition of
those pojo classes: all I can see is the name of the class as a complex
type but nothing more. For example if method cp49kF receives In_cp49kF
as input, in the wsdl I find:
        <xs:complexType name="In_cp49kF">
                <xs:complexContent>
                    <xs:extension base="ax23:ObParmGroup">
                        <xs:sequence/>
                    </xs:extension>
                </xs:complexContent>
        </xs:complexType>

Instead using axis 1.4 (with maven-axistools plugin for the java2wsdl
task in the same pom.xml, so with the same config and sources/classes)
I get this definition:
   <complexType name="In_cp49kF">
    <complexContent>
     <extension base="tns2:ObParmGroup">
      <sequence>
       <element name="RequestData" nillable="true"
type="impl:In_cp49kF_cRequestData"/>
       <element name="Position" nillable="true"
type="impl:In_cp49kF_cPosition"/>
       <element name="Input_Control" nillable="true"
type="impl:In_cp49kF_cInput_Control"/>
       <element name="Input" nillable="true" type="impl:In_cp49kF_cInput"/>
      </sequence>
     </extension>
    </complexContent>
   </complexType>
which is the one that I'm expecting from axis2.

What I'm I doing wrong?

I give you in attahcment an archive with:
- pom.xml
- EJB class codfe.cp2a8CBean.java
- In_cp49kF.java
- codfe-service-axis1.wsdl -- axis1 generated wsdl
- codfe-service-axis2.wsdl -- axis2 generated wsdl

Thanks in advance,

Bye
gtrev