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 Guy Rixon <gt...@ast.cam.ac.uk> on 2005/08/25 14:44:16 UTC

WSDL2Java ignores namespace mappings and fails to generate some classes

I am using WSDL2Java, via its ant task, from Axis 1.1.

I generate code for a WSDL contract that imports complex types from external
XSD files. I have a setting in the call to the ant task that nominates a
file of namespace-package mappings. I know this mapping-file is getting loaded
as I can see a note to that effect in the build log. However, WSDL2Java
ignores the mappings and generates classes for the XML types using package
names deduced from the namespaces.

Does the namespace-to-mapping feature work for imported schemata?

Elsewhere in the same WSDL contract, I have an operation that returns a part
consisting of a single element. That element has a complex type defined in
an imported schema, as above. In fact, I declare the WSDL part to return a
type, not an element:

  <wsdl:message name="getAvailabilityResponse">
    <wsdl:part type="avail:Availability" name="return"/>
  </wsdl:message>

In the SDI, WSDL2Java generates a method returning an Availability object, as
expected. This time, it respects the namespace-package mapping and uses the
right package. But it doesn't actually generate the Availability class.

Is there some spell I need to cast to get WSDL2Java to do what I want? I seem
to have the choice of right code and wrong package or right package and no
code.

Guy Rixon 				        gtr@ast.cam.ac.uk
Institute of Astronomy   	                Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA		Fax: +44-1223-337523

Re: WSDL2Java ignores namespace mappings and fails to generate some classes

Posted by Guy Rixon <gt...@ast.cam.ac.uk>.
I'd love to upgrade, but my project is stuck on Axis 1.1 for the foreseable
future unless we can derive client stubs, locators etc that work with both
versions. The problem is that we have agents that are both Axis clients and
Axis services. Unless the stubs generated by Axis 1.1 work with the 1.2
libraries, each agent has to be entirely Axis 1.1 or entirely Axis 1.2.

On Thu, 25 Aug 2005, Davanum Srinivas wrote:

> Please don't use Axis 1.1 (use 1.2.1)
>
> thanks,
> dims
>
> On 8/25/05, Guy Rixon <gt...@ast.cam.ac.uk> wrote:
> > I am using WSDL2Java, via its ant task, from Axis 1.1.
> >
> > I generate code for a WSDL contract that imports complex types from external
> > XSD files. I have a setting in the call to the ant task that nominates a
> > file of namespace-package mappings. I know this mapping-file is getting loaded
> > as I can see a note to that effect in the build log. However, WSDL2Java
> > ignores the mappings and generates classes for the XML types using package
> > names deduced from the namespaces.
> >
> > Does the namespace-to-mapping feature work for imported schemata?
> >
> > Elsewhere in the same WSDL contract, I have an operation that returns a part
> > consisting of a single element. That element has a complex type defined in
> > an imported schema, as above. In fact, I declare the WSDL part to return a
> > type, not an element:
> >
> >   <wsdl:message name="getAvailabilityResponse">
> >     <wsdl:part type="avail:Availability" name="return"/>
> >   </wsdl:message>
> >
> > In the SDI, WSDL2Java generates a method returning an Availability object, as
> > expected. This time, it respects the namespace-package mapping and uses the
> > right package. But it doesn't actually generate the Availability class.
> >
> > Is there some spell I need to cast to get WSDL2Java to do what I want? I seem
> > to have the choice of right code and wrong package or right package and no
> > code.
> >
> > Guy Rixon                                       gtr@ast.cam.ac.uk
> > Institute of Astronomy                          Tel: +44-1223-337542
> > Madingley Road, Cambridge, UK, CB3 0HA          Fax: +44-1223-337523
> >
>
>
> --
> Davanum Srinivas : http://wso2.com/ - Oxygenating The Web Service Platform
>

Guy Rixon 				        gtr@ast.cam.ac.uk
Institute of Astronomy   	                Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA		Fax: +44-1223-337523

Re: WSDL2Java ignores namespace mappings and fails to generate some classes

