• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

packaging and deploying jax ws (webservice) in multiple servers

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am a java developer and new to JAX-WS.

i got one requirement to create a web service using jax-ws, packaging using ant build and
deploying it in JBOSS and WEB SPHERE server.

The process which i followed to create a web service below:

1) created a web service class using @webservice annotation
2) created a client side artifacts using wsimport which is provided by Jdk and
created a war and deployed it jboss.
3) wsdl is getting generated while deploying a war using a URI -
(http://localhost:8080/mywebapplication/routing?wsdl)
4) create client class to call the webservice. everything is working fine for me.

Need your expert input for the following below:

1) if i write the ant build script to package the client stubs, how i can use wsdl
location in wsimport ant task. should i use URI
(wsdl="http://localhost:8080/mywebapplication/routing?wsdl") or
(wsdl="d:/route.wsdl")?
which is the best practise?

2) i want to deploy my webservice in JBOSS and WEBSPHERE in different
machine and different port no?
for e.g
http://ip1:port1/mywebapplication/route?wdl
http://ip2:port2/mywebapplication/route?wdl
http://ip3:port3/mywebapplication/route?wdl


how to mention dynamic ipaddress and port no while running ant build script?
how to change the wsdl location and port number in generated wsdl and
RoutingService client stubs class dynamically? (dont want to change soad address
location manually)


Do i need to use wsgen to generate server stubs?


Need your inputs in packaging and deploying jax ws in multiple servers.

Thanks in advance.
 
Ranch Hand
Posts: 343
Mac OS X Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Moorthy Rajendran wrote:I am a java developer and new to JAX-WS.

i got one requirement to create a web service using jax-ws, packaging using ant build and
deploying it in JBOSS and WEB SPHERE server.

The process which i followed to create a web service below:

1) created a web service class using @webservice annotation
2) created a client side artifacts using wsimport which is provided by Jdk and
created a war and deployed it jboss.
3) wsdl is getting generated while deploying a war using a URI -
(http://localhost:8080/mywebapplication/routing?wsdl)
4) create client class to call the webservice. everything is working fine for me.

Need your expert input for the following below:



1) if i write the ant build script to package the client stubs, how i can use wsdl
location in wsimport ant task. should i use URI
(wsdl="http://localhost:8080/mywebapplication/routing?wsdl") or
(wsdl="d:/route.wsdl")?
which is the best practise?



I think you are building the jar and then would like to deploy it. In that case, since build will be a pre-deployment step, you will not be able to get the wsdl from the server location. You will have to obviously take it from your local directory.


2) i want to deploy my webservice in JBOSS and WEBSPHERE in different
machine and different port no?
for e.g
http://ip1:port1/mywebapplication/route?wdl
http://ip2:port2/mywebapplication/route?wdl
http://ip3:port3/mywebapplication/route?wdl


how to mention dynamic ipaddress and port no while running ant build script?
how to change the wsdl location and port number in generated wsdl and
RoutingService client stubs class dynamically? (dont want to change soad address
location manually)



As far as I am concern, I generally do so using the combination of properties file, ant and python script. During the build, I call my python script to take care of multiple resources.






Do i need to use wsgen to generate server stubs?


Hope somebody else answers this. It has been time since I created a true webservice. For past two-three years I am working on Enterprise Service Bus.


Need your inputs in packaging and deploying jax ws in multiple servers.

Thanks in advance.



 
Moorthy Rajendran
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Palak,

Thanks for your reply.

while packaging client stubs and ws client java file , i dont know where i m going deploy (not aware of IP and PORT).
so i cant mention IP and PORT number directly in URL.

URL url = new URL(baseUrl, "http://your-server:your-port-no/MyClientStub/MyClientStubProxy/#%7Bhttp%3A%2F%2Fwww.openuri.org%2F%7DMyClientStub?wsdl"); in my client file directly when i packaging jaxws client files.

Requirement is to create a jar which will contains client stubs java file and client file through ant build file. (mywsclient.jar)

do i need to create any properties file to mention IP and PORT no and read it from ant build xml and change the wsdl location in RoutingService.java during creating the mywsclient.jar?

Could you please send me some sample code for reference.

Thanks in advance.

 
Palak Mathur
Ranch Hand
Posts: 343
Mac OS X Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Moorthy Rajendran wrote:Hi Palak,

Thanks for your reply.

while packaging client stubs and ws client java file , i dont know where i m going deploy (not aware of IP and PORT).
so i cant mention IP and PORT number directly in URL.

URL url = new URL(baseUrl, "http://your-server:your-port-no/MyClientStub/MyClientStubProxy/#%7Bhttp%3A%2F%2Fwww.openuri.org%2F%7DMyClientStub?wsdl"); in my client file directly when i packaging jaxws client files.

Requirement is to create a jar which will contains client stubs java file and client file through ant build file. (mywsclient.jar)

do i need to create any properties file to mention IP and PORT no and read it from ant build xml and change the wsdl location in RoutingService.java during creating the mywsclient.jar?

Could you please send me some sample code for reference.

Thanks in advance.




I am sure that you must be knowing the IP and Port when are you deploying on a particular domain. If you know that then you can certainly create a Properties file and try to work so as to fetch the details from that file.
 
Moorthy Rajendran
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Palak. i got it will create the properties file with "service.url" which where services are running and override wsdl location using END POINT ADDRESS propery.
 
Palak Mathur
Ranch Hand
Posts: 343
Mac OS X Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Moorthy Rajendran wrote:Thanks a lot Palak. i got it will create the properties file with "service.url" which where services are running and override wsdl location using END POINT ADDRESS propery.



You are most welcome.
 
He got surgery to replace his foot with a pig. He said it was because of this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic