You can use the namespace attribute on the wsdl2Java task to map different
namespaces in the WSDL to different packages for the stub classes generated.
For example:
<wsdl2java url="${generated}/spc.wsdl" output="${generated}/src">
<!--mapping namespace="http://localhost:8080/axis/services/SPC"
package="com.firepond.cfg.ws.client"/-->
<mapping namespace="http://server.ws.cfg.firepond.com"
package="com.firepond.cfg.ws.client"/>
<mapping namespace="http://shared.ws.cfg.firepond.com"
package="com.firepond.cfg.ws.client"/>
<mapping namespace="urn:SPC" package="com.firepond.cfg.ws.client"/>
</wsdl2java>
-----Original Message-----
From: Olivier LAMY
To: [EMAIL PROTECTED]
Sent: 3/18/2003 9:50 AM
Subject: Ant task axis-wsdl2java
I have the following wsdl :
- <wsdl:definitions
targetNamespace="http://localhost:8090/axis/services/HotelService"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost:8090/axis/services/HotelService"
xmlns:intf="http://localhost:8090/axis/services/HotelService"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns1="urn:HotelService"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:types>
- <schema targetNamespace="urn:HotelService"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
- <complexType name="HotelBean">
- <sequence>
<element name="hotelCode" nillable="true" type="xsd:string" />
<element name="hotelName" nillable="true" type="xsd:string" />
</sequence>
</complexType>
</schema>
- <schema
targetNamespace="http://localhost:8090/axis/services/HotelService"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
- <complexType name="ArrayOf_tns1_HotelBean">
- <complexContent>
- <restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:HotelBean[]"
/>
</restriction>
</complexContent>
</complexType>
</schema>
</wsdl:types>
- <wsdl:message name="getHotelsBeanResponse">
<wsdl:part name="getHotelsBeanReturn"
type="intf:ArrayOf_tns1_HotelBean"
/>
</wsdl:message>
<wsdl:message name="getHotelsBeanRequest" />
- <wsdl:portType name="HotelService">
- <wsdl:operation name="getHotelsBean">
<wsdl:input message="intf:getHotelsBeanRequest"
name="getHotelsBeanRequest" />
<wsdl:output message="intf:getHotelsBeanResponse"
name="getHotelsBeanResponse" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="HotelServiceSoapBinding" type="intf:HotelService">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getHotelsBean">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="getHotelsBeanRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost:8090/axis/services/HotelService"
use="encoded"
/>
</wsdl:input>
- <wsdl:output name="getHotelsBeanResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost:8090/axis/services/HotelService"
use="encoded"
/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="HotelServiceService">
- <wsdl:port binding="intf:HotelServiceSoapBinding" name="HotelService">
<wsdlsoap:address
location="http://localhost:8090/axis/services/HotelService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
When I used the ant task
<axis-wsdl2java
output="src"
testcase="true"
verbose="true"
url="http://localhost:8090/axis/services/HotelService?wsdl" >
</axis-wsdl2java>
The task generate
package localhost.axis.services.HotelService;
public interface HotelService extends java.rmi.Remote {
public HotelService.HotelBean[] getHotelsBean() throws
java.rmi.RemoteException;
}
Why HotelService.HotelBean[] ?
how to change the packaging name and the hard coding generated with the
url
adress ?
Olivier
**********************************************************************
Ce message �lectronique et tous les fichiers joints ainsi que les
information contenues dans ce message ( ci apr�s "le message" ), sont
confidentiels et destin�s exclusivement � l'usage de la personne �
laquelle ils sont adress�s. Si vous avez re�u ce message par erreur,
merci de le renvoyer � son �metteur et de le d�truire. Toute diffusion,
publication, totale ou partielle ou divulgation sous quelque forme que
se soit non express�ment autoris�es de ce message, sont interdites.
**********************************************************************
This e-mail, any attachments and the information contained therein
("this message") are confidential and intended solely for the use of the
addressee(s). If you have received this message in error please send it
back to the sender and delete it. Unauthorized publication, use,
dissemination or disclosure of this message, either in whole or in part
is strictly prohibited.
**********************************************************************