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 Jim Dibble <jd...@amberpoint.com> on 2002/05/01 23:00:42 UTC

Setting targetNamespace for WSDL file

Is it possible to instruct axis to use a particular Uniform Resource
Name (URN) as the targetNamespace in the generated WSDL file?
 
By default, the WSDL's targetNamespace is the same as the service's
/definitions/service/port/address/@location (the URL of the axis-hosted
web service).  I am creating an axis web service we will distribute as
part of a tutorial for our product, along with some sample messages to
send to the web service.  Since I don't know the hostname of the machine
where the user will install the web service, I cannot guess the web
service's URL to use as a namespace inside the sample messages.
Therefore, I must leave it to the user to edit the sample message in
order to modify the operation's namespace.  If it were possible for me
to set the WSDL's targetNamespace as a URN (such as
http://www.amberpoint.com/tutorial), I could avoid this problem.
 
Thanks
 
 

RE: Setting targetNamespace for WSDL file

Posted by Jim Dibble <jd...@amberpoint.com>.
I'd like to be able to use the "?wsdl" method of generating the WSDL
file, but instruct axis to use a URN for the targetNamespace (rather
than using the URL of the web service).
 
Looks like I'll probably have to use the Java2WSDL mechanism with the -n
option.
 
-----Original Message-----
From: Fred Carter [mailto:fred.carter@amberpoint.com] 
Sent: Wednesday, May 01, 2002 2:22 PM
To: axis-user@xml.apache.org; jdibble@amberpoint.com
Subject: RE: Setting targetNamespace for WSDL file
 
  <?xml version="1.0" encoding="UTF-8" ?> 
 <http://unamatrix0:9080/wsgw/ServiceDefinition?name=StockQuote> -
<definitions targetNamespace="urn:ibmwsgw"
xmlns:interface="http://www.ibm.com/namespace/wsif/samples/stockquote"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
  <import
namespace="http://www.ibm.com/namespace/wsif/samples/stockquote"
location="http://unamatrix0:9080/wsgw/ServiceInterface?name=StockQuote"
/> 
 <http://unamatrix0:9080/wsgw/ServiceDefinition?name=StockQuote> -
<service name="StockQuote">
 <http://unamatrix0:9080/wsgw/ServiceDefinition?name=StockQuote> - <port
name="StockquotePTApacheAxisBindingPort"
binding="interface:StockquotePTApacheAxisBinding">
  <soap:address location="http://localhost/wsgwaxis1/axisengine" /> 
  </port>
  </service>
  </definitions>
 
Is this what you mean?  The targetNameSpace defines what's send to do
stuff.  The appropriate invocation for this services includes the
methodURI of urn:ibmwsgw#StockQuote
 
--
Fred Carter -- AmberPoint, Inc.
mailto:fred.carter@amberpoint.com
phoneto:+1 (510) 433.6525
-----Original Message-----
From: Jim Dibble [mailto:jdibble@amberpoint.com] 
Sent: Wednesday, May 01, 2002 2:01 PM
To: axis-user@xml.apache.org
Subject: Setting targetNamespace for WSDL file
Is it possible to instruct axis to use a particular Uniform Resource
Name (URN) as the targetNamespace in the generated WSDL file?
 
By default, the WSDL's targetNamespace is the same as the service's
/definitions/service/port/address/@location (the URL of the axis-hosted
web service).  I am creating an axis web service we will distribute as
part of a tutorial for our product, along with some sample messages to
send to the web service.  Since I don't know the hostname of the machine
where the user will install the web service, I cannot guess the web
service's URL to use as a namespace inside the sample messages.
Therefore, I must leave it to the user to edit the sample message in
order to modify the operation's namespace.  If it were possible for me
to set the WSDL's targetNamespace as a URN (such as
http://www.amberpoint.com/tutorial), I could avoid this problem.
 
Thanks
 
 

RE: Setting targetNamespace for WSDL file

Posted by Fred Carter <fr...@amberpoint.com>.
  <?xml version="1.0" encoding="UTF-8" ?> 
 <http://unamatrix0:9080/wsgw/ServiceDefinition?name=StockQuote#> -
<definitions targetNamespace="urn:ibmwsgw"
xmlns:interface="http://www.ibm.com/namespace/wsif/samples/stockquote"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
  <import
namespace="http://www.ibm.com/namespace/wsif/samples/stockquote"
location="http://unamatrix0:9080/wsgw/ServiceInterface?name=StockQuote"
/> 
 <http://unamatrix0:9080/wsgw/ServiceDefinition?name=StockQuote#> -
<service name="StockQuote">
 <http://unamatrix0:9080/wsgw/ServiceDefinition?name=StockQuote#> -
<port name="StockquotePTApacheAxisBindingPort"
binding="interface:StockquotePTApacheAxisBinding">
  <soap:address location="http://localhost/wsgwaxis1/axisengine" /> 
  </port>
  </service>
  </definitions>
 
Is this what you mean?  The targetNameSpace defines what's send to do
stuff.  The appropriate invocation for this services includes the
methodURI of urn:ibmwsgw#StockQuote
 
--
Fred Carter -- AmberPoint, Inc.
mailto:fred.carter@amberpoint.com
phoneto:+1 (510) 433.6525
-----Original Message-----
From: Jim Dibble [mailto:jdibble@amberpoint.com] 
Sent: Wednesday, May 01, 2002 2:01 PM
To: axis-user@xml.apache.org
Subject: Setting targetNamespace for WSDL file


Is it possible to instruct axis to use a particular Uniform Resource
Name (URN) as the targetNamespace in the generated WSDL file?
 
By default, the WSDL's targetNamespace is the same as the service's
/definitions/service/port/address/@location (the URL of the axis-hosted
web service).  I am creating an axis web service we will distribute as
part of a tutorial for our product, along with some sample messages to
send to the web service.  Since I don't know the hostname of the machine
where the user will install the web service, I cannot guess the web
service's URL to use as a namespace inside the sample messages.
Therefore, I must leave it to the user to edit the sample message in
order to modify the operation's namespace.  If it were possible for me
to set the WSDL's targetNamespace as a URN (such as
http://www.amberpoint.com/tutorial), I could avoid this problem.
 
Thanks