• 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
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

doubt in web service - confused in a class which is neither ws nor client

 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please follow this link: http://java.sun.com/javaee/5/docs/tutorial/doc/bnayn.html#bnayy

In the client class, a static global variable is present of HelloService class. Where is this class??? What's in that class? Later on, they are calling a method named getHelloPort() on this, which returns port that acts as a proxy to the service (Hello class). What is implementation of getHelloPort() method???

Thanks.
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might want to follow the same documentation... Think you need the examples stuff of JEE 5 downloaded locally... And here is what mentioned in the same documentation about HelloService...

-------------------------------------------

Building, Packaging, and Deploying the Service
You can build, package, and deploy the helloservice application using either NetBeans IDE or ant.

Building, Packaging, and Deploying the Service Using NetBeans IDE
Follow these instructions to build, package, and deploy the helloservice example to your Application Server instance using the NetBeans IDE IDE.

In NetBeans IDE, select File→Open Project.

In the Open Project dialog, navigate to tut-install/javaeetutorial5/examples/jaxws/.

Select the helloservice folder.

Select the Open as Main Project check box.

Click Open Project Folder.

In the Projects tab, right-click the helloservice project and select Deploy Project.

This builds and packages to application into helloservice.war, located in tut-install/javaeetutorial5/examples/jaxws/helloservice/dist/, and deploys this WAR file to your Application Server instance.

--------------------------------------
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by arvin ramon:
You might want to follow the same documentation... Think you need the examples stuff of JEE 5 downloaded locally... And here is what mentioned in the same documentation about HelloService...

-------------------------------------------

Building, Packaging, and Deploying the Service
You can build, package, and deploy the helloservice application using either NetBeans IDE or ant.

Building, Packaging, and Deploying the Service Using NetBeans IDE
Follow these instructions to build, package, and deploy the helloservice example to your Application Server instance using the NetBeans IDE IDE.

In NetBeans IDE, select File→Open Project.

In the Open Project dialog, navigate to tut-install/javaeetutorial5/examples/jaxws/.

Select the helloservice folder.

Select the Open as Main Project check box.

Click Open Project Folder.

In the Projects tab, right-click the helloservice project and select Deploy Project.

This builds and packages to application into helloservice.war, located in tut-install/javaeetutorial5/examples/jaxws/helloservice/dist/, and deploys this WAR file to your Application Server instance.

--------------------------------------




Thanks Arvin.

Though I didn't get the code but this class is not coded by us for sure. And so I would want to know who created this class? On basis of what? Why the method name kept is getHelloService() and all such kind of questions.

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Normally if you(client) want to access a web service, you should generate some client side stuffs (it takes care of communication,serialization,etc).
In this example they used the metadata annotation method for generating the clientside stuff.(during the build process - step no 7 - Use wsimport to generate and compile the web service artifacts needed to connect to the service.)

// wsdl location as argument, during the //build process, it well generate //the service class.)
@WebServiceRef(wsdlLocation="http://localhost:8080/
helloservice/hello?wsdl")

static HelloService service;

Then above service refers that hello wsdl file.
with in a single wsdl ,we can define classes and those methods (publish as service).

then set the corresponding end point by calling the getHelloPort() method.
(since with in a single wsdl file we can define more than one service).
Then it will point to the particular class (service class in the server side).

- Elil
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by elilvannan nagarajah:
Hi,
Normally if you(client) want to access a web service, you should generate some client side stuffs (it takes care of communication,serialization,etc).
In this example they used the metadata annotation method for generating the clientside stuff.(during the build process - step no 7 - Use wsimport to generate and compile the web service artifacts needed to connect to the service.)

// wsdl location as argument, during the //build process, it well generate //the service class.)
@WebServiceRef(wsdlLocation="http://localhost:8080/
helloservice/hello?wsdl")

static HelloService service;

Then above service refers that hello wsdl file.
with in a single wsdl ,we can define classes and those methods (publish as service).

then set the corresponding end point by calling the getHelloPort() method.
(since with in a single wsdl file we can define more than one service).
Then it will point to the particular class (service class in the server side).

- Elil



Thanks Elil.

So this @WebServiceRef will take care of everything (creating a service factory for WSDL file that will have methods for each service to get port).

That's pretty cool.

Are these names bound to follow this naming convention:

Bean class: HelloBean
Service factory class: HelloService
Port class for hello service: Hello
Method to get port class: getHelloPort
 
reply
    Bookmark Topic Watch Topic
  • New Topic