File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Help me in writing client foe this JAX ws Web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Help me in writing client foe this JAX ws Web service" Watch "Help me in writing client foe this JAX ws Web service" New topic
Author

Help me in writing client foe this JAX ws Web service

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi ,

I am unable to write client for my Webservice deployed under glass fish v3 .please help.






My client which is incomplete :please help

import java.net.URL;

import jws.CalculatorService;
import jws.Calculator;
import javax.xml.ws.Service;

import sun.print.resources.serviceui;

public class Hi {

@WebServiceRef(wsdlLocation=
"http://localhost:8089/Ram/Calculator?wsdl")
CalculatorService service ;

public static void main(String argsp[]) throws Exception

{



}
}

The problem is that i am unable to use the method service.getPort to get access to my Port class .

Please help , thanks in advnace .


Save India From Corruption - Anna Hazare.
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
Any particular reason you're not using the wsdl2java tool to create the client code? Have you read the Metro documentation?
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Have you read the Metro documentation?


No , i dont know this tool , for running this tool wsdl2java , do i require any server specific jars installed ??

Why i am unable to call getPort on my service ??

Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
When you tried to learn about wsdl2java, where did you look for information? What terms did you search for?
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

i asked this question as i saw IBM websphere has that tool to my knowledge , correct me if i am wrong .

and this is related to my previous question
"Why i am unable to call getPort on my service ?? "


so that somebody might answer this question which was the actual topic about .
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
i asked this question as i saw IBM websphere has that tool to my knowledge , correct me if i am wrong .

I know nothing about WebSphere, but since you're asking about GlassFish, that's irrelevant anyway. The important point is that Metro -the SOAP stack used by GlassFish- has a tool of that name.
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

that Metro -the SOAP stack used by GlassFish- has a tool of that name.


Thanks Burnham
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Lester, aren't you mistaking the Axis or Apache CXF wsdl2java tool for a GlassFish tool?
GlassFish and Metro uses wsimport, as far as I know.

The wsimport tool is also present in JavaSE 6 and thus require no additional libraries.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
Oops, you're quite right - wsdl2java is used by Axis, Metro uses wsimport. Momentary lapse of reason...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Help me in writing client foe this JAX ws Web service
 
Similar Threads
some basic doubts in web services
Calculator example
Client problem for my JAX-WS web service
jax-ws in glassfish server
Testing a wsdl file