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 Raghu Upadhyayula <ru...@responsys.com> on 2009/04/07 18:09:16 UTC

[Axis2] Setting hostname in axis2.xml ????

Hi,

 

I'm using Axis2 1.4 version.  I have to set the hostname in axis2.xml so
that the soap:address location in the WSDL (when user types ?wsdl) uses
that hostname instead of showing a IP address.

 

The problem I have is that my webservices war file is deployed on
multiple servers and I can't manually edit each axis2.xml file for each
server.

 

Is there any option to read the server name from some properties file &
set it to the hostname in axis2.xml programmatically?

 

Thanks

Raghu


RE: [Axis2] Setting hostname in axis2.xml ???? - NOT WORKING

Posted by Raghu Upadhyayula <ru...@responsys.com>.
But if you see the services.xml it already has the class parameter defined as a parameter name "ServiceClass" (see below), instead of as an attribute in the <service/> tag.  Isn't that sufficient.

    <service name="ResponsysWSService">
        <messageReceivers>
            <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="com.rsys.ws.ResponsysWSServiceMessageReceiverInOut"/>
        </messageReceivers>
        <parameter name="ServiceClass">com.rsys.ws.ResponsysWSServiceSkeleton</parameter>
        <parameter name="useOriginalwsdl">true</parameter>
        <parameter name="modifyUserWSDLPortAddress">true</parameter>
	....
	....

Thanks
Raghu

-----Original Message-----
From: Sagara Gunathunga [mailto:sagara.gunathunga@gmail.com] 
Sent: Thursday, April 09, 2009 11:56 PM
To: axis-user@ws.apache.org
Subject: Re: [Axis2] Setting hostname in axis2.xml ???? - NOT WORKING

Hi Raghu,
You have missed 3rd step that i mentioned, you should add "class"
parameter to your service.xml file as follows.

 <service name="ResponsysWSService"
class="com.rsys.ws.ResponsysWSServiceSkeleton">

Hope this will resolve your problem.

Thanks ,



On Fri, Apr 10, 2009 at 1:56 AM, Raghu Upadhyayula
<ru...@responsys.com> wrote:
> Hi Sagara,
>
>        Attached is my skeleton class & service.xml files.
>
> Thanks
> Raghu
>
> -----Original Message-----
> From: Sagara Gunathunga [mailto:sagara.gunathunga@gmail.com]
> Sent: Thursday, April 09, 2009 1:37 PM
> To: axis-user@ws.apache.org
> Subject: Re: [Axis2] Setting hostname in axis2.xml ???? - NOT WORKING
>
> Hi Raghu,
> Can you post your skeleton class along with service.xml file....?
>
> Thanks,
>
> On Thu, Apr 9, 2009 at 11:59 PM, Raghu Upadhyayula
> <ru...@responsys.com> wrote:
>> Hi Sagara,
>>
>>        I have a skeleton class generated from WSDL2Java.  I've changed that skeleton class to implement the ServiceLifeCycle interface & implemented the startup method.
>>
>>        Looks like that startup method is never called, because after that change also I'm getting a private IP address in the soap:address location in WSDL.  I've put a debug point in the startup method & the control never stopped at the debug point.
>>
>> Thanks
>> Raghu
>>
>> -----Original Message-----
>> From: Sagara Gunathunga [mailto:sagara.gunathunga@gmail.com]
>> Sent: Tuesday, April 07, 2009 2:36 PM
>> To: axis-user@ws.apache.org
>> Subject: Re: [Axis2] Setting hostname in axis2.xml ????
>>
>> Hi Raghu ,
>> You can use same "hostname" parameter  programatically either  in
>> service level or module level . one possible approach is given below .
>>
>> 1. Implement the  "ServiceLifeCycle" interface within your service
>> class or as a separate class .
>>
>> 2. set the  value to "hostname" parameter within the startUp ( ...) method.
>>
>>        axisService.getAxisConfiguration().addParameter("hostname",
>> "myhost.com");
>>
>> 3. add your LifeCycle class to service.xml file.
>>
>>    <service name="SimpleService" class="LifeCycleClassName">
>>
>>
>> Thanks
>>
>>
>> On Tue, Apr 7, 2009 at 9:39 PM, Raghu Upadhyayula
>> <ru...@responsys.com> wrote:
>>> Hi,
>>>
>>>
>>>
>>> I’m using Axis2 1.4 version.  I have to set the hostname in axis2.xml so
>>> that the soap:address location in the WSDL (when user types ?wsdl) uses that
>>> hostname instead of showing a IP address.
>>>
>>>
>>>
>>> The problem I have is that my webservices war file is deployed on multiple
>>> servers and I can’t manually edit each axis2.xml file for each server.
>>>
>>>
>>>
>>> Is there any option to read the server name from some properties file & set
>>> it to the hostname in axis2.xml programmatically?
>>>
>>>
>>>
>>> Thanks
>>>
>>> Raghu
>>
>>
>>
>> --
>> Sagara Gunathunga
>>
>> Blog - http://ssagara.blogspot.com
>> Web - http://sagaras.awardspace.com/
>>
>
>
>
> --
> Sagara Gunathunga
>
> Blog - http://ssagara.blogspot.com
> Web - http://sagaras.awardspace.com/
>