Posted by Guy Rixon <gt...@ast.cam.ac.uk>.
I've just tried it with Axis 1.2.1: same problem. I'll file an issue in JIRA,
but are there any known work-aorunds for this kind of thing?

Cheers,
Guy

On Thu, 25 Aug 2005, Davanum Srinivas wrote:

> Please don't use Axis 1.1 (use 1.2.1)
>
> thanks,
> dims
>
> On 8/25/05, Guy Rixon <gt...@ast.cam.ac.uk> wrote:
> > I am using WSDL2Java, via its ant task, from Axis 1.1.
> >
> > I generate code for a WSDL contract that imports complex types from external
> > XSD files. I have a setting in the call to the ant task that nominates a
> > file of namespace-package mappings. I know this mapping-file is getting loaded
> > as I can see a note to that effect in the build log. However, WSDL2Java
> > ignores the mappings and generates classes for the XML types using package
> > names deduced from the namespaces.
> >
> > Does the namespace-to-mapping feature work for imported schemata?
> >
> > Elsewhere in the same WSDL contract, I have an operation that returns a part
> > consisting of a single element. That element has a complex type defined in
> > an imported schema, as above. In fact, I declare the WSDL part to return a
> > type, not an element:
> >
> >   <wsdl:message name="getAvailabilityResponse">
> >     <wsdl:part type="avail:Availability" name="return"/>
> >   </wsdl:message>
> >
> > In the SDI, WSDL2Java generates a method returning an Availability object, as
> > expected. This time, it respects the namespace-package mapping and uses the
> > right package. But it doesn't actually generate the Availability class.
> >
> > Is there some spell I need to cast to get WSDL2Java to do what I want? I seem
> > to have the choice of right code and wrong package or right package and no
> > code.
> >
> > Guy Rixon                                       gtr@ast.cam.ac.uk
> > Institute of Astronomy                          Tel: +44-1223-337542
> > Madingley Road, Cambridge, UK, CB3 0HA          Fax: +44-1223-337523
> >
>
>
> --
> Davanum Srinivas : http://wso2.com/ - Oxygenating The Web Service Platform
>

Guy Rixon 				        gtr@ast.cam.ac.uk
Institute of Astronomy   	                Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA		Fax: +44-1223-337523

Re: WSDL2Java ignores namespace mappings and fails to generate some classes

Posted by Davanum Srinivas <da...@gmail.com>.
Please don't use Axis 1.1 (use 1.2.1)

thanks,
dims

On 8/25/05, Guy Rixon <gt...@ast.cam.ac.uk> wrote:
> I am using WSDL2Java, via its ant task, from Axis 1.1.
> 
> I generate code for a WSDL contract that imports complex types from external
> XSD files. I have a setting in the call to the ant task that nominates a
> file of namespace-package mappings. I know this mapping-file is getting loaded
> as I can see a note to that effect in the build log. However, WSDL2Java
> ignores the mappings and generates classes for the XML types using package
> names deduced from the namespaces.
> 
> Does the namespace-to-mapping feature work for imported schemata?
> 
> Elsewhere in the same WSDL contract, I have an operation that returns a part
> consisting of a single element. That element has a complex type defined in
> an imported schema, as above. In fact, I declare the WSDL part to return a
> type, not an element:
> 
>   <wsdl:message name="getAvailabilityResponse">
>     <wsdl:part type="avail:Availability" name="return"/>
>   </wsdl:message>
> 
> In the SDI, WSDL2Java generates a method returning an Availability object, as
> expected. This time, it respects the namespace-package mapping and uses the
> right package. But it doesn't actually generate the Availability class.
> 
> Is there some spell I need to cast to get WSDL2Java to do what I want? I seem
> to have the choice of right code and wrong package or right package and no
> code.
> 
> Guy Rixon                                       gtr@ast.cam.ac.uk
> Institute of Astronomy                          Tel: +44-1223-337542
> Madingley Road, Cambridge, UK, CB3 0HA          Fax: +44-1223-337523
> 


-- 
Davanum Srinivas : http://wso2.com/ - Oxygenating The Web Service Platform