-- 
Sagara Gunathunga

Blog - http://ssagara.blogspot.com
Web - http://sagaras.awardspace.com/

RE: [Axis2] Setting hostname in axis2.xml ????` - WORKS NOW --- THANKS

Posted by Raghu Upadhyayula <ru...@responsys.com>.
Thanks Sagara, After adding the class parameter to the service tag, it is working.

Thanks
Raghu

-----Original Message-----
From: Sagara Gunathunga [mailto:sagara.gunathunga@gmail.com] 
Sent: Thursday, April 09, 2009 11:56 PM
To: axis-user@ws.apache.org
Subject: Re: [Axis2] Setting hostname in axis2.xml ???? - NOT WORKING

Hi Raghu,
You have missed 3rd step that i mentioned, you should add "class"
parameter to your service.xml file as follows.

 <service name="ResponsysWSService"
class="com.rsys.ws.ResponsysWSServiceSkeleton">

Hope this will resolve your problem.

Thanks ,



On Fri, Apr 10, 2009 at 1:56 AM, Raghu Upadhyayula
<ru...@responsys.com> wrote:
> Hi Sagara,
>
>        Attached is my skeleton class & service.xml files.
>
> Thanks
> Raghu
>
> -----Original Message-----
> From: Sagara Gunathunga [mailto:sagara.gunathunga@gmail.com]
> Sent: Thursday, April 09, 2009 1:37 PM
> To: axis-user@ws.apache.org
> Subject: Re: [Axis2] Setting hostname in axis2.xml ???? - NOT WORKING
>
> Hi Raghu,
> Can you post your skeleton class along with service.xml file....?
>
> Thanks,
>
> On Thu, Apr 9, 2009 at 11:59 PM, Raghu Upadhyayula
> <ru...@responsys.com> wrote:
>> Hi Sagara,
>>
>>        I have a skeleton class generated from WSDL2Java.  I've changed that skeleton class to implement the ServiceLifeCycle interface & implemented the startup method.
>>
>>        Looks like that startup method is never called, because after that change also I'm getting a private IP address in the soap:address location in WSDL.  I've put a debug point in the startup method & the control never stopped at the debug point.
>>
>> Thanks
>> Raghu
>>
>> -----Original Message-----
>> From: Sagara Gunathunga [mailto:sagara.gunathunga@gmail.com]
>> Sent: Tuesday, April 07, 2009 2:36 PM
>> To: axis-user@ws.apache.org
>> Subject: Re: [Axis2] Setting hostname in axis2.xml ????
>>
>> Hi Raghu ,
>> You can use same "hostname" parameter  programatically either  in
>> service level or module level . one possible approach is given below .
>>
>> 1. Implement the  "ServiceLifeCycle" interface within your service
>> class or as a separate class .
>>
>> 2. set the  value to "hostname" parameter within the startUp ( ...) method.
>>
>>        axisService.getAxisConfiguration().addParameter("hostname",
>> "myhost.com");
>>
>> 3. add your LifeCycle class to service.xml file.
>>
>>    <service name="SimpleService" class="LifeCycleClassName">
>>
>>
>> Thanks
>>
>>
>> On Tue, Apr 7, 2009 at 9:39 PM, Raghu Upadhyayula
>> <ru...@responsys.com> wrote:
>>> Hi,
>>>
>>>
>>>
>>> I’m using Axis2 1.4 version.  I have to set the hostname in axis2.xml so
>>> that the soap:address location in the WSDL (when user types ?wsdl) uses that
>>> hostname instead of showing a IP address.
>>>
>>>
>>>
>>> The problem I have is that my webservices war file is deployed on multiple
>>> servers and I can’t manually edit each axis2.xml file for each server.
>>>
>>>
>>>
>>> Is there any option to read the server name from some properties file & set
>>> it to the hostname in axis2.xml programmatically?
>>>
>>>
>>>
>>> Thanks
>>>
>>> Raghu
>>
>>
>>
>> --
>> Sagara Gunathunga
>>
>> Blog - http://ssagara.blogspot.com
>> Web - http://sagaras.awardspace.com/
>>
>
>
>
> --
> Sagara Gunathunga
>
> Blog - http://ssagara.blogspot.com
> Web - http://sagaras.awardspace.com/
>



-- 
Sagara Gunathunga

Blog - http://ssagara.blogspot.com
Web - http://sagaras.awardspace.com/

Re: [Axis2] Setting hostname in axis2.xml ???? - NOT WORKING

Posted by Sagara Gunathunga <sa...@gmail.com>.
Hi Raghu,
You have missed 3rd step that i mentioned, you should add "class"
parameter to your service.xml file as follows.

 <service name="ResponsysWSService"
class="com.rsys.ws.ResponsysWSServiceSkeleton">

Hope this will resolve your problem.

Thanks ,



On Fri, Apr 10, 2009 at 1:56 AM, Raghu Upadhyayula
<ru...@responsys.com> wrote:
> Hi Sagara,
>
>        Attached is my skeleton class & service.xml files.
>
> Thanks
> Raghu
>
> -----Original Message-----
> From: Sagara Gunathunga [mailto:sagara.gunathunga@gmail.com]
> Sent: Thursday, April 09, 2009 1:37 PM
> To: axis-user@ws.apache.org
> Subject: Re: [Axis2] Setting hostname in axis2.xml ???? - NOT WORKING
>
> Hi Raghu,
> Can you post your skeleton class along with service.xml file....?
>
> Thanks,
>
> On Thu, Apr 9, 2009 at 11:59 PM, Raghu Upadhyayula
> <ru...@responsys.com> wrote:
>> Hi Sagara,
>>
>>        I have a skeleton class generated from WSDL2Java.  I've changed that skeleton class to implement the ServiceLifeCycle interface & implemented the startup method.
>>
>>        Looks like that startup method is never called, because after that change also I'm getting a private IP address in the soap:address location in WSDL.  I've put a debug point in the startup method & the control never stopped at the debug point.
>>
>> Thanks
>> Raghu
>>
>> -----Original Message-----
>> From: Sagara Gunathunga [mailto:sagara.gunathunga@gmail.com]
>> Sent: Tuesday, April 07, 2009 2:36 PM
>> To: axis-user@ws.apache.org
>> Subject: Re: [Axis2] Setting hostname in axis2.xml ????
>>
>> Hi Raghu ,
>> You can use same "hostname" parameter  programatically either  in
>> service level or module level . one possible approach is given below .
>>
>> 1. Implement the  "ServiceLifeCycle" interface within your service
>> class or as a separate class .
>>
>> 2. set the  value to "hostname" parameter within the startUp ( ...) method.
>>
>>        axisService.getAxisConfiguration().addParameter("hostname",
>> "myhost.com");
>>
>> 3. add your LifeCycle class to service.xml file.
>>
>>    <service name="SimpleService" class="LifeCycleClassName">
>>
>>
>> Thanks
>>
>>
>> On Tue, Apr 7, 2009 at 9:39 PM, Raghu Upadhyayula
>> <ru...@responsys.com> wrote:
>>> Hi,
>>>
>>>
>>>
>>> I’m using Axis2 1.4 version.  I have to set the hostname in axis2.xml so
>>> that the soap:address location in the WSDL (when user types ?wsdl) uses that
>>> hostname instead of showing a IP address.
>>>
>>>
>>>
>>> The problem I have is that my webservices war file is deployed on multiple
>>> servers and I can’t manually edit each axis2.xml file for each server.
>>>
>>>
>>>
>>> Is there any option to read the server name from some properties file & set
>>> it to the hostname in axis2.xml programmatically?
>>>
>>>
>>>
>>> Thanks
>>>
>>> Raghu
>>
>>
>>
>> --
>> Sagara Gunathunga
>>
>> Blog - http://ssagara.blogspot.com
>> Web - http://sagaras.awardspace.com/
>>
>
>
>
> --
> Sagara Gunathunga
>
> Blog - http://ssagara.blogspot.com
> Web - http://sagaras.awardspace.com/
>



-- 
Sagara Gunathunga

Blog - http://ssagara.blogspot.com
Web - http://sagaras.awardspace.com/

RE: [Axis2] Setting hostname in axis2.xml ???? - NOT WORKING

Posted by Raghu Upadhyayula <ru...@responsys.com>.
Hi Sagara,

	Attached is my skeleton class & service.xml files.

Thanks
Raghu

-----Original Message-----
From: Sagara Gunathunga [mailto:sagara.gunathunga@gmail.com] 
Sent: Thursday, April 09, 2009 1:37 PM
To: axis-user@ws.apache.org
Subject: Re: [Axis2] Setting hostname in axis2.xml ???? - NOT WORKING

Hi Raghu,
Can you post your skeleton class along with service.xml file....?

Thanks,

On Thu, Apr 9, 2009 at 11:59 PM, Raghu Upadhyayula
<ru...@responsys.com> wrote:
> Hi Sagara,
>
>        I have a skeleton class generated from WSDL2Java.  I've changed that skeleton class to implement the ServiceLifeCycle interface & implemented the startup method.
>
>        Looks like that startup method is never called, because after that change also I'm getting a private IP address in the soap:address location in WSDL.  I've put a debug point in the startup method & the control never stopped at the debug point.
>
> Thanks
> Raghu
>
> -----Original Message-----
> From: Sagara Gunathunga [mailto:sagara.gunathunga@gmail.com]
> Sent: Tuesday, April 07, 2009 2:36 PM
> To: axis-user@ws.apache.org
> Subject: Re: [Axis2] Setting hostname in axis2.xml ????
>
> Hi Raghu ,
> You can use same "hostname" parameter  programatically either  in
> service level or module level . one possible approach is given below .
>
> 1. Implement the  "ServiceLifeCycle" interface within your service
> class or as a separate class .
>
> 2. set the  value to "hostname" parameter within the startUp ( ...) method.
>
>        axisService.getAxisConfiguration().addParameter("hostname",
> "myhost.com");
>
> 3. add your LifeCycle class to service.xml file.
>
>    <service name="SimpleService" class="LifeCycleClassName">
>
>
> Thanks
>
>
> On Tue, Apr 7, 2009 at 9:39 PM, Raghu Upadhyayula
> <ru...@responsys.com> wrote:
>> Hi,
>>
>>
>>
>> I’m using Axis2 1.4 version.  I have to set the hostname in axis2.xml so
>> that the soap:address location in the WSDL (when user types ?wsdl) uses that
>> hostname instead of showing a IP address.
>>
>>
>>
>> The problem I have is that my webservices war file is deployed on multiple
>> servers and I can’t manually edit each axis2.xml file for each server.
>>
>>
>>
>> Is there any option to read the server name from some properties file & set
>> it to the hostname in axis2.xml programmatically?
>>
>>
>>
>> Thanks
>>
>> Raghu
>
>
>
> --
> Sagara Gunathunga
>
> Blog - http://ssagara.blogspot.com
> Web - http://sagaras.awardspace.com/
>



-- 
Sagara Gunathunga

Blog - http://ssagara.blogspot.com
Web - http://sagaras.awardspace.com/

Re: [Axis2] Setting hostname in axis2.xml ???? - NOT WORKING

Posted by Sagara Gunathunga <sa...@gmail.com>.
Hi Raghu,
Can you post your skeleton class along with service.xml file....?

Thanks,

On Thu, Apr 9, 2009 at 11:59 PM, Raghu Upadhyayula
<ru...@responsys.com> wrote:
> Hi Sagara,
>
>        I have a skeleton class generated from WSDL2Java.  I've changed that skeleton class to implement the ServiceLifeCycle interface & implemented the startup method.
>
>        Looks like that startup method is never called, because after that change also I'm getting a private IP address in the soap:address location in WSDL.  I've put a debug point in the startup method & the control never stopped at the debug point.
>
> Thanks
> Raghu
>
> -----Original Message-----
> From: Sagara Gunathunga [mailto:sagara.gunathunga@gmail.com]
> Sent: Tuesday, April 07, 2009 2:36 PM
> To: axis-user@ws.apache.org
> Subject: Re: [Axis2] Setting hostname in axis2.xml ????
>
> Hi Raghu ,
> You can use same "hostname" parameter  programatically either  in
> service level or module level . one possible approach is given below .
>
> 1. Implement the  "ServiceLifeCycle" interface within your service
> class or as a separate class .
>
> 2. set the  value to "hostname" parameter within the startUp ( ...) method.
>
>        axisService.getAxisConfiguration().addParameter("hostname",
> "myhost.com");
>
> 3. add your LifeCycle class to service.xml file.
>
>    <service name="SimpleService" class="LifeCycleClassName">
>
>
> Thanks
>
>
> On Tue, Apr 7, 2009 at 9:39 PM, Raghu Upadhyayula
> <ru...@responsys.com> wrote:
>> Hi,
>>
>>
>>
>> I’m using Axis2 1.4 version.  I have to set the hostname in axis2.xml so
>> that the soap:address location in the WSDL (when user types ?wsdl) uses that
>> hostname instead of showing a IP address.
>>
>>
>>
>> The problem I have is that my webservices war file is deployed on multiple
>> servers and I can’t manually edit each axis2.xml file for each server.
>>
>>
>>
>> Is there any option to read the server name from some properties file & set
>> it to the hostname in axis2.xml programmatically?
>>
>>
>>
>> Thanks
>>
>> Raghu
>
>
>
> --
> Sagara Gunathunga
>
> Blog - http://ssagara.blogspot.com
> Web - http://sagaras.awardspace.com/
>



-- 
Sagara Gunathunga

Blog - http://ssagara.blogspot.com
Web - http://sagaras.awardspace.com/

RE: [Axis2] Setting hostname in axis2.xml ???? - NOT WORKING

Posted by Raghu Upadhyayula <ru...@responsys.com>.
Hi Sagara,

	I have a skeleton class generated from WSDL2Java.  I've changed that skeleton class to implement the ServiceLifeCycle interface & implemented the startup method.
	
	Looks like that startup method is never called, because after that change also I'm getting a private IP address in the soap:address location in WSDL.  I've put a debug point in the startup method & the control never stopped at the debug point.

Thanks
Raghu

-----Original Message-----
From: Sagara Gunathunga [mailto:sagara.gunathunga@gmail.com] 
Sent: Tuesday, April 07, 2009 2:36 PM
To: axis-user@ws.apache.org
Subject: Re: [Axis2] Setting hostname in axis2.xml ????

Hi Raghu ,
You can use same "hostname" parameter  programatically either  in
service level or module level . one possible approach is given below .

1. Implement the  "ServiceLifeCycle" interface within your service
class or as a separate class .

2. set the  value to "hostname" parameter within the startUp ( ...) method.

        axisService.getAxisConfiguration().addParameter("hostname",
"myhost.com");

3. add your LifeCycle class to service.xml file.

    <service name="SimpleService" class="LifeCycleClassName">


Thanks


On Tue, Apr 7, 2009 at 9:39 PM, Raghu Upadhyayula
<ru...@responsys.com> wrote:
> Hi,
>
>
>
> I’m using Axis2 1.4 version.  I have to set the hostname in axis2.xml so
> that the soap:address location in the WSDL (when user types ?wsdl) uses that
> hostname instead of showing a IP address.
>
>
>
> The problem I have is that my webservices war file is deployed on multiple
> servers and I can’t manually edit each axis2.xml file for each server.
>
>
>
> Is there any option to read the server name from some properties file & set
> it to the hostname in axis2.xml programmatically?
>
>
>
> Thanks
>
> Raghu



-- 
Sagara Gunathunga

Blog - http://ssagara.blogspot.com
Web - http://sagaras.awardspace.com/

RE: [Axis2] Setting hostname in axis2.xml ????

Posted by Raghu Upadhyayula <ru...@responsys.com>.
Hi Sagara,

	I have a skeleton class generated from WSDL2Java.  I've changed that skeleton class to implement the ServiceLifeCycle interface & implemented the startup method.
	
	Looks like that startup method is never called, because after that change also I'm getting a private IP address in the soap:address location in WSDL.  I've put a debug point in the startup method & the control never stopped at the debug point.

Thanks
Raghu

-----Original Message-----
From: Sagara Gunathunga [mailto:sagara.gunathunga@gmail.com] 
Sent: Tuesday, April 07, 2009 2:36 PM
To: axis-user@ws.apache.org
Subject: Re: [Axis2] Setting hostname in axis2.xml ????

Hi Raghu ,
You can use same "hostname" parameter  programatically either  in
service level or module level . one possible approach is given below .

1. Implement the  "ServiceLifeCycle" interface within your service
class or as a separate class .

2. set the  value to "hostname" parameter within the startUp ( ...) method.

        axisService.getAxisConfiguration().addParameter("hostname",
"myhost.com");

3. add your LifeCycle class to service.xml file.

    <service name="SimpleService" class="LifeCycleClassName">


Thanks


On Tue, Apr 7, 2009 at 9:39 PM, Raghu Upadhyayula
<ru...@responsys.com> wrote:
> Hi,
>
>
>
> I’m using Axis2 1.4 version.  I have to set the hostname in axis2.xml so
> that the soap:address location in the WSDL (when user types ?wsdl) uses that
> hostname instead of showing a IP address.
>
>
>
> The problem I have is that my webservices war file is deployed on multiple
> servers and I can’t manually edit each axis2.xml file for each server.
>
>
>
> Is there any option to read the server name from some properties file & set
> it to the hostname in axis2.xml programmatically?
>
>
>
> Thanks
>
> Raghu



-- 
Sagara Gunathunga

Blog - http://ssagara.blogspot.com
Web - http://sagaras.awardspace.com/

Re: [Axis2] Setting hostname in axis2.xml ????

Posted by Sagara Gunathunga <sa...@gmail.com>.
Hi Raghu ,
You can use same "hostname" parameter  programatically either  in
service level or module level . one possible approach is given below .

1. Implement the  "ServiceLifeCycle" interface within your service
class or as a separate class .

2. set the  value to "hostname" parameter within the startUp ( ...) method.

        axisService.getAxisConfiguration().addParameter("hostname",
"myhost.com");

3. add your LifeCycle class to service.xml file.

    <service name="SimpleService" class="LifeCycleClassName">


Thanks


On Tue, Apr 7, 2009 at 9:39 PM, Raghu Upadhyayula
<ru...@responsys.com> wrote:
> Hi,
>
>
>
> I’m using Axis2 1.4 version.  I have to set the hostname in axis2.xml so
> that the soap:address location in the WSDL (when user types ?wsdl) uses that
> hostname instead of showing a IP address.
>
>
>
> The problem I have is that my webservices war file is deployed on multiple
> servers and I can’t manually edit each axis2.xml file for each server.
>
>
>
> Is there any option to read the server name from some properties file & set
> it to the hostname in axis2.xml programmatically?
>
>
>
> Thanks
>
> Raghu



-- 
Sagara Gunathunga

Blog - http://ssagara.blogspot.com
Web - http://sagaras.awardspace.com/